| 3385 | } |
| 3386 | |
| 3387 | void MainWindow::openSnapshotsFolderForGame(const GameList::Entry& entry) |
| 3388 | { |
| 3389 | // Go to top-level snapshots directory if not organizing by game. |
| 3390 | if (EmuConfig.GS.OrganizeSnapshotsByGame && !entry.title.empty()) |
| 3391 | { |
| 3392 | const bool prefer_english = Host::GetBaseBoolSettingValue("UI", "PreferEnglishGameList", false); |
| 3393 | std::string game_name = (prefer_english && !entry.title_en.empty()) ? entry.title_en : entry.title; |
| 3394 | Path::SanitizeFileName(&game_name); |
| 3395 | |
| 3396 | const std::string game_dir = Path::Combine(EmuFolders::Snapshots, game_name); |
| 3397 | |
| 3398 | // Make sure the per-game directory exists or that we can successfully create it. |
| 3399 | if (FileSystem::DirectoryExists(game_dir.c_str()) || FileSystem::CreateDirectoryPath(game_dir.c_str(), false)) |
| 3400 | { |
| 3401 | const QFileInfo fi(QString::fromStdString(game_dir)); |
| 3402 | QtUtils::OpenURL(this, QUrl::fromLocalFile(fi.absoluteFilePath())); |
| 3403 | return; |
| 3404 | } |
| 3405 | |
| 3406 | QMessageBox::critical(this, tr("Error"), tr("Failed to create snapshots directory '%1'\n\nOpening default directory.").arg(QString::fromStdString(game_dir))); |
| 3407 | } |
| 3408 | |
| 3409 | QtUtils::OpenURL(this, QUrl::fromLocalFile(QString::fromStdString(EmuFolders::Snapshots))); |
| 3410 | } |
| 3411 | |
| 3412 | void MainWindow::openTextureFolderForGame(const GameList::Entry& entry) |
| 3413 | { |