From cff58b6bd80f0fb13ab65daea0d92eafd5213ff2 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Wed, 8 Jun 2011 20:23:27 +0200 Subject: Save a copy dialog now opens in current directory if this option is set for save as... dialog. (there is also the possibility to manually change the preferences file to change this option independently from save as... dialog) Fixed bugs: - https://launchpad.net/bugs/791098 (bzr r10263) --- src/extension/system.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/extension/system.cpp') diff --git a/src/extension/system.cpp b/src/extension/system.cpp index aa5731985..b3b64ca7d 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -590,10 +590,11 @@ Glib::ustring get_file_save_path (SPDocument *doc, FileSaveMethod method) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); Glib::ustring path; + bool use_current_dir = true; switch (method) { case FILE_SAVE_METHOD_SAVE_AS: { - bool use_current_dir = prefs->getBool("/dialogs/save_as/use_current_dir", true); + use_current_dir = prefs->getBool("/dialogs/save_as/use_current_dir", true); if (doc->getURI() && use_current_dir) { path = Glib::path_get_dirname(doc->getURI()); } else { @@ -605,7 +606,12 @@ get_file_save_path (SPDocument *doc, FileSaveMethod method) { path = prefs->getString("/dialogs/save_as/path"); break; case FILE_SAVE_METHOD_SAVE_COPY: - path = prefs->getString("/dialogs/save_copy/path"); + use_current_dir = prefs->getBool("/dialogs/save_copy/use_current_dir", prefs->getBool("/dialogs/save_as/use_current_dir", true)); + if (doc->getURI() && use_current_dir) { + path = Glib::path_get_dirname(doc->getURI()); + } else { + path = prefs->getString("/dialogs/save_copy/path"); + } break; case FILE_SAVE_METHOD_INKSCAPE_SVG: if (doc->getURI()) { -- cgit v1.2.3