[FIX] 🐛🐛🐛 Rest message won't be sent for index generation.
This commit is contained in:
parent
8cc3bf4448
commit
f9963f178e
|
@ -8,12 +8,12 @@ Document::Document()
|
||||||
|
|
||||||
Document::~Document()
|
Document::~Document()
|
||||||
{
|
{
|
||||||
if(m_document)
|
// if(m_document)
|
||||||
delete m_document;
|
// delete m_document;
|
||||||
if(m_index_text)
|
// if(m_index_text)
|
||||||
delete m_index_text;
|
// delete m_index_text;
|
||||||
if(m_unique_term)
|
// if(m_unique_term)
|
||||||
delete m_unique_term;
|
// delete m_unique_term;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Document::setData(QString data)
|
void Document::setData(QString data)
|
||||||
|
|
|
@ -23,6 +23,11 @@ InotifyManagerRefact::InotifyManagerRefact(const QString& path) : Traverse_BFS(p
|
||||||
num2string.insert(IN_Q_OVERFLOW, "IN_Q_OVERFLOW");
|
num2string.insert(IN_Q_OVERFLOW, "IN_Q_OVERFLOW");
|
||||||
num2string.insert(IN_IGNORED, "IN_IGNORED");
|
num2string.insert(IN_IGNORED, "IN_IGNORED");
|
||||||
this->mlm = new MessageListManager();
|
this->mlm = new MessageListManager();
|
||||||
|
|
||||||
|
this->AddWatch("/home");
|
||||||
|
this->Traverse();
|
||||||
|
this->SendRestMessage();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,6 +50,11 @@ void InotifyManagerRefact::DoSomething(const QFileInfo& fileInfo){
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InotifyManagerRefact::SendRestMessage()
|
||||||
|
{
|
||||||
|
this->mlm->SendMessage();
|
||||||
|
}
|
||||||
|
|
||||||
bool InotifyManagerRefact::AddWatch(const QString &path){
|
bool InotifyManagerRefact::AddWatch(const QString &path){
|
||||||
//m_fd = inotify_init();
|
//m_fd = inotify_init();
|
||||||
// qDebug() << "m_fd: " <<m_fd;
|
// qDebug() << "m_fd: " <<m_fd;
|
||||||
|
@ -142,9 +152,9 @@ void InotifyManagerRefact::run(){
|
||||||
}
|
}
|
||||||
// else {
|
// else {
|
||||||
//这里调用删除索引
|
//这里调用删除索引
|
||||||
this->mlm->AddMessage(QVector<QString>() << event->name << (currentPath[event->wd] + '/' + event->name) << QString(bool((event->mask & IN_ISDIR))));
|
// this->mlm->AddMessage(QVector<QString>() << event->name << (currentPath[event->wd] + '/' + event->name) << QString(bool((event->mask & IN_ISDIR))));
|
||||||
this->mlm->SendDeleteMessage();
|
// this->mlm->SendDeleteMessage();
|
||||||
// IndexGenerator::getInstance()->deleteAllIndex(new QStringList(currentPath[event->wd] + '/' + event->name));
|
IndexGenerator::getInstance()->deleteAllIndex(new QStringList(currentPath[event->wd] + '/' + event->name));
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
/*--------------------------------*/
|
/*--------------------------------*/
|
||||||
|
|
|
@ -19,6 +19,7 @@ public:
|
||||||
bool AddWatch(const QString&);
|
bool AddWatch(const QString&);
|
||||||
bool RemoveWatch(const QString&);
|
bool RemoveWatch(const QString&);
|
||||||
virtual void DoSomething(const QFileInfo &) final;
|
virtual void DoSomething(const QFileInfo &) final;
|
||||||
|
void SendRestMessage();
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
protected:
|
protected:
|
||||||
void run() override;
|
void run() override;
|
||||||
|
|
10
src/main.cpp
10
src/main.cpp
|
@ -45,16 +45,6 @@ void centerToScreen(QWidget* widget) {
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
/*-------------InotyifyRefact Test Start---------------*/
|
|
||||||
QTime t1 = QTime::currentTime();
|
|
||||||
InotifyManagerRefact* imr = new InotifyManagerRefact("/home");
|
|
||||||
imr->AddWatch("/home");
|
|
||||||
imr->setPath("/home");
|
|
||||||
imr->Traverse();
|
|
||||||
QTime t2 = QTime::currentTime();
|
|
||||||
qDebug() << t1;
|
|
||||||
qDebug() << t2;
|
|
||||||
/*-------------InotyifyRefact Test End-----------------*/
|
|
||||||
qRegisterMetaType<QVector<QStringList>>("QVector<QStringList>");
|
qRegisterMetaType<QVector<QStringList>>("QVector<QStringList>");
|
||||||
|
|
||||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
|
|
@ -46,8 +46,15 @@ extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int tran
|
||||||
MainWindow::MainWindow(QWidget *parent) :
|
MainWindow::MainWindow(QWidget *parent) :
|
||||||
QMainWindow(parent)
|
QMainWindow(parent)
|
||||||
{
|
{
|
||||||
//testBackServe
|
|
||||||
//testTraverse();
|
/*-------------InotyifyRefact Test Start---------------*/
|
||||||
|
QTime t1 = QTime::currentTime();
|
||||||
|
InotifyManagerRefact* imr = new InotifyManagerRefact("/home");
|
||||||
|
imr->start();
|
||||||
|
QTime t2 = QTime::currentTime();
|
||||||
|
qDebug() << t1;
|
||||||
|
qDebug() << t2;
|
||||||
|
/*-------------InotyifyRefact Test End-----------------*/
|
||||||
|
|
||||||
this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
|
this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
|
||||||
this->setAttribute(Qt::WA_TranslucentBackground, true);
|
this->setAttribute(Qt::WA_TranslucentBackground, true);
|
||||||
|
|
Loading…
Reference in New Issue