diff --git a/src/mirall/syncengine.cpp b/src/mirall/syncengine.cpp index 3e5c6c9c7..b5f4fcc3b 100644 --- a/src/mirall/syncengine.cpp +++ b/src/mirall/syncengine.cpp @@ -265,7 +265,7 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote ) item._fileId = file->file_id; // record the seen files to be able to clean the journal later - _seenFiles[item._file] = QString(); + _seenFiles.insert(item._file); switch(file->error_status) { case CSYNC_STATUS_OK: @@ -655,6 +655,7 @@ void SyncEngine::slotFinished() if( ! _journal->postSyncCleanup( _seenFiles ) ) { qDebug() << "Cleaning of synced "; } + _journal->commit("All Finished.", false); emit treeWalkResult(_syncedItems); finalize(); diff --git a/src/mirall/syncengine.h b/src/mirall/syncengine.h index 5f9c6e1dd..691c1c5f8 100644 --- a/src/mirall/syncengine.h +++ b/src/mirall/syncengine.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -115,7 +116,7 @@ private: SyncJournalDb *_journal; QScopedPointer _propagator; QString _lastDeleted; // if the last item was a path and it has been deleted - QHash _seenFiles; + QSet _seenFiles; QThread _thread; Progress::Info _progressInfo; diff --git a/src/mirall/syncjournaldb.cpp b/src/mirall/syncjournaldb.cpp index 143637c84..956766937 100644 --- a/src/mirall/syncjournaldb.cpp +++ b/src/mirall/syncjournaldb.cpp @@ -491,7 +491,7 @@ SyncJournalFileRecord SyncJournalDb::getFileRecord( const QString& filename ) return rec; } -bool SyncJournalDb::postSyncCleanup(const QHash &items ) +bool SyncJournalDb::postSyncCleanup(const QSet &items ) { QMutexLocker locker(&_mutex); diff --git a/src/mirall/syncjournaldb.h b/src/mirall/syncjournaldb.h index 097c29788..6663df83f 100644 --- a/src/mirall/syncjournaldb.h +++ b/src/mirall/syncjournaldb.h @@ -79,7 +79,7 @@ public: */ void avoidReadFromDbOnNextSync(const QString& fileName); - bool postSyncCleanup( const QHash& items ); + bool postSyncCleanup( const QSet& items ); /* Because sqlite transactions is really slow, we encapsulate everything in big transactions * Commit will actually commit the transaction and create a new one.