From 6551c000fc68134932cdc21f2cc7086b34bff30b Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 8 Oct 2011 21:40:34 +0200 Subject: Context menu cleanups - Open the context menu on the mouse-press event, not on the mouse-release event. - Provide an explicit position-information and don't use QCursor::pos(). This fixes the issue that opening a context-menu by the keyboard opens below the cursor. - Provide different signals in the KItemListController for the different context-menu types (item vs. view vs. header). - Implement turning on/off roles by the header-context-menu. --- src/dolphinpart.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/dolphinpart.cpp') diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 89ea457ca..ee05d7784 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -86,8 +86,8 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL this, SLOT(slotItemActivated(KFileItem))); connect(m_view, SIGNAL(tabRequested(KUrl)), this, SLOT(createNewWindow(KUrl))); - connect(m_view, SIGNAL(requestContextMenu(KFileItem,KUrl,QList)), - this, SLOT(slotOpenContextMenu(KFileItem,KUrl,QList))); + connect(m_view, SIGNAL(requestContextMenu(QPoint,KFileItem,KUrl,QList)), + this, SLOT(slotOpenContextMenu(QPoint,KFileItem,KUrl,QList))); connect(m_view, SIGNAL(selectionChanged(KFileItemList)), m_extension, SIGNAL(selectionInfo(KFileItemList))); connect(m_view, SIGNAL(selectionChanged(KFileItemList)), @@ -352,7 +352,8 @@ void DolphinPart::createNewWindow(const KUrl& url) emit m_extension->createNewWindow(url); } -void DolphinPart::slotOpenContextMenu(const KFileItem& _item, +void DolphinPart::slotOpenContextMenu(const QPoint& pos, + const KFileItem& _item, const KUrl&, const QList& customActions) { @@ -430,7 +431,7 @@ void DolphinPart::slotOpenContextMenu(const KFileItem& _item, actionGroups.insert("editactions", editActions); - emit m_extension->popupMenu(QCursor::pos(), + emit m_extension->popupMenu(pos, items, KParts::OpenUrlArguments(), KParts::BrowserArguments(), -- cgit v1.3