mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 08:22:32 +00:00
do not show the path if it is not added
This commit is contained in:
parent
420e4c04ad
commit
70cb429bc2
@ -325,11 +325,13 @@ void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h) {
|
|||||||
main_window_geometry_w = w;
|
main_window_geometry_w = w;
|
||||||
main_window_geometry_h = h;
|
main_window_geometry_h = h;
|
||||||
}
|
}
|
||||||
void addGameInstallDir(const std::filesystem::path& dir) {
|
bool addGameInstallDir(const std::filesystem::path& dir) {
|
||||||
if (std::find(settings_install_dirs.begin(), settings_install_dirs.end(), dir) ==
|
if (std::find(settings_install_dirs.begin(), settings_install_dirs.end(), dir) ==
|
||||||
settings_install_dirs.end()) {
|
settings_install_dirs.end()) {
|
||||||
settings_install_dirs.push_back(dir);
|
settings_install_dirs.push_back(dir);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
void removeGameInstallDir(const std::filesystem::path& dir) {
|
void removeGameInstallDir(const std::filesystem::path& dir) {
|
||||||
auto iterator = std::find(settings_install_dirs.begin(), settings_install_dirs.end(), dir);
|
auto iterator = std::find(settings_install_dirs.begin(), settings_install_dirs.end(), dir);
|
||||||
|
@ -85,7 +85,7 @@ bool vkCrashDiagnosticEnabled();
|
|||||||
|
|
||||||
// Gui
|
// Gui
|
||||||
void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h);
|
void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h);
|
||||||
void addGameInstallDir(const std::filesystem::path& dir);
|
bool addGameInstallDir(const std::filesystem::path& dir);
|
||||||
void removeGameInstallDir(const std::filesystem::path& dir);
|
void removeGameInstallDir(const std::filesystem::path& dir);
|
||||||
void setAddonInstallDir(const std::filesystem::path& dir);
|
void setAddonInstallDir(const std::filesystem::path& dir);
|
||||||
void setMainWindowTheme(u32 theme);
|
void setMainWindowTheme(u32 theme);
|
||||||
|
@ -236,7 +236,9 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
|
|||||||
QFileDialog::getExistingDirectory(this, tr("Directory to install games"));
|
QFileDialog::getExistingDirectory(this, tr("Directory to install games"));
|
||||||
auto file_path = Common::FS::PathFromQString(file_path_string);
|
auto file_path = Common::FS::PathFromQString(file_path_string);
|
||||||
if (!file_path.empty()) {
|
if (!file_path.empty()) {
|
||||||
Config::addGameInstallDir(file_path);
|
if (!Config::addGameInstallDir(file_path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
QListWidgetItem* item = new QListWidgetItem(file_path_string);
|
QListWidgetItem* item = new QListWidgetItem(file_path_string);
|
||||||
ui->gameFoldersListWidget->addItem(item);
|
ui->gameFoldersListWidget->addItem(item);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user