[Pkg-owncloud-commits] [owncloud-client] 417/470: Selective sync: Sort folders in FolderStatusModel #4612

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:25:36 UTC 2016


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 074f8eadb19a0a57639b3deb19d0c759fe20758b
Author: Christian Kamm <mail at ckamm.de>
Date:   Thu Apr 28 09:18:38 2016 +0200

    Selective sync: Sort folders in FolderStatusModel #4612
---
 src/gui/folderstatusmodel.cpp   | 17 ++++++++++-------
 src/gui/selectivesyncdialog.cpp |  1 +
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index 55f35b4..746708b 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -574,9 +574,6 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list)
         return;
     }
 
-    QVarLengthArray<int, 10> undecidedIndexes;
-    QVector<SubFolderInfo> newSubs;
-
     std::set<QString> selectiveSyncUndecidedSet; // not QSet because it's not sorted
     foreach (const QString &str, selectiveSyncUndecidedList) {
         if (str.startsWith(parentInfo->_path) || parentInfo->_path == QLatin1String("/")) {
@@ -584,10 +581,16 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list)
         }
     }
 
-    newSubs.reserve(list.size() - 1);
-    for (int i = 1;  // skip the parent item (first in the list)
-            i < list.size(); ++i) {
-        const QString &path = list.at(i);
+    QStringList sortedSubfolders = list;
+    // skip the parent item (first in the list)
+    sortedSubfolders.erase(sortedSubfolders.begin());
+    sortedSubfolders.sort();
+
+    QVarLengthArray<int, 10> undecidedIndexes;
+
+    QVector<SubFolderInfo> newSubs;
+    newSubs.reserve(sortedSubfolders.size());
+    foreach (const QString& path, sortedSubfolders) {
         auto relativePath = path.mid(pathToRemove.size());
         if (parentInfo->_folder->isFileExcludedRelative(relativePath)) {
             continue;
diff --git a/src/gui/selectivesyncdialog.cpp b/src/gui/selectivesyncdialog.cpp
index abc9818..b3e6203 100644
--- a/src/gui/selectivesyncdialog.cpp
+++ b/src/gui/selectivesyncdialog.cpp
@@ -222,6 +222,7 @@ void SelectiveSyncTreeView::slotUpdateDirectories(QStringList list)
         }
     }
 
+    list.sort();
     foreach (QString path, list) {
         auto size = job ? job->_sizes.value(path) : 0;
         path.remove(pathToRemove);

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