Fixed detection of multiple editors on non-Windows systems

Don't look for Windows editors on Linux and vice-versa
This commit is contained in:
PKEuS 2012-10-12 20:28:31 +02:00
parent a2548d1319
commit e1e154721a
1 changed files with 24 additions and 26 deletions

View File

@ -56,32 +56,30 @@ bool ApplicationList::LoadSettings()
} }
if (names.empty() && paths.empty() && params.empty()) { if (names.empty() && paths.empty() && params.empty()) {
do { #ifndef _WIN32
// use as default for gnome environments // use as default for gnome environments
if (QFileInfo("/usr/bin/gedit").isExecutable()) { if (QFileInfo("/usr/bin/gedit").isExecutable()) {
Application app; Application app;
app.setName("gedit"); app.setName("gedit");
app.setPath("/usr/bin/gedit"); app.setPath("/usr/bin/gedit");
app.setParameters("+(line) (file)"); app.setParameters("+(line) (file)");
AddApplication(app); AddApplication(app);
defapp = 0; defapp = 0;
break; }
} // use as default for kde environments
// use as default for kde environments if (QFileInfo("/usr/bin/kate").isExecutable()) {
if (QFileInfo("/usr/bin/kate").isExecutable()) { Application app;
Application app; app.setName("kate");
app.setName("kate"); app.setPath("/usr/bin/kate");
app.setPath("/usr/bin/kate"); app.setParameters("-l(line) (file)");
app.setParameters("-l(line) (file)"); AddApplication(app);
AddApplication(app); defapp = 0;
defapp = 0; }
break; #else
} if (FindDefaultWindowsEditor()) {
if (FindDefaultWindowsEditor()) { defapp = 0;
defapp = 0; }
break; #endif
}
} while (0);
} }
if (names.size() > 0 && (names.size() == paths.size())) { if (names.size() > 0 && (names.size() == paths.size())) {