MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / openSnapshotsFolderForGame

Method openSnapshotsFolderForGame

pcsx2-qt/MainWindow.cpp:3387–3410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3385}
3386
3387void 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
3412void MainWindow::openTextureFolderForGame(const GameList::Entry& entry)
3413{

Callers

nothing calls this directly

Calls 5

CombineFunction · 0.85
OpenURLFunction · 0.85
argMethod · 0.80
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected