[Pkg-owncloud-commits] [owncloud-client] 24/171: SocketAPI: Don't use ERROR for SoftErrors #3944

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Feb 17 09:36:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to annotated tag upstream/2.1.1+dfsg
in repository owncloud-client.

commit 8b5474ff674566af1a8c7ec4cb8243b7acace51f
Author: Christian Kamm <mail at ckamm.de>
Date:   Thu Dec 10 10:42:49 2015 +0100

    SocketAPI: Don't use ERROR for SoftErrors #3944
---
 src/gui/folder.cpp         | 21 ++++++++++++++++++---
 src/libsync/syncfileitem.h |  7 +++++++
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp
index f23b5d8..d15efbf 100644
--- a/src/gui/folder.cpp
+++ b/src/gui/folder.cpp
@@ -622,9 +622,24 @@ void Folder::slotWatchedPathChanged(const QString& path)
     }
 }
 
+/**
+ * Whether this item should get an ERROR icon through the Socket API.
+ *
+ * The Socket API should only present serious, permanent errors to the user.
+ * In particular SoftErrors should just retain their 'needs to be synced'
+ * icon as the problem is most likely going to resolve itself quickly and
+ * automatically.
+ */
+static bool showErrorInSocketApi(const SyncFileItem& item)
+{
+    const auto status = item._status;
+    return status == SyncFileItem::NormalError
+        || status == SyncFileItem::FatalError;
+}
+
 static void addErroredSyncItemPathsToList(const SyncFileItemVector& items, QSet<QString>* set) {
-    Q_FOREACH(const SyncFileItemPtr &item, items) {
-        if (item->hasErrorStatus()) {
+    foreach (const SyncFileItemPtr &item, items) {
+        if (showErrorInSocketApi(*item)) {
             set->insert(item->_file);
         }
     }
@@ -1090,7 +1105,7 @@ void Folder::slotTransmissionProgress(const ProgressInfo &pi)
 // a item is completed: count the errors and forward to the ProgressDispatcher
 void Folder::slotItemCompleted(const SyncFileItem &item, const PropagatorJob& job)
 {
-    if (item.hasErrorStatus()) {
+    if (showErrorInSocketApi(item)) {
         _stateLastSyncItemsWithErrorNew.insert(item._file);
     }
 
diff --git a/src/libsync/syncfileitem.h b/src/libsync/syncfileitem.h
index 1642ab2..26c9ed4 100644
--- a/src/libsync/syncfileitem.h
+++ b/src/libsync/syncfileitem.h
@@ -118,6 +118,13 @@ public:
         return _file.isEmpty();
     }
 
+    /**
+     * True if the item had any kind of error.
+     *
+     * Used for deciding whether an item belongs to the protocol or the
+     * issues list on the activity page and for checking whether an
+     * item should be announced in the notification message.
+     */
     bool hasErrorStatus() const {
         return _status == SyncFileItem::SoftError
                 || _status == SyncFileItem::NormalError

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