From 8928c87fc37884ab0198f3f6e8edd2fd4ff3492a Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 22 Apr 2013 15:06:28 +0200 Subject: [PATCH] Removed silly configDir hack from thread. --- src/mirall/csyncthread.cpp | 14 +------------- src/mirall/csyncthread.h | 5 ----- src/mirall/owncloudfolder.cpp | 3 ++- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/mirall/csyncthread.cpp b/src/mirall/csyncthread.cpp index c6d80f6905..262986efb7 100644 --- a/src/mirall/csyncthread.cpp +++ b/src/mirall/csyncthread.cpp @@ -43,8 +43,6 @@ namespace Mirall { /* static variables to hold the credentials */ -QString CSyncThread::_csyncConfigDir; // to be able to remove the lock file. - QMutex CSyncThread::_mutex; QMutex CSyncThread::_syncMutex; @@ -309,11 +307,6 @@ void CSyncThread::startSync() _needsUpdate = false; _mutex.unlock(); - MirallConfigFile cfg; - _mutex.lock(); - _csyncConfigDir = cfg.configPath(); - _mutex.unlock(); - // cleans up behind us and emits finished() to ease error handling CSyncRunScopeHelper helper(_csync_ctx, this); @@ -354,7 +347,7 @@ void CSyncThread::startSync() if( walkOk ) { if( csync_walk_local_tree(_csync_ctx, &walkFinalize, 0) < 0 || csync_walk_remote_tree( _csync_ctx, &walkFinalize, 0 ) < 0 ) { - qDebug() << "Error in finalize treewalk."; + qDebug() << "Error in finalize treewalk."; } else { // emit the treewalk results. emit treeWalkResult(_syncedItems); @@ -363,11 +356,6 @@ void CSyncThread::startSync() qDebug() << Q_FUNC_INFO << "Sync finished"; } -QString CSyncThread::csyncConfigDir() -{ - return _csyncConfigDir; -} - void CSyncThread::progress(const char *remote_url, enum csync_notify_type_e kind, long long o1, long long o2, void *userdata) { diff --git a/src/mirall/csyncthread.h b/src/mirall/csyncthread.h index 0367cb7ec0..2a4173e734 100644 --- a/src/mirall/csyncthread.h +++ b/src/mirall/csyncthread.h @@ -38,8 +38,6 @@ public: CSyncThread(CSYNC *); ~CSyncThread(); - static QString csyncConfigDir(); - QString csyncErrorToString( CSYNC_ERROR_CODE, const char * ); Q_INVOKABLE void startSync(); @@ -76,9 +74,6 @@ private: static QMutex _mutex; static QMutex _syncMutex; - - static QString _csyncConfigDir; - SyncFileItemVector _syncedItems; CSYNC *_csync_ctx; diff --git a/src/mirall/owncloudfolder.cpp b/src/mirall/owncloudfolder.cpp index 39ccd45317..a605656708 100644 --- a/src/mirall/owncloudfolder.cpp +++ b/src/mirall/owncloudfolder.cpp @@ -334,7 +334,8 @@ void ownCloudFolder::slotThreadTreeWalkResult(const SyncFileItemVector& items) void ownCloudFolder::slotTerminateSync() { qDebug() << "folder " << alias() << " Terminating!"; - QString configDir = _csync->csyncConfigDir(); + MirallConfigFile cfg; + QString configDir = cfg.configPath(); qDebug() << "csync's Config Dir: " << configDir; if( _thread ) {