summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Kyle K2022-05-20 19:39:12 -0700
committerGravatar Kyle Kienapfel2022-05-28 20:48:19 -0700
commit017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde (patch)
treec5222ff015ae77bf6e15bff237852823bc59c5a4 /src
parentMerge pull request #8385 from lat9nq/just-subsys-win (diff)
downloadyuzu-017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde.tar.gz
yuzu-017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde.tar.xz
yuzu-017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde.zip
Logging: Report Post Windows 10 2004 versions, like Windows 11
Qt5 and Qt6 don't really do a good job of reporting Windows versions past the 2004 version. Current: Windows 10 Version 2009 This Patch: Windows 10 Version 21H1 (Build 19043.1706) Also: Windows 11 Version 21H2 (Build 22000.675) Fixes: #8362
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/main.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index f4a9a7171..c7fbc7894 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -198,6 +198,31 @@ static void RemoveCachedContents() {
198 Common::FS::RemoveDirRecursively(offline_system_data); 198 Common::FS::RemoveDirRecursively(offline_system_data);
199} 199}
200 200
201static QString PrettyProductName() {
202#ifdef _WIN32
203 // After Windows 10 Version 2004, Microsoft decided to switch to a different notation: 20H2
204 // With that notation change they changed the registry key used to denote the current version
205 QSettings windows_registry(
206 QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"),
207 QSettings::NativeFormat);
208 const QString release_id = windows_registry.value(QStringLiteral("ReleaseId")).toString();
209 if (release_id == QStringLiteral("2009")) {
210 const u32 current_build = windows_registry.value(QStringLiteral("CurrentBuild")).toUInt();
211 const QString display_version =
212 windows_registry.value(QStringLiteral("DisplayVersion")).toString();
213 const u32 ubr = windows_registry.value(QStringLiteral("UBR")).toUInt();
214 u32 version = 10;
215 if (current_build >= 22000) {
216 version = 11;
217 }
218 return QStringLiteral("Windows %1 Version %2 (Build %3.%4)")
219 .arg(QString::number(version), display_version, QString::number(current_build),
220 QString::number(ubr));
221 }
222#endif
223 return QSysInfo::prettyProductName();
224}
225
201GMainWindow::GMainWindow() 226GMainWindow::GMainWindow()
202 : ui{std::make_unique<Ui::MainWindow>()}, system{std::make_unique<Core::System>()}, 227 : ui{std::make_unique<Ui::MainWindow>()}, system{std::make_unique<Core::System>()},
203 input_subsystem{std::make_shared<InputCommon::InputSubsystem>()}, 228 input_subsystem{std::make_shared<InputCommon::InputSubsystem>()},
@@ -259,7 +284,7 @@ GMainWindow::GMainWindow()
259 } 284 }
260 LOG_INFO(Frontend, "Host CPU: {}", cpu_string); 285 LOG_INFO(Frontend, "Host CPU: {}", cpu_string);
261#endif 286#endif
262 LOG_INFO(Frontend, "Host OS: {}", QSysInfo::prettyProductName().toStdString()); 287 LOG_INFO(Frontend, "Host OS: {}", PrettyProductName().toStdString());
263 LOG_INFO(Frontend, "Host RAM: {:.2f} GiB", 288 LOG_INFO(Frontend, "Host RAM: {:.2f} GiB",
264 Common::GetMemInfo().TotalPhysicalMemory / f64{1_GiB}); 289 Common::GetMemInfo().TotalPhysicalMemory / f64{1_GiB});
265 LOG_INFO(Frontend, "Host Swap: {:.2f} GiB", Common::GetMemInfo().TotalSwapMemory / f64{1_GiB}); 290 LOG_INFO(Frontend, "Host Swap: {:.2f} GiB", Common::GetMemInfo().TotalSwapMemory / f64{1_GiB});