diff --git a/gui/applicationlist.cpp b/gui/applicationlist.cpp index 94e87b4fd..b4e453afb 100644 --- a/gui/applicationlist.cpp +++ b/gui/applicationlist.cpp @@ -18,6 +18,7 @@ #include "applicationlist.h" #include +#include #include "common.h" ApplicationList::ApplicationList(QObject *parent) : @@ -37,6 +38,30 @@ void ApplicationList::LoadSettings(QSettings *programSettings) QStringList names = programSettings->value(SETTINGS_APPLICATION_NAMES, QStringList()).toStringList(); QStringList paths = programSettings->value(SETTINGS_APPLICATION_PATHS, QStringList()).toStringList(); + if (names.empty() && paths.empty()) + { + do { + // use as default for gnome environments + if (QFileInfo("/usr/bin/gedit").isExecutable()) + { + AddApplicationType("gedit", "/usr/bin/gedit +(line) (file)"); + break; + } + // use as default for kde environments + if (QFileInfo("/usr/bin/kate").isExecutable()) + { + AddApplicationType("kate", "/usr/bin/kate -l(line) (file)"); + break; + } + // use as default for windows environments + if (QFileInfo("%PROGRAMFILES%\\Notepad++\\notepad++.exe").isExecutable()) + { + AddApplicationType("notepad++", "%PROGRAMFILES%\\Notepad++\\notepad++.exe -n(line) (file)"); + break; + } + } while ( 0 ); + } + if (names.size() == paths.size()) { for (int i = 0; i < names.size(); i++)