From 027a865fbc1dbee52bb100e488c869383b1e92df Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 15 Oct 2015 18:50:54 +0200 Subject: [PATCH] Account Settings: Show selective sync buttons after list load Especially nice when having a slower network. For #3839 --- src/gui/accountsettings.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 6dcf06064..2ef99f293 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -91,6 +91,8 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) : connect(_model, SIGNAL(suggestExpand(QModelIndex)), ui->_folderList, SLOT(expand(QModelIndex))); connect(_model, SIGNAL(dirtyChanged()), this, SLOT(refreshSelectiveSyncStatus())); refreshSelectiveSyncStatus(); + connect(_model, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(refreshSelectiveSyncStatus())); QAction *resetFolderAction = new QAction(this); resetFolderAction->setShortcut(QKeySequence(Qt::Key_F5)); @@ -517,6 +519,13 @@ AccountSettings::~AccountSettings() void AccountSettings::refreshSelectiveSyncStatus() { + if (_model->_folders.first()._subs.count() == 0) { + // Don't show when there is no items in model yet. + // It will be called again via rowsInserted() + ui->selectiveSyncStatus->setVisible(false); + return; + } + bool shouldBeVisible = _model->isDirty(); QStringList undecidedFolder; for (int i = 0; !shouldBeVisible && i < _model->rowCount(); ++i) { -- 2.30.2