logger.log(logger.EXTREME, "Building index runners & timers");
indexRunner = new IndexRunner("indexRunner.log",
Global.getDatabaseUrl(), Global.getIndexDatabaseUrl(), Global.getResourceDatabaseUrl(),
Global.getDatabaseUserid(), Global.getDatabaseUserPassword(), Global.cipherPassword);
indexThread = new QThread(indexRunner, "Index Thread");
indexRunner.indexAttachmentsLocally = Global.indexAttachmentsLocally();
indexRunner.indexImageRecognition = Global.indexImageRecognition();
indexRunner.indexNoteBody = Global.indexNoteBody();
indexRunner.indexNoteTitle = Global.indexNoteTitle();
indexRunner.specialIndexCharacters = Global.getSpecialIndexCharacters();
indexThread.start();
synchronizeAnimationTimer = new QTimer();
synchronizeAnimationTimer.timeout.connect(this, "updateSyncButton()");
indexTimer = new QTimer();
indexTime = 1000*Global.getIndexThreadSleepInterval();
indexTimer.start(indexTime); // Start indexing timer
indexTimer.timeout.connect(this, "indexTimer()");
indexDisabled = false;
indexRunning = false;
logger.log(logger.EXTREME, "Setting sync thread & timers");
syncThreadsReady=1;
syncRunner = new SyncRunner("syncRunner.log",
Global.getDatabaseUrl(), Global.getIndexDatabaseUrl(), Global.getResourceDatabaseUrl(),
Global.getDatabaseUserid(), Global.getDatabaseUserPassword(), Global.cipherPassword);
syncTime = new SyncTimes().timeValue(Global.getSyncInterval());
syncTimer = new QTimer();
syncTimer.timeout.connect(this, "syncTimer()");
syncRunner.status.message.connect(this, "setMessage(String)");
syncRunner.syncSignal.finished.connect(this, "syncThreadComplete(Boolean)");
syncRunner.syncSignal.errorDisconnect.connect(this, "remoteErrorDisconnect()");
syncRunning = false;
if (syncTime > 0) {
automaticSync = true;
syncTimer.start(syncTime*60*1000);
} else {
automaticSync = false;
syncTimer.stop();
}
syncRunner.setEvernoteUpdateCount(Global.getEvernoteUpdateCount());
syncThread = new QThread(syncRunner, "Synchronization Thread");
syncThread.start();
logger.log(logger.EXTREME, "Starting thumnail thread");
pdfReadyQueue = new ArrayList<String>();
thumbnailRunner = new ThumbnailRunner("thumbnailRunner.log",
Global.getDatabaseUrl(), Global.getIndexDatabaseUrl(), Global.getResourceDatabaseUrl(),
Global.getDatabaseUserid(), Global.getDatabaseUserPassword(), Global.cipherPassword);
thumbnailThread = new QThread(thumbnailRunner, "Thumbnail Thread");
thumbnailRunner.noteSignal.thumbnailPageReady.connect(this, "thumbnailHTMLReady(String,QByteArray,Integer)");
thumbnailThread.start();
thumbGenerators = new ArrayList<Thumbnailer>();
thumbnailTimer = new QTimer();
thumbnailTimer.timeout.connect(this, "thumbnailTimer()");