GUI: Use Notepad++ by default in windows. Ticket: #1931

This commit is contained in:
Daniel Marjamäki 2010-08-15 16:40:16 +02:00
parent eb6d596085
commit 8d52c33790
1 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,7 @@
#include "applicationlist.h" #include "applicationlist.h"
#include <QStringList> #include <QStringList>
#include <QFileInfo> #include <QFileInfo>
#include <stdlib.h>
#include "common.h" #include "common.h"
ApplicationList::ApplicationList(QObject *parent) : ApplicationList::ApplicationList(QObject *parent) :
@ -55,9 +56,10 @@ void ApplicationList::LoadSettings(QSettings *programSettings)
break; break;
} }
// use as default for windows environments // 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; break;
} }
} }