Skip to content

Commit

Permalink
itemsync: Update top rows first
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Holecek <hluk@email.cz>
  • Loading branch information
hluk committed Apr 26, 2020
1 parent d59f4db commit 56bf369
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/itemsync/filewatcher.cpp
Expand Up @@ -493,6 +493,14 @@ void FileWatcher::updateItems()
const QStringList files = listFiles(dir);
m_fileList = listFiles(files, m_formatSettings);
m_batchIndexData = m_indexData;

// Sort so that top rows get updated first.
std::sort(
std::begin(m_batchIndexData), std::end(m_batchIndexData),
[](const IndexData &lhs, const IndexData &rhs){
return lhs.index.row() < rhs.index.row();
});

m_lastBatchIndex = -1;
if ( t.elapsed() > 100 )
log( QString("ItemSync: Files listed in %1 ms").arg(t.elapsed()) );
Expand Down

0 comments on commit 56bf369

Please sign in to comment.