Selective sync: Don't collapse tree when entering mode #7055
authorChristian Kamm <mail@ckamm.de>
Thu, 28 Feb 2019 07:15:46 +0000 (08:15 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:42 +0000 (10:58 +0100)
doExpand() is called when the selective sync editing mode is enabled in
the folder settings view. Previously it'd set the expansion to be
exactly the root items. Now, it just expands any root items that are
currently collapsed, leaving all other item expansion unchanged.

src/gui/accountsettings.cpp

index c8e7670445daff3aa298b6a428594d12a30ff14e..a409b613c3bea882ca0b08e59ca041b61c702b3d 100644 (file)
@@ -261,7 +261,12 @@ void AccountSettings::slotToggleSignInState()
 
 void AccountSettings::doExpand()
 {
-    _ui->_folderList->expandToDepth(0);
+    // Make sure at least the root items are expanded
+    for (int i = 0; i < _model->rowCount(); ++i) {
+        auto idx = _model->index(i);
+        if (!_ui->_folderList->isExpanded(idx))
+            _ui->_folderList->setExpanded(idx, true);
+    }
 }
 
 void AccountSettings::slotShowMnemonic(const QString &mnemonic) {