Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinmainwindow.cpp
Show First 20 Lines • Show All 792 Lines • ▼ Show 20 Line(s) | 791 | void DolphinMainWindow::openContextMenu(const QPoint& pos, | |||
---|---|---|---|---|---|
793 | const QUrl& url, | 793 | const QUrl& url, | ||
794 | const QList<QAction*>& customActions) | 794 | const QList<QAction*>& customActions) | ||
795 | { | 795 | { | ||
796 | QPointer<DolphinContextMenu> contextMenu = new DolphinContextMenu(this, pos, item, url); | 796 | QPointer<DolphinContextMenu> contextMenu = new DolphinContextMenu(this, pos, item, url); | ||
797 | contextMenu.data()->setCustomActions(customActions); | 797 | contextMenu.data()->setCustomActions(customActions); | ||
798 | const DolphinContextMenu::Command command = contextMenu.data()->open(); | 798 | const DolphinContextMenu::Command command = contextMenu.data()->open(); | ||
799 | 799 | | |||
800 | switch (command) { | 800 | switch (command) { | ||
801 | case DolphinContextMenu::OpenParentFolder: | 801 | case DolphinContextMenu::Command::OpenParentFolder: | ||
802 | changeUrl(KIO::upUrl(item.url())); | 802 | changeUrl(KIO::upUrl(item.url())); | ||
803 | break; | 803 | break; | ||
804 | 804 | | |||
805 | case DolphinContextMenu::OpenParentFolderInNewWindow: | 805 | case DolphinContextMenu::Command::OpenParentFolderInNewWindow: | ||
806 | Dolphin::openNewWindow({KIO::upUrl(item.url())}, this); | 806 | Dolphin::openNewWindow({KIO::upUrl(item.url())}, this); | ||
807 | break; | 807 | break; | ||
808 | 808 | | |||
809 | case DolphinContextMenu::OpenParentFolderInNewTab: | 809 | case DolphinContextMenu::Command::OpenParentFolderInNewTab: | ||
810 | openNewTab(KIO::upUrl(item.url())); | 810 | openNewTab(KIO::upUrl(item.url())); | ||
811 | break; | 811 | break; | ||
812 | 812 | | |||
813 | case DolphinContextMenu::None: | 813 | case DolphinContextMenu::Command::None: | ||
814 | default: | 814 | default: | ||
815 | break; | 815 | break; | ||
816 | } | 816 | } | ||
817 | 817 | | |||
818 | // Delete the menu, unless it has been deleted in its own nested event loop already. | 818 | // Delete the menu, unless it has been deleted in its own nested event loop already. | ||
819 | if (contextMenu) { | 819 | if (contextMenu) { | ||
820 | contextMenu->deleteLater(); | 820 | contextMenu->deleteLater(); | ||
821 | } | 821 | } | ||
▲ Show 20 Lines • Show All 781 Lines • Show Last 20 Lines |