[Pkg-owncloud-commits] [owncloud-client] 98/164: Discovery: Change abort code a bit
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sun Mar 22 11:56:58 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 2eaeaf33fa43aa1dd532d5f95a64eb6421eacae3
Author: Markus Goetz <markus at woboq.com>
Date: Thu Mar 5 16:50:33 2015 +0100
Discovery: Change abort code a bit
Now pressing pause in the UI will not show an error to the user.
---
src/libsync/discoveryphase.cpp | 20 +++++++++++---------
src/libsync/syncengine.cpp | 1 +
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp
index 39947ae..8a47f9a 100644
--- a/src/libsync/discoveryphase.cpp
+++ b/src/libsync/discoveryphase.cpp
@@ -383,7 +383,7 @@ void DiscoveryMainThread::singleDirectoryJobFinishedWithErrorSlot(int csyncErrno
if (!_currentDiscoveryDirectoryResult) {
return; // possibly aborted
}
- qDebug() << Q_FUNC_INFO;
+ qDebug() << Q_FUNC_INFO << csyncErrnoCode << msg;
_currentDiscoveryDirectoryResult->code = csyncErrnoCode;
_currentDiscoveryDirectoryResult->msg = msg;
@@ -405,20 +405,22 @@ void DiscoveryMainThread::singleDirectoryJobFirstDirectoryPermissionsSlot(QStrin
// called from SyncEngine
void DiscoveryMainThread::abort() {
+ if (_singleDirJob) {
+ _singleDirJob->disconnect(SIGNAL(finishedWithError(int,QString)), this);
+ _singleDirJob->disconnect(SIGNAL(firstDirectoryPermissions(QString)), this);
+ _singleDirJob->disconnect(SIGNAL(finishedWithResult(QLinkedList<csync_vio_file_stat_t*>)), this);
+ _singleDirJob->abort();
+ }
if (_currentDiscoveryDirectoryResult) {
if (_discoveryJob->_vioMutex.tryLock()) {
- _currentDiscoveryDirectoryResult->code = EIO; // FIXME aborted
+ _currentDiscoveryDirectoryResult->msg = tr("Aborted by the user"); // Actually also created somewhere else by sync engine
+ _currentDiscoveryDirectoryResult->code = EIO;
_currentDiscoveryDirectoryResult = 0;
_discoveryJob->_vioWaitCondition.wakeAll();
_discoveryJob->_vioMutex.unlock();
}
}
- if (_singleDirJob) {
- _singleDirJob->disconnect(SIGNAL(finishedWithError(int,QString)), this);
- _singleDirJob->disconnect(SIGNAL(firstDirectoryPermissions(QString)), this);
- _singleDirJob->disconnect(SIGNAL(finishedWithResult(QLinkedList<csync_vio_file_stat_t*>)), this);
- _singleDirJob->abort();
- }
+
}
@@ -442,7 +444,7 @@ csync_vio_handle_t* DiscoveryJob::remote_vio_opendir_hook (const char *url,
// Upon awakening from the _vioWaitCondition, iterator should be a valid iterator.
if (directoryResult->code != 0) {
- qDebug() << Q_FUNC_INFO << directoryResult->code << "when opening" << url;
+ qDebug() << Q_FUNC_INFO << directoryResult->code << "when opening" << url << "msg=" << directoryResult->msg;
errno = directoryResult->code;
// save the error string to the context
discoveryJob->_csync_ctx->error_string = qstrdup( directoryResult->msg.toUtf8().constData() );
diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp
index 11cc21a..b86ea2b 100644
--- a/src/libsync/syncengine.cpp
+++ b/src/libsync/syncengine.cpp
@@ -1194,6 +1194,7 @@ AccountPtr SyncEngine::account() const
void SyncEngine::abort()
{
+ qDebug() << Q_FUNC_INFO << _discoveryMainThread;
// Aborts the discovery phase job
if (_discoveryMainThread) {
_discoveryMainThread->abort();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list