terminate if more than one thread is being started.

This commit is contained in:
Daniel Molkentin 2013-04-04 17:14:38 +02:00
parent 86525570aa
commit f74aa1e9a6

View file

@ -26,6 +26,8 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <assert.h>
#include <QDebug> #include <QDebug>
#include <QSslSocket> #include <QSslSocket>
#include <QDir> #include <QDir>
@ -323,6 +325,12 @@ void CSyncThread::handleSyncError(CSYNC *ctx, const char *state) {
void CSyncThread::startSync() void CSyncThread::startSync()
{ {
qDebug() << Q_FUNC_INFO << "Sync started";
static int syncsRunning = 0;
syncsRunning++;
assert(syncsRunning == 1);
qDebug() << "starting to sync " << qApp->thread() << QThread::currentThread(); qDebug() << "starting to sync " << qApp->thread() << QThread::currentThread();
CSYNC *csync; CSYNC *csync;
int proxyPort = _proxy.port(); int proxyPort = _proxy.port();
@ -414,6 +422,8 @@ void CSyncThread::startSync()
emit treeWalkResult(_syncedItems); emit treeWalkResult(_syncedItems);
} }
} }
syncsRunning--;
qDebug() << Q_FUNC_INFO << "Sync finished";
} }
void CSyncThread::setConnectionDetails( const QString &user, const QString &passwd, const QNetworkProxy &proxy ) void CSyncThread::setConnectionDetails( const QString &user, const QString &passwd, const QNetworkProxy &proxy )