diff --git a/VERSION.cmake b/VERSION.cmake index 7c55c1120c..4fb5a162ee 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -1,6 +1,6 @@ set( VERSION_MAJOR 1 ) set( VERSION_MINOR 3 ) set( VERSION_PATCH 0 ) -set( VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}beta3) +set( VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}beta4) set( SOVERSION 0 ) diff --git a/src/mirall/csyncthread.cpp b/src/mirall/csyncthread.cpp index b9d5ff52b8..09397d2fa9 100644 --- a/src/mirall/csyncthread.cpp +++ b/src/mirall/csyncthread.cpp @@ -58,6 +58,8 @@ CSyncThread::~CSyncThread() } +//Convert an error code from csync to a user readable string. +// Keep that function thread safe as it can be called from the sync thread or the main thread QString CSyncThread::csyncErrorToString( CSYNC_ERROR_CODE err, const char *errString ) { QString errStr; @@ -248,8 +250,8 @@ int CSyncThread::treewalkError(TREE_WALK_FILE* file) return 0; if( file && - file->instruction == CSYNC_INSTRUCTION_STAT_ERROR || - file->instruction == CSYNC_INSTRUCTION_ERROR ) { + (file->instruction == CSYNC_INSTRUCTION_STAT_ERROR || + file->instruction == CSYNC_INSTRUCTION_ERROR) ) { _mutex.lock(); _syncedItems[indx]._instruction = file->instruction; _mutex.unlock(); diff --git a/src/mirall/csyncthread.h b/src/mirall/csyncthread.h index 78e3f60606..c6caadb5a6 100644 --- a/src/mirall/csyncthread.h +++ b/src/mirall/csyncthread.h @@ -38,7 +38,7 @@ public: CSyncThread(CSYNC *); ~CSyncThread(); - QString csyncErrorToString( CSYNC_ERROR_CODE, const char * ); + static QString csyncErrorToString( CSYNC_ERROR_CODE, const char * ); Q_INVOKABLE void startSync(); diff --git a/src/mirall/owncloudfolder.cpp b/src/mirall/owncloudfolder.cpp index a01572d943..076b3f0a18 100644 --- a/src/mirall/owncloudfolder.cpp +++ b/src/mirall/owncloudfolder.cpp @@ -98,7 +98,9 @@ ownCloudFolder::ownCloudFolder(const QString &alias, csync_set_auth_callback( _csync_ctx, getauth ); if( csync_init( _csync_ctx ) < 0 ) { - qDebug() << "Could not initialize csync!"; + qDebug() << "Could not initialize csync!" << csync_get_error(_csync_ctx) << csync_get_error_string(_csync_ctx); + slotCSyncError(CSyncThread::csyncErrorToString(csync_get_error(_csync_ctx), csync_get_error_string(_csync_ctx))); + csync_destroy(_csync_ctx); _csync_ctx = 0; } setProxy(); @@ -259,6 +261,13 @@ void ownCloudFolder::startSync() void ownCloudFolder::startSync(const QStringList &pathList) { + if (!_csync_ctx) { + qDebug() << Q_FUNC_INFO << "_csync_ctx is empty. probably because csync_init has failed."; + // the error should already be set + QMetaObject::invokeMethod(this, "slotCSyncFinished", Qt::QueuedConnection); + return; + } + if (_thread && _thread->isRunning()) { qCritical() << "* ERROR csync is still running and new sync requested."; return; diff --git a/src/mirall/owncloudinfo.cpp b/src/mirall/owncloudinfo.cpp index 35e4e8d4f4..fd28ee0a83 100644 --- a/src/mirall/owncloudinfo.cpp +++ b/src/mirall/owncloudinfo.cpp @@ -483,7 +483,10 @@ bool ownCloudInfo::certsUntrusted() void ownCloudInfo::slotError( QNetworkReply::NetworkError err) { - qDebug() << "ownCloudInfo Network Error: " << err; + QNetworkReply *reply = qobject_cast(sender()); + + qDebug() << "ownCloudInfo Network Error" + << err << ":" << reply->errorString(); switch (err) { case QNetworkReply::ProxyConnectionRefusedError: