[Scummvm-git-logs] scummvm master -> b73034e3a0bf41825ebcf0f8b4c62efab09dbe17
sev-
sev at scummvm.org
Sun Oct 4 16:05:55 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b73034e3a0 GUI: Added setting for disabling directory scan at the GUI launch
Commit: b73034e3a0bf41825ebcf0f8b4c62efab09dbe17
https://github.com/scummvm/scummvm/commit/b73034e3a0bf41825ebcf0f8b4c62efab09dbe17
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-10-04T18:05:02+02:00
Commit Message:
GUI: Added setting for disabling directory scan at the GUI launch
Changed paths:
base/commandLine.cpp
gui/launcher.cpp
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index dac2580708..633cb392f4 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -298,6 +298,10 @@ void registerDefaults() {
ConfMan.registerDefault("gui_browser_show_hidden", false);
ConfMan.registerDefault("gui_browser_native", true);
+ // Specify threshold for scanning directories in the launcher
+ // If number of game entries in scummvm.ini exceeds the specified
+ // number, then skip scanning. -1 = scan always
+ ConfMan.registerDefault("gui_list_max_scan_entries", -1);
ConfMan.registerDefault("game", "");
#ifdef USE_FLUIDSYNTH
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 2681567ab0..d9dc4fa97f 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -258,10 +258,13 @@ void LauncherDialog::updateListing() {
U32StringArray l;
ListWidget::ColorList colors;
ThemeEngine::FontColor color;
+ int numEntries = ConfMan.getInt("gui_list_max_scan_entries");
// Retrieve a list of all games defined in the config file
_domains.clear();
const ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
+ bool scanEntries = numEntries == -1 ? true : (domains.size() <= numEntries);
+
ConfigManager::DomainMap::const_iterator iter;
for (iter = domains.begin(); iter != domains.end(); ++iter) {
#ifdef __DS__
@@ -274,7 +277,6 @@ void LauncherDialog::updateListing() {
String gameid(iter->_value.getVal("gameid"));
String description(iter->_value.getVal("description"));
- Common::FSNode path(iter->_value.getVal("path"));
if (gameid.empty())
gameid = iter->_key;
@@ -297,13 +299,17 @@ void LauncherDialog::updateListing() {
pos++;
color = ThemeEngine::kFontColorNormal;
- if (!path.isDirectory()) {
- color = ThemeEngine::kFontColorAlternate;
- // If more conditions which grey out entries are added we should consider
- // enabling this so that it is easy to spot why a certain game entry cannot
- // be started.
- // description += Common::String::format(" (%s)", _("Not found"));
+ if (scanEntries) {
+ Common::FSNode path(iter->_value.getVal("path"));
+ if (!path.isDirectory()) {
+ color = ThemeEngine::kFontColorAlternate;
+ // If more conditions which grey out entries are added we should consider
+ // enabling this so that it is easy to spot why a certain game entry cannot
+ // be started.
+
+ // description += Common::String::format(" (%s)", _("Not found"));
+ }
}
l.insert_at(pos, description);
More information about the Scummvm-git-logs
mailing list