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:
parent
a2548d1319
commit
e1e154721a
|
@ -56,32 +56,30 @@ bool ApplicationList::LoadSettings()
|
|||
}
|
||||
|
||||
if (names.empty() && paths.empty() && params.empty()) {
|
||||
do {
|
||||
// use as default for gnome environments
|
||||
if (QFileInfo("/usr/bin/gedit").isExecutable()) {
|
||||
Application app;
|
||||
app.setName("gedit");
|
||||
app.setPath("/usr/bin/gedit");
|
||||
app.setParameters("+(line) (file)");
|
||||
AddApplication(app);
|
||||
defapp = 0;
|
||||
break;
|
||||
}
|
||||
// use as default for kde environments
|
||||
if (QFileInfo("/usr/bin/kate").isExecutable()) {
|
||||
Application app;
|
||||
app.setName("kate");
|
||||
app.setPath("/usr/bin/kate");
|
||||
app.setParameters("-l(line) (file)");
|
||||
AddApplication(app);
|
||||
defapp = 0;
|
||||
break;
|
||||
}
|
||||
if (FindDefaultWindowsEditor()) {
|
||||
defapp = 0;
|
||||
break;
|
||||
}
|
||||
} while (0);
|
||||
#ifndef _WIN32
|
||||
// use as default for gnome environments
|
||||
if (QFileInfo("/usr/bin/gedit").isExecutable()) {
|
||||
Application app;
|
||||
app.setName("gedit");
|
||||
app.setPath("/usr/bin/gedit");
|
||||
app.setParameters("+(line) (file)");
|
||||
AddApplication(app);
|
||||
defapp = 0;
|
||||
}
|
||||
// use as default for kde environments
|
||||
if (QFileInfo("/usr/bin/kate").isExecutable()) {
|
||||
Application app;
|
||||
app.setName("kate");
|
||||
app.setPath("/usr/bin/kate");
|
||||
app.setParameters("-l(line) (file)");
|
||||
AddApplication(app);
|
||||
defapp = 0;
|
||||
}
|
||||
#else
|
||||
if (FindDefaultWindowsEditor()) {
|
||||
defapp = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (names.size() > 0 && (names.size() == paths.size())) {
|
||||
|
|
Loading…
Reference in New Issue