From 78234f60c4a25b86f5aa384bce8860c7778ee762 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Mon, 1 Dec 2025 21:29:13 -0500 Subject: [PATCH] refactor: base/Path use QString to convert to WString fo windows --- src/lib/base/Path.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/lib/base/Path.cpp b/src/lib/base/Path.cpp index 35260bdb7..04fd62105 100644 --- a/src/lib/base/Path.cpp +++ b/src/lib/base/Path.cpp @@ -7,7 +7,7 @@ #include "Path.h" #if SYSAPI_WIN32 -#include "arch/win32/ArchMiscWindows.h" +#include #endif namespace deskflow::filesystem { @@ -16,15 +16,8 @@ namespace deskflow::filesystem { std::wstring path(const std::string &filePath) { - std::wstring result; - - auto length = MultiByteToWideChar(CP_UTF8, 0, filePath.c_str(), static_cast(filePath.length()), nullptr, 0); - if (length > 0) { - result.resize(length); - MultiByteToWideChar(CP_UTF8, 0, filePath.c_str(), static_cast(filePath.length()), &result[0], length); - } - - return result; + const auto qstring = QString::fromStdString(filePath); + return qstring.toStdWString(); } #else