X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/e44ddfa5ab16af7cdcfc1c835e1baa8b32beaa67..bfdc5a44d2d8415c2f9fbe2e536de564eba6d2e4:/src/dolphincontextmenu.cpp diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 22272fb74..f597d52e3 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -27,38 +27,28 @@ #include "dolphinremoveaction.h" #include -#include #include #include #include #include -#include -#include #include #include #include -#include #include -#include -#include -#include +#include #include #include #include #include #include -#include -#include +#include #include -#include #include +#include #include #include -#include -#include -#include #include "views/dolphinview.h" #include "views/viewmodecontroller.h" @@ -67,7 +57,7 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent, const QPoint& pos, const KFileItem& fileInfo, const KUrl& baseUrl) : - KMenu(parent), + QMenu(parent), m_pos(pos), m_mainWindow(parent), m_fileInfo(fileInfo), @@ -132,7 +122,7 @@ void DolphinContextMenu::keyPressEvent(QKeyEvent *ev) if (m_removeAction && ev->key() == Qt::Key_Shift) { m_removeAction->update(); } - KMenu::keyPressEvent(ev); + QMenu::keyPressEvent(ev); } void DolphinContextMenu::keyReleaseEvent(QKeyEvent *ev) @@ -140,7 +130,7 @@ void DolphinContextMenu::keyReleaseEvent(QKeyEvent *ev) if (m_removeAction && ev->key() == Qt::Key_Shift) { m_removeAction->update(); } - KMenu::keyReleaseEvent(ev); + QMenu::keyReleaseEvent(ev); } void DolphinContextMenu::openTrashContextMenu() @@ -200,6 +190,7 @@ void DolphinContextMenu::openItemContextMenu() { Q_ASSERT(!m_fileInfo.isNull()); + QAction* openParentAction = 0; QAction* openParentInNewWindowAction = 0; QAction* openParentInNewTabAction = 0; QAction* addToPlacesAction = 0; @@ -235,7 +226,13 @@ void DolphinContextMenu::openItemContextMenu() } addSeparator(); - } else if (m_baseUrl.protocol().contains("search")) { + } else if (m_baseUrl.protocol().contains("search") || m_baseUrl.protocol().contains("timeline")) { + openParentAction = new QAction(QIcon::fromTheme("document-open-folder"), + i18nc("@action:inmenu", + "Open Path"), + this); + addAction(openParentAction); + openParentInNewWindowAction = new QAction(QIcon::fromTheme("window-new"), i18nc("@action:inmenu", "Open Path in New Window"), @@ -306,6 +303,8 @@ void DolphinContextMenu::openItemContextMenu() PlacesItem* item = model.createPlacesItem(text, selectedUrl); model.appendItemToGroup(item); } + } else if (activatedAction == openParentAction) { + m_command = OpenParentFolder; } else if (activatedAction == openParentInNewWindowAction) { m_command = OpenParentFolderInNewWindow; } else if (activatedAction == openParentInNewTabAction) { @@ -389,7 +388,7 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties& // Insert 'Move to Trash' and/or 'Delete' if (properties.supportsDeleting()) { - const bool showDeleteAction = (KGlobal::config()->group("KDE").readEntry("ShowDeleteCommand", false) || + const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) || !properties.isLocal()); const bool showMoveToTrashAction = (properties.isLocal() && properties.supportsMoving());