diff base/ResourceFinder.cpp @ 1480:5ac102155409 plugin-path-config

Environment variable lookup fixes, & use this implementation throughout
author Chris Cannam
date Fri, 08 Jun 2018 11:27:40 +0100
parents e1926cba940c
children 57833933cc75
line wrap: on
line diff
--- a/base/ResourceFinder.cpp	Thu Jun 07 16:49:09 2018 +0100
+++ b/base/ResourceFinder.cpp	Fri Jun 08 11:27:40 2018 +0100
@@ -35,6 +35,8 @@
 #include <iostream>
 #include <stdexcept>
 
+#include "system/System.h"
+
 /**
    Resource files may be found in three places:
 
@@ -67,10 +69,11 @@
     QStringList list;
 
 #ifdef Q_OS_WIN32
-    char *programFiles = getenv("ProgramFiles");
-    if (programFiles && programFiles[0]) {
+    std::string programFiles;
+    (void)getEnvUtf8("ProgramFiles", programFiles);
+    if (programFiles != "") {
         list << QString("%1/%2/%3")
-            .arg(programFiles)
+            .arg(QString::fromStdString(programFiles))
             .arg(qApp->organizationName())
             .arg(qApp->applicationName());
     } else {