]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincontextmenu.cpp
assure correct update of the enabled/disabled state of the zoom actions (no backport...
[dolphin.git] / src / dolphincontextmenu.cpp
index cf71bc26f6ab285dc99ee97dd218f8f62620e2cc..8e3d02fdf9fb576d500886b84857ab578b322de1 100644 (file)
@@ -251,9 +251,6 @@ void DolphinContextMenu::openViewportContextMenu()
     QAction* columnsMode = m_mainWindow->actionCollection()->action("columns");
     viewModeMenu->addAction(columnsMode);
 
-    QAction* previewsMode = m_mainWindow->actionCollection()->action("previews");
-    viewModeMenu->addAction(previewsMode);
-
     popup->addMenu(viewModeMenu);
 
     popup->addSeparator();
@@ -299,8 +296,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");
@@ -340,7 +339,8 @@ QString DolphinContextMenu::placesName(const KUrl& url) const
 QAction* DolphinContextMenu::createPasteAction()
 {
     QAction* action = 0;
-    if ((m_selectedItems.count() == 1) && m_fileInfo.isDir()) {
+    const bool isDir = !m_fileInfo.isNull() && m_fileInfo.isDir();
+    if (isDir && (m_selectedItems.count() == 1)) {
         action = new QAction(KIcon("edit-paste"), i18nc("@action:inmenu", "Paste Into Folder"), this);
         const QMimeData* mimeData = QApplication::clipboard()->mimeData();
         const KUrl::List pasteData = KUrl::List::fromMimeData(mimeData);