diff options
| author | Kees Cook <kees@outflux.net> | 2006-10-01 17:23:40 +0000 |
|---|---|---|
| committer | keescook <keescook@users.sourceforge.net> | 2006-10-01 17:23:40 +0000 |
| commit | 0bb199cdf8c63341361fa93bf4bd85336a993a00 (patch) | |
| tree | 4dd1ea4cc8cce68076d4e61be864be9680cd38ab /src/file.cpp | |
| parent | Added forgotten #ifdef HAVE_CAIRO_PDF/#endif pair (diff) | |
| download | inkscape-0bb199cdf8c63341361fa93bf4bd85336a993a00.tar.gz inkscape-0bb199cdf8c63341361fa93bf4bd85336a993a00.zip | |
Fixes path memory issues with the save dialog. (Closes: #1089414)
(bzr r1747)
Diffstat (limited to 'src/file.cpp')
| -rw-r--r-- | src/file.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/file.cpp b/src/file.cpp index de8ab2b5d..f8ebc9809 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -589,7 +589,8 @@ sp_file_save_dialog(SPDocument *doc, bool is_copy) save_loc.append(formatBuf); } } else { - save_loc = Glib::path_get_dirname(doc->uri); + save_loc = Glib::build_filename(Glib::path_get_dirname(doc->uri), + Glib::path_get_basename(doc->uri)); } // convert save_loc from utf-8 to locale @@ -615,6 +616,8 @@ sp_file_save_dialog(SPDocument *doc, bool is_copy) (char const *) _("Select file to save to"), default_extension ); + else + saveDialogInstance->change_path(save_loc); saveDialogInstance->change_title(dialog_title); bool success = saveDialogInstance->show(); @@ -640,7 +643,7 @@ sp_file_save_dialog(SPDocument *doc, bool is_copy) if (success) prefs_set_recent_file(SP_DOCUMENT_URI(doc), SP_DOCUMENT_NAME(doc)); - save_path = fileName; + save_path = Glib::path_get_dirname(fileName); prefs_set_string_attribute("dialogs.save_as", "path", save_path.c_str()); return success; |
