From: Christian Kamm Date: Thu, 28 Feb 2019 07:15:46 +0000 (+0100) Subject: Selective sync: Don't collapse tree when entering mode #7055 X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~283 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a72bf8977920858207078ac61664862700632839;p=nextcloud-desktop.git Selective sync: Don't collapse tree when entering mode #7055 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. --- diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index c8e767044..a409b613c 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -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) {