Merge remote-tracking branch '1.3' into master

This commit is contained in:
Olivier Goffart 2013-06-21 00:04:01 +02:00
commit 4553fa1d09
5 changed files with 20 additions and 6 deletions

View File

@ -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 )

View File

@ -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();

View File

@ -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();

View File

@ -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;

View File

@ -483,7 +483,10 @@ bool ownCloudInfo::certsUntrusted()
void ownCloudInfo::slotError( QNetworkReply::NetworkError err)
{
qDebug() << "ownCloudInfo Network Error: " << err;
QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
qDebug() << "ownCloudInfo Network Error"
<< err << ":" << reply->errorString();
switch (err) {
case QNetworkReply::ProxyConnectionRefusedError: