Minor Fixes for Separate Update Folder (#1387)

* description + string fixes

* fix use condition

* clang format

* updates now fully extract to game update folder

* don't guarantee the overwrite game condition
This commit is contained in:
ElBread3 2024-10-15 14:29:27 -05:00 committed by GitHub
parent 08343faf01
commit 6fc7b3993d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 16 deletions

View file

@ -678,13 +678,10 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int
auto game_install_dir = ids.getSelectedDirectory();
auto game_folder_path = game_install_dir / pkg.GetTitleID();
QString pkgType = QString::fromStdString(pkg.GetPkgFlags());
bool use_game_update = pkgType.contains("Patch") && Config::getSeparateUpdateEnabled();
bool use_game_update = pkgType.contains("PATCH") && Config::getSeparateUpdateEnabled();
auto game_update_path = use_game_update
? game_install_dir / (std::string(pkg.GetTitleID()) + "-UPDATE")
: game_folder_path;
if (!std::filesystem::exists(game_update_path)) {
std::filesystem::create_directory(game_update_path);
}
QString gameDirPath;
Common::FS::PathToQString(gameDirPath, game_folder_path);
QDir game_dir(gameDirPath);
@ -792,8 +789,6 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int
}
}
} else {
QString gameDirPath;
Common::FS::PathToQString(gameDirPath, game_folder_path);
msgBox.setText(QString(tr("Game already installed") + "\n" + gameDirPath + "\n" +
tr("Would you like to overwrite?")));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);