forked from openkylin/ukui-search
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#ifndef SIGNALTRANSFORMER_H
|
|
#define SIGNALTRANSFORMER_H
|
|
|
|
#include <QObject>
|
|
#include <QDBusInterface>
|
|
#include <QMutexLocker>
|
|
#include "app-db-manager.h"
|
|
|
|
using namespace UkuiSearch;
|
|
|
|
class SignalTransformer : public QObject
|
|
{
|
|
Q_CLASSINFO("D-Bus Interface","org.ukui.search.signalTransformer")
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
static SignalTransformer *getTransformer();
|
|
|
|
static QMutex s_mutex;
|
|
|
|
public Q_SLOTS:
|
|
void handleItemUpdate(const ApplicationInfoMap &item);
|
|
void handleItemUpdateAll(const QString &desktopFilePath);
|
|
void handleItemInsert(const QString &desktopFilePath);
|
|
void handleItemDelete(const QString &desktopFilePath);
|
|
void handleSignalTransform();
|
|
|
|
private:
|
|
SignalTransformer(QObject *parent = nullptr);
|
|
SignalTransformer(const SignalTransformer &) = delete;
|
|
SignalTransformer& operator = (const SignalTransformer&) = delete;
|
|
|
|
ApplicationInfoMap m_items2BUpdate;
|
|
QStringList m_items2BUpdateAll;
|
|
QStringList m_items2BInsert;
|
|
QStringList m_items2BDelete;
|
|
|
|
Q_SIGNALS:
|
|
void appDBItemsUpdateAll(const QStringList&);
|
|
void appDBItemsUpdate(const ApplicationInfoMap&);
|
|
void appDBItemsAdd(const QStringList&);
|
|
void appDBItemsDelete(const QStringList&);
|
|
};
|
|
|
|
#endif // SIGNALTRANSFORMER_H
|