Browse Source

Work around different wchar_t settings.

Sascha Zelzer 11 years ago
parent
commit
51c7babbd7
1 changed files with 5 additions and 1 deletions
  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;