Explorar o código

Work around different wchar_t settings.

Sascha Zelzer %!s(int64=11) %!d(string=hai) anos
pai
achega
51c7babbd7
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      Libs/PluginFramework/ctkPluginFrameworkLauncher.cpp

+ 5 - 1
Libs/PluginFramework/ctkPluginFrameworkLauncher.cpp

@@ -277,8 +277,12 @@ void ctkPluginFrameworkLauncher::appendPathEnv(const QString& path)
         (LPWSTR) &lpMsgBuf,
         0, NULL );
 
+    // Avoid project configuration conflicts regarding wchar_t considered
+    // a built-in type or not by using QString::fromUtf16 instead of
+    // QString::fromWCharArray
+    // sa http://qt-project.org/wiki/toStdWStringAndBuiltInWchar
     QString msg = QString("Adding '%1' to the PATH environment variable failed: %2")
-      .arg(path).arg(QString::fromWCharArray((LPWSTR)lpMsgBuf));
+      .arg(path).arg(QString::fromUtf16(reinterpret_cast<const ushort*>(lpMsgBuf)));
 
     qWarning() << msg;