Make options ignore empty custom editor command
This commit is contained in:
parent
044451868a
commit
e6b2c9e7b0
@ -903,7 +903,7 @@ void Options::readFromFile(Glib::ustring fname)
|
||||
if (keyFile.has_key("External Editor", "PhotoshopDir")) {
|
||||
psDir = keyFile.get_string("External Editor", "PhotoshopDir");
|
||||
}
|
||||
auto executable = Glib::build_filename(psDir, "Photoshop.exe");
|
||||
executable = Glib::build_filename(psDir, "Photoshop.exe");
|
||||
if (Glib::file_test(executable, Glib::FILE_TEST_IS_EXECUTABLE)) {
|
||||
if (editorToSendTo == 2) {
|
||||
externalEditorIndex = externalEditors.size();
|
||||
@ -913,11 +913,13 @@ void Options::readFromFile(Glib::ustring fname)
|
||||
|
||||
if (keyFile.has_key("External Editor", "CustomEditor")) {
|
||||
executable = keyFile.get_string("External Editor", "CustomEditor");
|
||||
if (!executable.empty()) {
|
||||
if (editorToSendTo == 3) {
|
||||
externalEditorIndex = externalEditors.size();
|
||||
}
|
||||
externalEditors.push_back(ExternalEditor("-", executable, ""));
|
||||
}
|
||||
}
|
||||
#elif defined __APPLE__
|
||||
if (editorToSendTo == 1) {
|
||||
externalEditorIndex = externalEditors.size();
|
||||
@ -932,11 +934,13 @@ void Options::readFromFile(Glib::ustring fname)
|
||||
|
||||
if (keyFile.has_key("External Editor", "CustomEditor")) {
|
||||
auto executable = keyFile.get_string("External Editor", "CustomEditor");
|
||||
if (!executable.empty()) {
|
||||
if (editorToSendTo == 3) {
|
||||
externalEditorIndex = externalEditors.size();
|
||||
}
|
||||
externalEditors.push_back(ExternalEditor("-", executable, ""));
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (Glib::find_program_in_path("gimp").compare("")) {
|
||||
if (editorToSendTo == 1) {
|
||||
@ -952,11 +956,13 @@ void Options::readFromFile(Glib::ustring fname)
|
||||
|
||||
if (keyFile.has_key("External Editor", "CustomEditor")) {
|
||||
auto executable = keyFile.get_string("External Editor", "CustomEditor");
|
||||
if (!executable.empty()) {
|
||||
if (editorToSendTo == 3) {
|
||||
externalEditorIndex = externalEditors.size();
|
||||
}
|
||||
externalEditors.push_back(ExternalEditor("-", executable, ""));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user