[Pkg-owncloud-commits] [owncloud-client] 95/120: FolderModel: Refresh the tree when new folder are added or removed. #3570

Sandro Knauß hefee-guest at moszumanska.debian.org
Mon Aug 24 00:02:51 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 f0e6864639ee0efc7c5c411e959e9b147f4573f0
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Aug 17 12:46:24 2015 +0200

    FolderModel: Refresh the tree when new folder are added or removed. #3570
---
 src/gui/folderstatusmodel.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index da41de0..3e13c54 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -797,6 +797,23 @@ void FolderStatusModel::slotFolderSyncStateChange()
 
     // update the icon etc. now
     slotUpdateFolderState(f);
+
+    if (state == SyncResult::Success) {
+        foreach (const SyncFileItemPtr &i, f->syncResult().syncFileItemVector()) {
+            if (i->_isDirectory && (i->_instruction == CSYNC_INSTRUCTION_NEW
+                    || i->_instruction == CSYNC_INSTRUCTION_REMOVE)) {
+                // There is a new or a removed folder. reset all data
+                _folders[folderIndex]._fetched = false;
+                _folders[folderIndex]._fetching = false;
+                if (!_folders.at(folderIndex)._subs.isEmpty()) {
+                    beginRemoveRows(index(folderIndex), 0, _folders.at(folderIndex)._subs.count() - 1);
+                    _folders[folderIndex]._subs.clear();
+                    endRemoveRows();
+                }
+                return;
+            }
+        }
+    }
 }
 
 void FolderStatusModel::resetFolders()

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