mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
terminate if more than one thread is being started.
This commit is contained in:
parent
86525570aa
commit
f74aa1e9a6
@ -26,6 +26,8 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QSslSocket>
|
||||
#include <QDir>
|
||||
@ -323,6 +325,12 @@ void CSyncThread::handleSyncError(CSYNC *ctx, const char *state) {
|
||||
|
||||
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();
|
||||
CSYNC *csync;
|
||||
int proxyPort = _proxy.port();
|
||||
@ -414,6 +422,8 @@ void CSyncThread::startSync()
|
||||
emit treeWalkResult(_syncedItems);
|
||||
}
|
||||
}
|
||||
syncsRunning--;
|
||||
qDebug() << Q_FUNC_INFO << "Sync finished";
|
||||
}
|
||||
|
||||
void CSyncThread::setConnectionDetails( const QString &user, const QString &passwd, const QNetworkProxy &proxy )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user