]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
When you view the context menu of a file/folder and shift is pressed (and the delete...
[dolphin.git] / src / dolphinmainwindow.cpp
index 722a90f9383a4b5883cafb7c28ba40a952f16e4c..6f407a84a5e54f154779d9ebed51776bae2b89d2 100644 (file)
@@ -114,7 +114,8 @@ DolphinMainWindow::DolphinMainWindow(int id) :
     m_actionHandler(0),
     m_remoteEncoding(0),
     m_settingsDialog(0),
-    m_lastHandleUrlStatJob(0)
+    m_lastHandleUrlStatJob(0),
+    m_keyInfo(new KModifierKeyInfo)
 {
     setObjectName("Dolphin#");
 
@@ -1167,6 +1168,12 @@ void DolphinMainWindow::openContextMenu(const KFileItem& item,
                                         const QList<QAction*>& customActions)
 {
     DolphinContextMenu contextMenu(this, item, url);
+
+    if(m_keyInfo.isKeyPressed(Qt::Key_Shift) || m_keyInfo.isKeyLatched(Qt::Key_Shift)) {
+        contextMenu.setShiftIsPressed(true);
+    }
+
+    connect(&m_keyInfo, SIGNAL(keyPressed(Qt::Key, bool)), &contextMenu, SLOT(deleteOrTrashMenuEntry(Qt::Key, bool)));
     contextMenu.setCustomActions(customActions);
     contextMenu.open();
 }