Added pre and post procesing "event handlers" to the DB backends. Initially u
[qwerkisync] / SyncerThread.cpp
index da36473..2a5e3b1 100644 (file)
@@ -187,7 +187,8 @@ void SyncerThread::run()
 
                        qDebug() << "Importing new events";
 
-                       // Re-parse the new events
+                       // Re-parse the new events and insert them
+                       allBackends.PreInsert();
                        {
                                int idx = 0;
                                foreach(QString filename, newHashesByPath.keys())
@@ -225,9 +226,7 @@ void SyncerThread::run()
                                        emit EventProcessed(idx, newHashes.count());
                                }
                        }
-
-                       // Perform any post-insert cleanup (i.e. reindexing)
-                       allBackends.PostInsert();
+                       allBackends.PostInsert(); // Perform any post-insert cleanup (i.e. reindexing)
 
                        // Need to find a better way of refreshing the conversations view...
                        QProcess::execute("pkill rtcom");