X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/9b9bccc862274cfe0fd787ea97f375e758d7fabf..711d1c0f0d3cde02cd431d145494b3ef68df4916:/src/dolphincontextmenu.cpp diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index b2ec59e15..55b83c552 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -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);