fixed ViewController.cpp ifs - tentative fix

This commit is contained in:
XargonWan 2024-10-28 16:33:31 +09:00
parent 9173b3cdc1
commit d3f0041043

View file

@ -2363,7 +2363,8 @@ void GuiMenu::addVersionInfo()
#endif #endif
#if defined(__RETRODECK__) #if defined(__RETRODECK__)
// Read version from /app/retrodeck/version if RETRODECK is defined // Only execute this block if RETRODECK is defined
LOG(LogInfo) << "Reading /app/retrodeck/version...";
std::ifstream versionFile("/app/retrodeck/version"); std::ifstream versionFile("/app/retrodeck/version");
std::string retroDeckVersion; std::string retroDeckVersion;
@ -2371,12 +2372,14 @@ void GuiMenu::addVersionInfo()
// also check that the line is not empty to ensure valid version information // also check that the line is not empty to ensure valid version information
if (versionFile && std::getline(versionFile, retroDeckVersion) && !retroDeckVersion.empty()) { if (versionFile && std::getline(versionFile, retroDeckVersion) && !retroDeckVersion.empty()) {
mVersion.setText(applicationName + " " + retroDeckVersion); mVersion.setText(applicationName + " " + retroDeckVersion);
LOG(LogInfo) << "RetroDECK version read OK.";
} else { } else {
std::cerr << "Error: Cannot read version from file or file is empty!" << std::endl; LOG(LogInfo) << "Error: Cannot read version from file or file is empty!";
retroDeckVersion = "UNKNOWN"; retroDeckVersion = "UNKNOWN";
mVersion.setText(applicationName + " " + retroDeckVersion); mVersion.setText(applicationName + " " + retroDeckVersion);
} }
#else // not RetroDECK
#else // If RETRODECK is NOT defined, execute this block
#if defined(IS_PRERELEASE) #if defined(IS_PRERELEASE)
#if defined(__ANDROID__) #if defined(__ANDROID__)
@ -2395,7 +2398,7 @@ void GuiMenu::addVersionInfo()
#endif #endif
#endif #endif
#endif //RetroDECK #endif // End of RetroDECK logic check
} }
void GuiMenu::openThemeDownloader(GuiSettings* settings) void GuiMenu::openThemeDownloader(GuiSettings* settings)