diff options
| author | Léo Lam <leo@leolam.fr> | 2019-11-24 00:17:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-24 00:17:32 +0100 |
| commit | 3a2d3aa9d20289ef4b8e8c64768faeaf7463cd0b (patch) | |
| tree | 3c3e30f5a1cb28c38f88940f30d6b7059b44ea1a /Source | |
| parent | 4305a9ac57a4bee1e0be0c54b9df2cda385b114a (diff) | |
| parent | fe9e7d557803655ea61dc748995647cf2aae495c (diff) | |
Merge pull request #8488 from tinyredpanda/simplify-wstring-conversion
Simplify wstring to QString conversion
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Common/CompatPatches.cpp | 15 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Main.cpp | 12 |
2 files changed, 12 insertions, 15 deletions
diff --git a/Source/Core/Common/CompatPatches.cpp b/Source/Core/Common/CompatPatches.cpp index e07028e9e4..f2b179eb12 100644 --- a/Source/Core/Common/CompatPatches.cpp +++ b/Source/Core/Common/CompatPatches.cpp @@ -231,15 +231,14 @@ void CompatPatchesInstall(LdrWatcher* watcher) return; } // If we reach here, the version is buggy (afaik) and patching failed - const auto msg = - fmt::format("You are running {} version {}.{}.{}.{}.\n" - "An important fix affecting Dolphin was introduced in build {}.\n" - "You can use Dolphin, but there will be known bugs.\n" - "Please update this file by installing the latest Universal C Runtime.\n", - UTF16ToUTF8(event.name), version.major, version.minor, version.build, - version.qfe, fixed_build); + const auto msg = fmt::format( + L"You are running {} version {}.{}.{}.{}.\n" + L"An important fix affecting Dolphin was introduced in build {}.\n" + L"You can use Dolphin, but there will be known bugs.\n" + L"Please update this file by installing the latest Universal C Runtime.\n", + event.name, version.major, version.minor, version.build, version.qfe, fixed_build); // Use MessageBox for maximal user annoyance - MessageBoxA(nullptr, msg.c_str(), "WARNING: BUGGY UCRT VERSION", MB_ICONEXCLAMATION); + MessageBoxW(nullptr, msg.c_str(), L"WARNING: BUGGY UCRT VERSION", MB_ICONEXCLAMATION); }}); } diff --git a/Source/Core/DolphinQt/Main.cpp b/Source/Core/DolphinQt/Main.cpp index b54caae0b8..55ea75f026 100644 --- a/Source/Core/DolphinQt/Main.cpp +++ b/Source/Core/DolphinQt/Main.cpp @@ -5,8 +5,6 @@ #ifdef _WIN32 #include <Windows.h> #include <cstdio> - -#include "Common/StringUtil.h" #endif #include <OptionParser.h> @@ -104,16 +102,16 @@ int main(int argc, char* argv[]) #ifdef _WIN32 // Get the default system font because Qt's way of obtaining it is outdated - NONCLIENTMETRICS metrics = {}; - LOGFONT& logfont = metrics.lfMenuFont; - metrics.cbSize = sizeof(NONCLIENTMETRICS); + NONCLIENTMETRICSW metrics = {}; + LOGFONTW& logfont = metrics.lfMenuFont; + metrics.cbSize = sizeof(metrics); - if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(metrics), &metrics, 0)) + if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(metrics), &metrics, 0)) { // Sadly Qt 5 doesn't support turning a native font handle into a QFont so this is the next best // thing QFont font = QApplication::font(); - font.setFamily(QString::fromStdString(UTF16ToUTF8(logfont.lfFaceName))); + font.setFamily(QString::fromStdWString(logfont.lfFaceName)); font.setItalic(logfont.lfItalic); font.setStrikeOut(logfont.lfStrikeOut); |
