55#include " src/ui/MainWindow.h"
66#include " src/util/Utils.h"
77#include " src/editors/EditorBase.h"
8- #include " src/Application.h"
98#include < qaction.h>
109#include < qmenu.h>
1110#include < qevent.h>
@@ -35,33 +34,18 @@ FileSystemBrowser::~FileSystemBrowser()
3534 delete ui;
3635}
3736
38- void FileSystemBrowser::createActions (Application& app)
39- {
40- app.getOrCreateShortcutSettingsSection (" global" , " Global" );
41-
42- #ifdef Q_OS_WIN
43- const QString showInOSName = " Open in Explorer" ;
44- #elif Q_OS_MAC
45- const QString showInOSName = " Reveal in Finder" ;
46- #else
47- const QString showInOSName = " Open in a file manager" ;
48- #endif
49- app.registerAction (" global" , " show_in_os" , showInOSName,
50- " Opens a file folder in an OS file manager" ,
51- QIcon (), QKeySequence (), false );
52- }
53-
5437void FileSystemBrowser::setupContextMenu ()
5538{
5639 setContextMenuPolicy (Qt::DefaultContextMenu);
5740
58- Application* app = qobject_cast<Application*>(qApp);
59-
60- auto actionShowInOS = app->getAction (" global/show_in_os" );
61- connect (actionShowInOS, &QAction::triggered, this , &FileSystemBrowser::showFileInOS);
41+ QAction* actionOpenContainingFolder = new QAction (this );
42+ actionOpenContainingFolder->setText (" Open Containing Folder" );
43+ actionOpenContainingFolder->setToolTip (" Opens a file folder in an OS file manager" );
44+ actionOpenContainingFolder->setStatusTip (" Opens a file folder in an OS file manager" );
45+ connect (actionOpenContainingFolder, &QAction::triggered, this , &FileSystemBrowser::openContainingFolderForSelection);
6246
6347 contextMenu = new QMenu (this );
64- contextMenu->addAction (actionShowInOS );
48+ contextMenu->addAction (actionOpenContainingFolder );
6549}
6650
6751void FileSystemBrowser::contextMenuEvent (QContextMenuEvent* event)
@@ -71,7 +55,7 @@ void FileSystemBrowser::contextMenuEvent(QContextMenuEvent* event)
7155 contextMenu->exec (event->globalPos ());
7256}
7357
74- void FileSystemBrowser::showFileInOS ()
58+ void FileSystemBrowser::openContainingFolderForSelection ()
7559{
7660 auto selection = ui->view ->selectionModel ()->selectedIndexes ();
7761 for (auto modelIndex : selection)
0 commit comments