Surround Windows commands in quotes

When external editors are launched in Windows OS, the command is
surrounded by quotes. This commit fixes the translation of commands for
use by the multiple custom external editors feature so that the
translated commands are also surrounded by quotes.
This commit is contained in:
Lawrence Lee
2021-07-11 21:38:52 -07:00
parent 4044f67c0f
commit c625975453

View File

@@ -912,7 +912,7 @@ void Options::readFromFile(Glib::ustring fname)
if (editorToSendTo == 1) { if (editorToSendTo == 1) {
externalEditorIndex = externalEditors.size(); externalEditorIndex = externalEditors.size();
} }
externalEditors.push_back(ExternalEditor("GIMP", executable, "gimp")); externalEditors.push_back(ExternalEditor("GIMP", "\"" + executable + "\"", "gimp"));
} else { } else {
for (auto ver = 12; ver >= 0; --ver) { for (auto ver = 12; ver >= 0; --ver) {
executable = Glib::build_filename(gimpDir, "bin", Glib::ustring::compose(Glib::ustring("gimp-2.%1.exe"), ver)); executable = Glib::build_filename(gimpDir, "bin", Glib::ustring::compose(Glib::ustring("gimp-2.%1.exe"), ver));
@@ -920,7 +920,7 @@ void Options::readFromFile(Glib::ustring fname)
if (editorToSendTo == 1) { if (editorToSendTo == 1) {
externalEditorIndex = externalEditors.size(); externalEditorIndex = externalEditors.size();
} }
externalEditors.push_back(ExternalEditor("GIMP", executable, "gimp")); externalEditors.push_back(ExternalEditor("GIMP", "\"" + executable + "\"", "gimp"));
break; break;
} }
} }
@@ -935,7 +935,7 @@ void Options::readFromFile(Glib::ustring fname)
if (editorToSendTo == 2) { if (editorToSendTo == 2) {
externalEditorIndex = externalEditors.size(); externalEditorIndex = externalEditors.size();
} }
externalEditors.push_back(ExternalEditor("Photoshop", executable, "")); externalEditors.push_back(ExternalEditor("Photoshop", "\"" + executable + "\"", ""));
} }
if (keyFile.has_key("External Editor", "CustomEditor")) { if (keyFile.has_key("External Editor", "CustomEditor")) {
@@ -944,7 +944,7 @@ void Options::readFromFile(Glib::ustring fname)
if (editorToSendTo == 3) { if (editorToSendTo == 3) {
externalEditorIndex = externalEditors.size(); externalEditorIndex = externalEditors.size();
} }
externalEditors.push_back(ExternalEditor("-", executable, "")); externalEditors.push_back(ExternalEditor("-", "\"" + executable + "\"", ""));
} }
} }
#elif defined __APPLE__ #elif defined __APPLE__