[Pkg-owncloud-commits] [owncloud-client] 162/484: Account Settings: A link should make sure all the parents are expanded

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:33 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 89f2a9e6dcb370fe76386f3c5a4781089cf746d5
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Oct 19 18:46:39 2015 +0200

    Account Settings: A link should make sure all the parents are expanded
---
 src/gui/accountsettings.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index d267f3c..962cddd 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -522,16 +522,21 @@ void AccountSettings::slotLinkActivated(const QString& link)
         const QString alias = li[1];
         if(myFolder.endsWith(QLatin1Char('/'))) myFolder.chop(1);
 
+        // Make sure the folder itself is expanded
         Folder *f = FolderMan::instance()->folder(alias);
         QModelIndex folderIndx = _model->indexForPath(f, QString());
-
         if( !ui->_folderList->isExpanded(folderIndx)) {
             ui->_folderList->setExpanded(folderIndx, true);
-            return;
         }
 
         QModelIndex indx = _model->indexForPath(f, myFolder);
         if( indx.isValid() ) {
+            // make sure all the parents are expanded
+            for (auto i = indx.parent(); i.isValid(); i = i.parent()) {
+                if( !ui->_folderList->isExpanded(i)) {
+                    ui->_folderList->setExpanded(i, true);
+                }
+            }
             ui->_folderList->setSelectionMode(QAbstractItemView::SingleSelection);
             ui->_folderList->setCurrentIndex(indx);
             ui->_folderList->scrollTo(indx);

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