[Pkg-owncloud-commits] [owncloud-client] 76/484: Account Settings: Show selective sync buttons after list load

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:16 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 027a865fbc1dbee52bb100e488c869383b1e92df
Author: Markus Goetz <markus at woboq.com>
Date:   Thu Oct 15 18:50:54 2015 +0200

    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 6dcf060..2ef99f2 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) {

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