Added a game counter log output on application startup.

This commit is contained in:
Leon Styhre 2023-02-21 18:48:06 +01:00
parent e248299fb4
commit 9683295c10

View file

@ -464,6 +464,7 @@ bool SystemData::loadConfig()
const bool splashScreen {Settings::getInstance()->getBool("SplashScreen")}; const bool splashScreen {Settings::getInstance()->getBool("SplashScreen")};
float systemCount {0.0f}; float systemCount {0.0f};
float parsedSystems {0.0f}; float parsedSystems {0.0f};
unsigned int gameCount {0};
// This is only done to get the total system count, for calculating the progress bar position. // This is only done to get the total system count, for calculating the progress bar position.
for (auto& configPath : configPaths) { for (auto& configPath : configPaths) {
@ -775,6 +776,7 @@ bool SystemData::loadConfig()
} }
else { else {
sSystemVector.emplace_back(newSys); sSystemVector.emplace_back(newSys);
gameCount += newSys->getRootFolder()->getGameCount().first;
} }
} }
} }
@ -790,6 +792,7 @@ bool SystemData::loadConfig()
<< (systemCount == 1 ? ", loaded " : "s, loaded ") << sSystemVector.size() << (systemCount == 1 ? ", loaded " : "s, loaded ") << sSystemVector.size()
<< " system" << (sSystemVector.size() == 1 ? "" : "s") << " system" << (sSystemVector.size() == 1 ? "" : "s")
<< " (collections not included)"; << " (collections not included)";
LOG(LogInfo) << "Total game count: " << gameCount;
// Sort systems by sortName, which will normally be the same as the full name. // Sort systems by sortName, which will normally be the same as the full name.
std::sort(std::begin(sSystemVector), std::end(sSystemVector), [](SystemData* a, SystemData* b) { std::sort(std::begin(sSystemVector), std::end(sSystemVector), [](SystemData* a, SystemData* b) {