[Pkg-owncloud-commits] [owncloud-client] 106/484: Account Settings: Don't expand while clicking on the '...' button

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:22 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 23b5a74c17f5ad300fe118e262f1738d844f1ef8
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Oct 19 18:23:56 2015 +0200

    Account Settings: Don't expand while clicking on the '...' button
---
 src/gui/accountsettings.cpp | 24 ++++++++++--------------
 src/gui/accountsettings.h   |  1 -
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index 39cbdd2..2df2060 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -104,7 +104,8 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) :
     connect(syncNowAction, SIGNAL(triggered()), SLOT(slotSyncCurrentFolderNow()));
     addAction(syncNowAction);
 
-    connect(ui->_folderList, SIGNAL(clicked(QModelIndex)), SLOT(slotFolderActivated(QModelIndex)));
+    connect(ui->_folderList, SIGNAL(clicked(const QModelIndex &)),
+            this, SLOT(slotFolderListClicked(const QModelIndex&)));
 
     connect(ui->selectiveSyncApply, SIGNAL(clicked()), _model, SLOT(slotApplySelectiveSync()));
     connect(ui->selectiveSyncCancel, SIGNAL(clicked()), _model, SLOT(resetFolders()));
@@ -125,9 +126,6 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) :
 
     connect(ui->signInButton, SIGNAL(clicked()) , this, SLOT(slotSignInAccount()));
     connect(ui->deleteButton, SIGNAL(clicked()) , this, SLOT(slotDeleteAccount()));
-
-    QObject::connect(ui->_folderList, SIGNAL(clicked(const QModelIndex &)),
-                     this, SLOT(slotFolderListClicked(const QModelIndex&)));
 }
 
 void AccountSettings::doExpand()
@@ -135,15 +133,6 @@ void AccountSettings::doExpand()
     ui->_folderList->expandToDepth(0);
 }
 
-void AccountSettings::slotFolderListClicked( const QModelIndex& indx )
-{
-    if( _model->classify(indx) == FolderStatusModel::RootFolder  &&
-            _accountState && _accountState->state() == AccountState::Connected ) {
-        bool expanded = ! (ui->_folderList->isExpanded(indx));
-        ui->_folderList->setExpanded(indx, expanded);
-    }
-}
-
 void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
 {
     QTreeView *tv = ui->_folderList;
@@ -180,7 +169,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
     menu->exec(tv->mapToGlobal(pos));
 }
 
-void AccountSettings::slotFolderActivated( const QModelIndex& indx )
+void AccountSettings::slotFolderListClicked(const QModelIndex& indx)
 {
     if (indx.data(FolderStatusDelegate::AddButton).toBool()) {
         if (indx.flags() & Qt::ItemIsEnabled) {
@@ -199,6 +188,13 @@ void AccountSettings::slotFolderActivated( const QModelIndex& indx )
         auto pos = tv->mapFromGlobal(QCursor::pos());
         if (FolderStatusDelegate::optionsButtonRect(tv->visualRect(indx)).contains(pos)) {
             slotCustomContextMenuRequested(pos);
+            return;
+        }
+
+        // Expand root items on single click
+        if(_accountState && _accountState->state() == AccountState::Connected ) {
+            bool expanded = ! (ui->_folderList->isExpanded(indx));
+            ui->_folderList->setExpanded(indx, expanded);
         }
     }
 }
diff --git a/src/gui/accountsettings.h b/src/gui/accountsettings.h
index 4ec7dbd..20b0da2 100644
--- a/src/gui/accountsettings.h
+++ b/src/gui/accountsettings.h
@@ -61,7 +61,6 @@ signals:
     void openFolderAlias( const QString& );
 
 public slots:
-    void slotFolderActivated( const QModelIndex& );
     void slotOpenOC();
     void slotUpdateQuota( qint64,qint64 );
     void slotAccountStateChanged(int state);

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