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