Addressing some compilation warnings:
[qwerkisync] / SyncerThread.cpp
index da36473..e01cb92 100644 (file)
@@ -92,9 +92,11 @@ void SyncerThread::run()
                        QDir().rmpath(CurrentSettings().Directory());
 
                        DBBackends::AllBackends allBackends(CurrentSettings());
-                       EventProcessors::Writer eventWriter(CurrentSettings());
+                       NumberToNameLookup lookup; // Prepare the telephone-address book ID lookup.
+                       EventProcessors::Writer eventWriter(CurrentSettings(), lookup);
                        QObject::connect(&eventWriter, SIGNAL(EventProcessed(int,int)), this, SIGNAL(EventProcessed(int,int)));
                        allBackends.Process(eventWriter);
+                       QObject::disconnect(&eventWriter, SIGNAL(EventProcessed(int,int)), this, SIGNAL(EventProcessed(int,int)));
                }
                else
                {
@@ -167,7 +169,7 @@ void SyncerThread::run()
                        foreach(iHashable::Hash hash, newHashes)
                                qDebug() << hash << endl;
 
-                       // Now an optimisation: group the new hases by the files they come
+                       // Now an optimisation: group the new hashes by the files they come
                        // from. This enables each file to only be parsed once and return
                        // all the required events from it.
                        QHash<QString, QList<iHashable::Hash> > newHashesByPath;
@@ -187,7 +189,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 +228,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");