2021-01-09 11:25:07 +08:00
|
|
|
#ifndef FIRSTINDEX_H
|
|
|
|
#define FIRSTINDEX_H
|
|
|
|
|
|
|
|
#include <QThread>
|
|
|
|
#include <QtConcurrent/QtConcurrent>
|
2021-01-11 16:59:50 +08:00
|
|
|
#include <signal.h>
|
2021-01-21 13:50:21 +08:00
|
|
|
#include <QSemaphore>
|
|
|
|
#include<sys/types.h>
|
2021-01-22 09:49:44 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>
|
2021-01-21 13:50:21 +08:00
|
|
|
#include <sys/wait.h>
|
|
|
|
#include <sys/prctl.h>
|
2021-01-09 11:25:07 +08:00
|
|
|
//#include <QtConcurrent>
|
|
|
|
#include "traverse_bfs.h"
|
|
|
|
#include "global-settings.h"
|
|
|
|
#include "index-generator.h"
|
2021-01-11 16:59:50 +08:00
|
|
|
#include "inotify-index.h"
|
2021-01-13 15:59:04 +08:00
|
|
|
#include "file-utils.h"
|
2021-01-09 11:25:07 +08:00
|
|
|
|
|
|
|
class FirstIndex : public QThread, public Traverse_BFS
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FirstIndex(const QString&);
|
|
|
|
~FirstIndex();
|
|
|
|
virtual void DoSomething(const QFileInfo &) final;
|
|
|
|
protected:
|
|
|
|
void run() override;
|
|
|
|
private:
|
|
|
|
FirstIndex(const FirstIndex&) = delete;
|
|
|
|
void operator=(const FirstIndex&) = delete;
|
|
|
|
bool bool_dataBaseStatusOK = false;
|
|
|
|
bool bool_dataBaseExist = false;
|
2021-01-11 16:59:50 +08:00
|
|
|
IndexGenerator* p_indexGenerator = nullptr;
|
2021-01-09 11:25:07 +08:00
|
|
|
|
|
|
|
//here should be refact
|
|
|
|
// MessageListManager* mlm;
|
|
|
|
|
|
|
|
//test
|
|
|
|
QQueue<QVector<QString>>* q_index;
|
|
|
|
QQueue<QString>* q_content_index;
|
|
|
|
const QVector<QString> targetFileTypeVec ={
|
|
|
|
// QString(".doc"),
|
|
|
|
QString(".docx"),
|
|
|
|
// QString(".ppt"),
|
|
|
|
// QString(".pptx"),
|
|
|
|
// QString(".xls"),
|
|
|
|
// QString(".xlsx"),
|
|
|
|
QString(".txt")};
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FIRSTINDEX_H
|