Update inotify-index.cpp

This commit is contained in:
iaom 2021-01-30 16:32:46 +08:00 committed by GitHub
parent 263714d56a
commit 675630e18a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -76,14 +76,14 @@ void InotifyIndex::DoSomething(const QFileInfo& fileInfo){
QQueue<QVector<QString> >* tempFile = new QQueue<QVector<QString> >; QQueue<QVector<QString> >* tempFile = new QQueue<QVector<QString> >;
tempFile->enqueue(QVector<QString>() << fileInfo.fileName() << fileInfo.absoluteFilePath() << QString(fileInfo.isDir() ? "1" : "0")); tempFile->enqueue(QVector<QString>() << fileInfo.fileName() << fileInfo.absoluteFilePath() << QString(fileInfo.isDir() ? "1" : "0"));
IndexGenerator::getInstance()->creatAllIndex(tempFile); IndexGenerator::getInstance()->creatAllIndex(tempFile);
if (!tempFile) if (tempFile)
delete tempFile; delete tempFile;
for (auto i : this->targetFileTypeVec){ for (auto i : this->targetFileTypeVec){
if (fileInfo.fileName().endsWith(i)){ if (fileInfo.fileName().endsWith(i)){
QQueue<QString>* tempContent = new QQueue<QString>; QQueue<QString>* tempContent = new QQueue<QString>;
tempContent->enqueue(fileInfo.absoluteFilePath()); tempContent->enqueue(fileInfo.absoluteFilePath());
IndexGenerator::getInstance()->creatAllIndex(tempContent); IndexGenerator::getInstance()->creatAllIndex(tempContent);
if (!tempContent) if (tempContent)
delete tempContent; delete tempContent;
} }
} }