From ec137c3269086a8401597715b11e2109b96dc0c2 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 18 Sep 2014 01:42:32 +0200 Subject: [PATCH] * Retrieve utf16 local appdata path from Windows API correctly. --- src/libtomahawk/utils/TomahawkUtils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libtomahawk/utils/TomahawkUtils.cpp b/src/libtomahawk/utils/TomahawkUtils.cpp index 53b0c75da..795b2e642 100644 --- a/src/libtomahawk/utils/TomahawkUtils.cpp +++ b/src/libtomahawk/utils/TomahawkUtils.cpp @@ -173,12 +173,12 @@ appDataDir() if ( ( QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based ) == 0 ) { // Use this for non-DOS-based Windowses - char acPath[MAX_PATH]; - HRESULT h = SHGetFolderPathA( NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, + wchar_t acPath[MAX_PATH]; + HRESULT h = SHGetFolderPathW( NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, acPath ); if ( h == S_OK ) { - path = QString::fromLocal8Bit( acPath ); + path = QString::fromUtf16( (ushort*)acPath ); } } #elif defined(Q_OS_MAC)