diff options
| author | Peter Penz <[email protected]> | 2011-10-08 21:40:34 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-10-08 21:43:55 +0200 |
| commit | 6551c000fc68134932cdc21f2cc7086b34bff30b (patch) | |
| tree | f4892d247c13f988ee68de37ea1700aaf6e80ab2 /src/dolphinpart.cpp | |
| parent | b1b5a6db2e8b9b1fc175d068ba393925d95c9dc6 (diff) | |
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.
Diffstat (limited to 'src/dolphinpart.cpp')
| -rw-r--r-- | src/dolphinpart.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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<QAction*>)), - this, SLOT(slotOpenContextMenu(KFileItem,KUrl,QList<QAction*>))); + connect(m_view, SIGNAL(requestContextMenu(QPoint,KFileItem,KUrl,QList<QAction*>)), + this, SLOT(slotOpenContextMenu(QPoint,KFileItem,KUrl,QList<QAction*>))); 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<QAction*>& 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(), |
