diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2018-09-14 07:22:55 +0000 |
|---|---|---|
| committer | Jabiertxof <jabier.arraiza@marker.es> | 2018-09-14 07:22:55 +0000 |
| commit | c6dc24ac53d73d0d4581776e4e06b63a28d01396 (patch) | |
| tree | bfa221251f156d9ca614fd51a314a889d558e724 | |
| parent | Merge branch 'misc-typos' of gitlab.com:luzpaz/inkscape (diff) | |
| download | inkscape-c6dc24ac53d73d0d4581776e4e06b63a28d01396.tar.gz inkscape-c6dc24ac53d73d0d4581776e4e06b63a28d01396.zip | |
Fix a bug opening SVG from comand lines related to the DPI changes done. Thanks Mark for testing!
| -rw-r--r-- | src/extension/internal/svg.cpp | 4 | ||||
| -rw-r--r-- | src/file.cpp | 5 | ||||
| -rw-r--r-- | src/main.cpp | 12 |
3 files changed, 14 insertions, 7 deletions
diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index e4586ec5f..7d88ad007 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -210,7 +210,8 @@ Svg::open (Inkscape::Extension::Input *mod, const gchar *uri) Glib::ustring scale = prefs->getString("/dialogs/import/scale"); bool is_import = false; if (strcmp(prefs->getString("/options/openmethod/value").c_str(), "done") == 0 || - strcmp(prefs->getString("/options/openmethod/value").c_str(), "import") == 0) { + strcmp(prefs->getString("/options/openmethod/value").c_str(), "import") == 0) + { is_import = true; } if(INKSCAPE.use_gui() && is_import && ask) { @@ -226,7 +227,6 @@ Svg::open (Inkscape::Extension::Input *mod, const gchar *uri) prefs->setString("/dialogs/import/scale", scale ); prefs->setBool("/dialogs/import/ask", !mod->get_param_bool("do_not_ask") ); } - SPDocument * doc = SPDocument::createNewDoc (nullptr, TRUE, TRUE); if (link_svg.compare("include") != 0 && is_import) { bool embed = ( link_svg.compare( "embed" ) == 0 ); diff --git a/src/file.cpp b/src/file.cpp index 48218e617..dd609de50 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -217,7 +217,8 @@ bool sp_file_open(const Glib::ustring &uri, if (desktop) { desktop->setWaitingCursor(); } - + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setString("/options/openmethod/value", "open"); SPDocument *doc = nullptr; bool cancelled = false; try { @@ -230,7 +231,7 @@ bool sp_file_open(const Glib::ustring &uri, doc = nullptr; cancelled = true; } - + prefs->setString("/options/openmethod/value", "done"); if (desktop) { desktop->clearWaitingCursor(); } diff --git a/src/main.cpp b/src/main.cpp index 5206a6403..c18847b4f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1090,7 +1090,8 @@ static int sp_process_file_list(std::vector<gchar*> fl) static int sp_main_shell(char const* command_name) { int retval = 0; - + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setString("/options/openmethod/value", "shell"); const unsigned int buffer_size = 4096; gchar *command_line = g_strnfill(buffer_size, 0); g_strlcpy(command_line, command_name, buffer_size); @@ -1156,13 +1157,15 @@ static int sp_main_shell(char const* command_name) } while (linedata && (retval == 0)); g_free(command_line); + prefs->setString("/options/openmethod/value", "done"); return retval; } int sp_main_console(int argc, char const **argv) { /* We are started in text mode */ - +Inkscape::Preferences *prefs = Inkscape::Preferences::get(); +prefs->setString("/options/openmethod/value", "shell"); #if !GLIB_CHECK_VERSION(2,36,0) /* Do this g_type_init(), so that we can use Xft/Freetype2 (Pango) * in a non-Gtk environment. Used in libnrtype's @@ -1185,6 +1188,7 @@ int sp_main_console(int argc, char const **argv) #endif // WITH_DBUS ) { g_print("Nothing to do!\n"); + prefs->setString("/options/openmethod/value", "done"); exit(0); } @@ -1193,14 +1197,16 @@ int sp_main_console(int argc, char const **argv) if (sp_shell) { int retVal = sp_main_shell(argv[0]); // Run as interactive shell + prefs->setString("/options/openmethod/value", "done"); exit((retVal < 0) ? 1 : 0); } else { int retVal = sp_process_file_list(fl); // Normal command line invocation if (retVal){ + prefs->setString("/options/openmethod/value", "done"); exit(1); } } - + prefs->setString("/options/openmethod/value", "done"); return 0; } |
