From 2b853cc8bc0d808baf86bb0b327f9f4d06bddcfc Mon Sep 17 00:00:00 2001 From: Stephen McKinney Date: Sat, 15 Feb 2020 08:33:14 -0600 Subject: [PATCH] Don't improperly resolve symlinks when booting games. --- rpcs3/main.cpp | 2 +- rpcs3/rpcs3qt/main_window.cpp | 6 +++--- rpcs3/rpcs3qt/vfs_dialog_tab.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rpcs3/main.cpp b/rpcs3/main.cpp index d9eb203666..3266554083 100644 --- a/rpcs3/main.cpp +++ b/rpcs3/main.cpp @@ -306,7 +306,7 @@ int main(int argc, char** argv) } // Ugly workaround - QTimer::singleShot(2, [path = sstr(QFileInfo(args.at(0)).canonicalFilePath()), argv = std::move(argv)]() mutable + QTimer::singleShot(2, [path = sstr(QFileInfo(args.at(0)).absoluteFilePath()), argv = std::move(argv)]() mutable { Emu.argv = std::move(argv); Emu.SetForceBoot(true); diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index f12ab0953b..adda14e549 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -340,7 +340,7 @@ void main_window::BootElf() // game folder in case of having e.g. a Game Folder with collected links to elf files. // Don't set last path earlier in case of cancelled dialog guiSettings->SetValue(gui::fd_boot_elf, filePath); - const std::string path = sstr(QFileInfo(filePath).canonicalFilePath()); + const std::string path = sstr(QFileInfo(filePath).absoluteFilePath()); gui_log.notice("Booting from BootElf..."); Boot(path, "", true); @@ -357,7 +357,7 @@ void main_window::BootGame() } QString path_last_Game = guiSettings->GetValue(gui::fd_boot_game).toString(); - QString dirPath = QFileDialog::getExistingDirectory(this, tr("Select Game Folder"), path_last_Game, QFileDialog::ShowDirsOnly); + QString dirPath = QFileDialog::getExistingDirectory(this, tr("Select Game Folder"), path_last_Game, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (dirPath == NULL) { @@ -1287,7 +1287,7 @@ void main_window::CreateConnects() QStringList paths; // Only select one folder for now - paths << QFileDialog::getExistingDirectory(this, tr("Select a folder containing one or more games"), qstr(fs::get_config_dir()), QFileDialog::ShowDirsOnly); + paths << QFileDialog::getExistingDirectory(this, tr("Select a folder containing one or more games"), qstr(fs::get_config_dir()), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (!paths.isEmpty()) { diff --git a/rpcs3/rpcs3qt/vfs_dialog_tab.cpp b/rpcs3/rpcs3qt/vfs_dialog_tab.cpp index fa55520602..255b66b913 100644 --- a/rpcs3/rpcs3qt/vfs_dialog_tab.cpp +++ b/rpcs3/rpcs3qt/vfs_dialog_tab.cpp @@ -94,7 +94,7 @@ void vfs_dialog_tab::Reset() void vfs_dialog_tab::AddNewDirectory() { - QString dir = QFileDialog::getExistingDirectory(nullptr, tr("Choose a directory"), QCoreApplication::applicationDirPath()); + QString dir = QFileDialog::getExistingDirectory(nullptr, tr("Choose a directory"), QCoreApplication::applicationDirPath(), QFileDialog::DontResolveSymlinks); if (dir.isEmpty()) return;