• R/O
  • HTTP
  • SSH
  • HTTPS

MUtilities: Commit

MUtilities development repository


Commit MetaInfo

Revisionb6dd06460847626f268e3fe9e39c5a1a4e7c442c (tree)
Time2018-10-28 22:41:52
AuthorLoRd_MuldeR <mulder2@gmx....>
CommiterLoRd_MuldeR

Log Message

Small improvement to operating system detection.

Change Summary

Incremental Difference

--- a/src/Startup.cpp
+++ b/src/Startup.cpp
@@ -313,8 +313,18 @@ QApplication *MUtils::Startup::create_qt(int &argc, char **argv, const QString &
313313 qDebug("Compiled with Qt v%s\n", QT_VERSION_STR);
314314 #endif
315315
316- //Check the Windows version
316+ //Detect the operating system version
317317 const MUtils::OS::Version::os_version_t &osVersion = MUtils::OS::os_version();
318+ if (const char *const friendlyName = MUtils::OS::os_friendly_name(osVersion))
319+ {
320+ qDebug("Running on %s (NT v%u.%u.%u-sp%u).\n", friendlyName, osVersion.versionMajor, osVersion.versionMinor, osVersion.versionBuild, osVersion.versionSPack);
321+ }
322+ else
323+ {
324+ qWarning("Running on an unknown WindowsNT-based system (v%u.%u.%u-sp%u).\n", osVersion.versionMajor, osVersion.versionMinor, osVersion.versionBuild, osVersion.versionSPack);
325+ }
326+
327+ //Check whether we are running on a supported Windows version
318328 if (xpSupport)
319329 {
320330 if (!REQUIRE_OS(WINDOWS_WINXP, 3))
@@ -338,18 +348,6 @@ QApplication *MUtils::Startup::create_qt(int &argc, char **argv, const QString &
338348 qFatal("%s", MUTILS_L1STR(QApplication::tr("Executable '%1' requires Windows 8.1 or later.").arg(executableName)));
339349 }
340350
341- //Check whether we are running on a supported Windows version
342- if(const char *const friendlyName = MUtils::OS::os_friendly_name(osVersion))
343- {
344- qDebug("Running on %s (NT v%u.%u.%u-sp%u).\n", friendlyName, osVersion.versionMajor, osVersion.versionMinor, osVersion.versionBuild, osVersion.versionSPack);
345- }
346- else
347- {
348- const QString message = QString().sprintf("Running on an unknown WindowsNT-based system (NT v%u.%u.%u-sp%u).", osVersion.versionMajor, osVersion.versionMinor, osVersion.versionBuild, osVersion.versionSPack);
349- qWarning("%s\n", MUTILS_UTF8(message));
350- MUtils::OS::system_message_wrn(MUTILS_WCHR(executableName), MUTILS_WCHR(message));
351- }
352-
353351 //Check for compat mode
354352 if(osVersion.overrideFlag && (osVersion <= MUtils::OS::Version::WINDOWS_WN100))
355353 {
Show on old repository browser