[Pkg-owncloud-commits] [owncloud-client] 08/60: AccountSettings: Use the proper position to show the menu over sub-folder

Sandro Knauß hefee at debian.org
Sat Dec 16 10:38:10 UTC 2017


This is an automated email from the git hooks/post-receive script.

hefee pushed a commit to branch upstream
in repository owncloud-client.

commit e7a91a1169f255cc0c4f861639b486d8655a4a38
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Nov 20 13:23:03 2017 +0100

    AccountSettings: Use the proper position to show the menu over sub-folder
    
    The menu can be open with the keyboard shortcut.
    
    (Fixup for the fix of #5596)
    
    Also use popup instead of exec to show the menu: it's safer as it does
    not re-enter the event loop.
---
 src/gui/accountsettings.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index 23b2872..b66d3bd 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -263,7 +263,6 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
     }
 
     if (_model->classify(index) == FolderStatusModel::SubFolder) {
-        QTreeView *tv = ui->_folderList;
         QMenu *menu = new QMenu(tv);
         menu->setAttribute(Qt::WA_DeleteOnClose);
 
@@ -275,8 +274,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
             ac->setEnabled(false);
         }
 
-        menu->exec(QCursor::pos());
-
+        menu->popup(tv->mapToGlobal(pos));
         return;
     }
 
@@ -291,6 +289,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
     auto folderMan = FolderMan::instance();
 
     QMenu *menu = new QMenu(tv);
+
     menu->setAttribute(Qt::WA_DeleteOnClose);
 
     QAction *ac = menu->addAction(tr("Open folder"));
@@ -316,7 +315,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
 
     ac = menu->addAction(tr("Remove folder sync connection"));
     connect(ac, &QAction::triggered, this, &AccountSettings::slotRemoveCurrentFolder);
-    menu->exec(tv->mapToGlobal(pos));
+    menu->popup(tv->mapToGlobal(pos));
 }
 
 void AccountSettings::slotFolderListClicked(const QModelIndex &indx)

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