feat(file-index):文件moveTo时更新索引

This commit is contained in:
iaom 2024-04-29 11:27:12 +08:00
parent 769919d746
commit 4171fb84a4
2 changed files with 5 additions and 3 deletions

View File

@ -245,7 +245,8 @@ void IndexUpdater::updateAiIndex()
qDebug() << "| remove:" <<file.path(); qDebug() << "| remove:" <<file.path();
indexer.deleteFileIndex({file.path()}); indexer.deleteFileIndex({file.path()});
} }
} else if(file.isModified()) { } else if(file.isModified() || file.isMoveTo()) {
qDebug() << file.path() << "Modified.";
update(&AiIndexer::update); update(&AiIndexer::update);
} else if(FileIndexerConfig::getInstance()->aiIndexFileTarget()[suffix] && !file.isDir()) { } else if(FileIndexerConfig::getInstance()->aiIndexFileTarget()[suffix] && !file.isDir()) {
update(&AiIndexer::addTextFileIndex); update(&AiIndexer::addTextFileIndex);

View File

@ -72,9 +72,10 @@ bool PendingFile::shouldRemoveIndex() const
void PendingFile::merge(const PendingFile& file) void PendingFile::merge(const PendingFile& file)
{ {
// m_created |= file.m_created; m_created |= file.m_created;
m_modified = file.m_modified; m_modified |= file.m_modified;
m_deleted = file.m_deleted; m_deleted = file.m_deleted;
m_moveTo |= file.m_moveTo;
} }
void PendingFile::printFlags() const void PendingFile::printFlags() const