diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2023-01-16 10:21:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-16 10:21:19 +0100 |
| commit | 2d783f86bc23fbc7392a86f7439a8e069f39a499 (patch) | |
| tree | 8377f3180a22af89a555c1d225c60b23603965dd /Source/Core/DolphinQt/MainWindow.cpp | |
| parent | c4f4ecbb628e7531a4c9c349b5151480816531b8 (diff) | |
| parent | 869aa9eb550a3cb9aa538c80444b56b299b8f277 (diff) | |
Merge pull request #11450 from OatmealDome/open-user-dir-qt
MenuBar: Add action which opens the user folder
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/MainWindow.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 210dc895c4..1b3e831ea0 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -6,6 +6,7 @@ #include <QApplication> #include <QCloseEvent> #include <QDateTime> +#include <QDesktopServices> #include <QDir> #include <QDragEnterEvent> #include <QDropEvent> @@ -480,6 +481,7 @@ void MainWindow::ConnectMenuBar() connect(m_menu_bar, &MenuBar::ChangeDisc, this, &MainWindow::ChangeDisc); connect(m_menu_bar, &MenuBar::BootDVDBackup, this, [this](const QString& drive) { StartGame(drive, ScanForSecondDisc::No); }); + connect(m_menu_bar, &MenuBar::OpenUserFolder, this, &MainWindow::OpenUserFolder); // Emulation connect(m_menu_bar, &MenuBar::Pause, this, &MainWindow::Pause); @@ -752,6 +754,14 @@ void MainWindow::EjectDisc() Core::RunAsCPUThread([] { DVDInterface::EjectDisc(DVDInterface::EjectCause::User); }); } +void MainWindow::OpenUserFolder() +{ + std::string path = File::GetUserPath(D_USER_IDX); + + QUrl url = QUrl::fromLocalFile(QString::fromStdString(path)); + QDesktopServices::openUrl(url); +} + void MainWindow::Open() { QStringList files = PromptFileNames(); |
