mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 03:49:20 +03:00
terminate if more than one thread is being started.
This commit is contained in:
parent
86525570aa
commit
f74aa1e9a6
1 changed files with 10 additions and 0 deletions
|
@ -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 )
|
||||||
|
|
Loading…
Reference in a new issue