diff --git a/gui/applicationlist.cpp b/gui/applicationlist.cpp index 143ac436a..4f76ec61b 100644 --- a/gui/applicationlist.cpp +++ b/gui/applicationlist.cpp @@ -19,6 +19,7 @@ #include "applicationlist.h" #include #include +#include #include "common.h" ApplicationList::ApplicationList(QObject *parent) : @@ -55,9 +56,10 @@ void ApplicationList::LoadSettings(QSettings *programSettings) break; } // use as default for windows environments - if (QFileInfo("%PROGRAMFILES%\\Notepad++\\notepad++.exe").isExecutable()) + const QString appPath(getenv("ProgramFiles")); + if (!appPath.isNull() && QFileInfo(appPath + "\\Notepad++\\notepad++.exe").isExecutable()) { - AddApplicationType("notepad++", "%PROGRAMFILES%\\Notepad++\\notepad++.exe -n(line) (file)"); + AddApplicationType("notepad++", QString(appPath) + "\\Notepad++\\notepad++.exe -n(line) (file)"); break; } }