2021-04-20 16:24:07 +08:00
|
|
|
#ifndef SEARCHMETHODMANAGER_H
|
|
|
|
#define SEARCHMETHODMANAGER_H
|
|
|
|
|
2022-04-11 10:22:38 +08:00
|
|
|
#include <QObject>
|
2022-03-15 13:53:38 +08:00
|
|
|
#include <QSystemSemaphore>
|
2022-04-14 11:16:26 +08:00
|
|
|
#include <QGSettings/QGSettings>
|
2021-04-20 16:24:07 +08:00
|
|
|
#include "first-index.h"
|
2021-06-10 20:43:57 +08:00
|
|
|
//#include "inotify-index.h"
|
|
|
|
#include "inotify-watch.h"
|
2021-12-14 14:43:35 +08:00
|
|
|
namespace UkuiSearch {
|
2022-04-11 10:22:38 +08:00
|
|
|
class FileIndexManager : public QObject {
|
|
|
|
Q_OBJECT
|
2021-04-20 16:24:07 +08:00
|
|
|
public:
|
2022-04-11 10:22:38 +08:00
|
|
|
static FileIndexManager *getInstance();
|
2021-04-20 16:24:07 +08:00
|
|
|
void searchMethod(FileUtils::SearchMethod sm);
|
2022-04-14 11:16:26 +08:00
|
|
|
void initIndexPathSetFunction();
|
|
|
|
private Q_SLOTS:
|
|
|
|
void handleIndexPathAppend(const QString path, const QStringList blockList);
|
2022-06-02 09:23:53 +08:00
|
|
|
void handleRemovePathAppend(const QString path);
|
2021-04-20 16:24:07 +08:00
|
|
|
private:
|
2022-04-11 10:22:38 +08:00
|
|
|
FileIndexManager(QObject *parent = nullptr);
|
2022-03-15 13:53:38 +08:00
|
|
|
FirstIndex *m_fi;
|
2021-06-10 20:43:57 +08:00
|
|
|
// InotifyIndex* m_ii;
|
|
|
|
InotifyWatch *m_iw = nullptr;
|
2022-03-15 13:53:38 +08:00
|
|
|
QSystemSemaphore m_semaphore;
|
2022-04-14 11:16:26 +08:00
|
|
|
QGSettings *m_searchSettings = nullptr;
|
2021-04-20 16:24:07 +08:00
|
|
|
};
|
2021-04-30 16:28:50 +08:00
|
|
|
}
|
2021-04-20 16:24:07 +08:00
|
|
|
|
|
|
|
#endif // SEARCHMETHODMANAGER_H
|