2022-03-01 10:37:03 +08:00
|
|
|
#ifndef MOUNTDISKLISTENER_H
|
|
|
|
#define MOUNTDISKLISTENER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2022-04-25 10:23:20 +08:00
|
|
|
#include <QDBusInterface>
|
|
|
|
#include <QDBusReply>
|
2022-03-01 10:37:03 +08:00
|
|
|
|
|
|
|
|
|
|
|
class DirWatcher : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static DirWatcher *getDirWatcher();
|
2022-04-25 10:23:20 +08:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
2022-04-14 11:16:26 +08:00
|
|
|
void initDbusService();
|
2022-04-25 10:23:20 +08:00
|
|
|
|
|
|
|
QStringList currentIndexableDir();
|
2022-03-01 10:37:03 +08:00
|
|
|
QStringList currentBlackListOfIndex();
|
|
|
|
|
2022-04-08 11:15:18 +08:00
|
|
|
QStringList currentSearchableDir();
|
|
|
|
QStringList searchableDirForSearchApplication();
|
2022-03-01 10:37:03 +08:00
|
|
|
QStringList blackListOfDir(const QString &dirPath);
|
|
|
|
|
2022-04-12 14:57:22 +08:00
|
|
|
void appendIndexableListItem(const QString &path);
|
|
|
|
void removeIndexableListItem(const QString &path);
|
2022-05-31 10:48:13 +08:00
|
|
|
void sendAppendSignal(const QString &path, const QStringList &blockList);
|
|
|
|
void sendRemoveSignal(const QString&path);
|
|
|
|
Q_SIGNALS:
|
|
|
|
void appendIndexItem(const QString&, const QStringList&);
|
|
|
|
void removeIndexItem(const QString&);
|
2022-03-01 10:37:03 +08:00
|
|
|
private:
|
|
|
|
DirWatcher(QObject *parent = nullptr);
|
2022-04-25 10:23:20 +08:00
|
|
|
~DirWatcher() = default;
|
2022-03-01 10:37:03 +08:00
|
|
|
|
2022-04-25 10:23:20 +08:00
|
|
|
QDBusInterface *m_dbusInterface = nullptr;
|
2022-03-01 10:37:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MOUNTDISKLISTENER_H
|
|
|
|
|