]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincontextmenu.cpp
SVN_SILENT made messages (.desktop file)
[dolphin.git] / src / dolphincontextmenu.cpp
index b2ec59e1547e392d662fba90f4773019b639ef8f..55b83c552ca9130c5aa8f89257b2bf10e839a14b 100644 (file)
@@ -264,8 +264,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 +300,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");
@@ -337,7 +343,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);