]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincontextmenu.cpp
Improve the selection performance of the details view by factor of 5 (patch provided...
[dolphin.git] / src / dolphincontextmenu.cpp
index 1af74b2e31715f0034ba6e8f8c01da5d9c9c137a..6409ba0fa4146914af583b1cd59f4f9ce1ef2852 100644 (file)
@@ -172,6 +172,11 @@ void DolphinContextMenu::openItemContextMenu()
     Q_ASSERT(!m_fileInfo.isNull());
 
     KMenu* popup = new KMenu(m_mainWindow);
+    if (m_fileInfo.isDir() && (m_selectedUrls.count() == 1)) {
+      popup->addAction(m_mainWindow->actionCollection()->action("open_in_new_window"));
+      popup->addAction(m_mainWindow->actionCollection()->action("open_in_new_tab"));
+      popup->addSeparator();
+    }
     addShowMenubarAction(popup);
     insertDefaultItemActions(popup);
 
@@ -264,8 +269,12 @@ void DolphinContextMenu::openViewportContextMenu()
     QAction* action = popup->exec(QCursor::pos());
     if (action == propertiesAction) {
         const KUrl& url = m_mainWindow->activeViewContainer()->url();
-        KPropertiesDialog dialog(url, m_mainWindow);
-        dialog.exec();
+                
+        KPropertiesDialog* dialog = new KPropertiesDialog(url, m_mainWindow);
+        dialog->setAttribute(Qt::WA_DeleteOnClose);
+        dialog->show();
+        dialog->raise();
+        dialog->activateWindow();
     } else if (action == addToPlacesAction) {
         const KUrl& url = m_mainWindow->activeViewContainer()->url();
         if (url.isValid()) {
@@ -296,8 +305,10 @@ void DolphinContextMenu::insertDefaultItemActions(KMenu* popup)
     popup->addAction(renameAction);
 
     // insert 'Move to Trash' and (optionally) 'Delete'
-    KConfigGroup kdeConfig(KGlobal::config(), "KDE");
-    bool showDeleteCommand = kdeConfig.readEntry("ShowDeleteCommand", false);
+    KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals);
+    KConfigGroup configGroup(globalConfig, "KDE");
+    bool showDeleteCommand = configGroup.readEntry("ShowDeleteCommand", false);
+    
     const KUrl& url = m_mainWindow->activeViewContainer()->url();
     if (url.isLocalFile()) {
         QAction* moveToTrashAction = collection->action("move_to_trash");
@@ -316,10 +327,6 @@ void DolphinContextMenu::addShowMenubarAction(KMenu* menu)
 {
     KAction* showMenuBar = m_mainWindow->showMenuBarAction();
     if (!m_mainWindow->menuBar()->isVisible()) {
-        // TODO: it should not be necessary to uncheck the menu
-        // bar action, but currently the action states don't get
-        // updated if the menu is disabled
-        showMenuBar->setChecked(false);
         menu->addAction(showMenuBar);
         menu->addSeparator();
     }