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.
This commit is contained in:
Christian Kamm 2019-02-28 08:15:46 +01:00 committed by Kevin Ottens
parent 2e11f14a6b
commit a72bf89779
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2

View 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) {