2021-05-13 11:17:07 +08:00
|
|
|
#ifndef INDEXSTATUSRECORDER_H
|
|
|
|
#define INDEXSTATUSRECORDER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSettings>
|
|
|
|
#include <QDir>
|
2021-06-10 20:43:57 +08:00
|
|
|
#include <QMutex>
|
2021-05-13 11:17:07 +08:00
|
|
|
#define CONTENT_INDEX_DATABASE_STATE "content_index_database_state"
|
|
|
|
#define INDEX_DATABASE_STATE "index_database_state"
|
|
|
|
#define INOTIFY_NORMAL_EXIT "inotify_normal_exit"
|
2021-06-10 20:43:57 +08:00
|
|
|
#define PENDING_FILE_QUEUE_FINISH "pending_file_queue_finish"
|
2021-05-13 11:17:07 +08:00
|
|
|
#define INDEX_STATUS QDir::homePath() + "/.config/org.ukui/ukui-search/ukui-search-index-status.conf"
|
2021-12-14 14:43:35 +08:00
|
|
|
namespace UkuiSearch {
|
2021-05-13 11:17:07 +08:00
|
|
|
//fixme: we need a better way to record index status.
|
|
|
|
class IndexStatusRecorder : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static IndexStatusRecorder *getInstance();
|
|
|
|
void setStatus(const QString& key, const QVariant& value);
|
|
|
|
const QVariant getStatus(const QString& key);
|
|
|
|
|
|
|
|
private:
|
|
|
|
explicit IndexStatusRecorder(QObject *parent = nullptr);
|
|
|
|
QSettings *m_status;
|
2021-06-10 20:43:57 +08:00
|
|
|
QMutex m_mutex;
|
2021-05-13 11:17:07 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // INDEXSTATUSRECORDER_H
|