diff -u inkscape-0.44/debian/changelog inkscape-0.44/debian/changelog --- inkscape-0.44/debian/changelog +++ inkscape-0.44/debian/changelog @@ -1,3 +1,13 @@ +inkscape (0.44-1ubuntu2) edgy; urgency=low + + * Add 'debian/patches/01_filesave_dialog_warning.dpatch': Fix annoying + popup warning from GTK when save dialog comes up initially + (Closes Ubuntu #63644). + * Backported from upstream: + http://svn.sourceforge.net/viewvc/inkscape?view=rev&revision=13124 + + -- Kees Cook Fri, 6 Oct 2006 09:28:02 -0700 + inkscape (0.44-1ubuntu1) edgy; urgency=low * Merged to Debian unstable; remaining Ubuntu changes: only in patch2: unchanged: --- inkscape-0.44.orig/debian/patches/01_filesave_dialog_warning.dpatch +++ inkscape-0.44/debian/patches/01_filesave_dialog_warning.dpatch @@ -0,0 +1,106 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_filesave_dialog_warning.dpatch by Kees Cook +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: backported filesave dialog warning from GTK: +## DP: http://svn.sourceforge.net/viewvc/inkscape?view=rev&revision=13124 + +@DPATCH@ +diff -urNad inkscape-0.44~/src/dialogs/filedialog.cpp inkscape-0.44/src/dialogs/filedialog.cpp +--- inkscape-0.44~/src/dialogs/filedialog.cpp 2006-06-22 21:06:51.000000000 -0700 ++++ inkscape-0.44/src/dialogs/filedialog.cpp 2006-10-06 11:32:08.150394713 -0700 +@@ -992,6 +992,7 @@ + + gchar *getFilename(); + ++ void change_path(const gchar * path); + + private: + +@@ -1241,7 +1242,7 @@ + // leaving a trailing backslash on the directory name leads to the infamous + // double-directory bug on win32 + if (len != 0 && udir[len - 1] == '\\') udir.erase(len - 1); +- set_current_folder(udir.c_str()); ++ myFilename = udir; + } + + //###### Add the file types menu +@@ -1334,6 +1335,21 @@ + } + + ++/** ++ * Change the default save path location. ++ */ ++void ++FileSaveDialogImpl::change_path(const gchar * path) ++{ ++ myFilename = path; ++ if (Glib::file_test(myFilename, Glib::FILE_TEST_IS_DIR)) { ++ set_current_folder(myFilename); ++ } else { ++ set_filename(myFilename); ++ Glib::ustring basename = Glib::path_get_basename(myFilename); ++ set_current_name(basename); ++ } ++} + + + /** +@@ -1342,7 +1358,7 @@ + bool + FileSaveDialogImpl::show() + { +- set_current_folder(get_current_folder()); //hack to force initial dir listing ++ change_path(myFilename.c_str()); + set_modal (TRUE); //Window + sp_transientize((GtkWidget *)gobj()); //Make transient + gint b = run(); //Dialog +diff -urNad inkscape-0.44~/src/dialogs/filedialog.h inkscape-0.44/src/dialogs/filedialog.h +--- inkscape-0.44~/src/dialogs/filedialog.h 2006-06-22 21:06:51.000000000 -0700 ++++ inkscape-0.44/src/dialogs/filedialog.h 2006-10-06 11:31:45.897264185 -0700 +@@ -149,6 +149,8 @@ + + virtual gchar * getFilename () =0; + ++ virtual void change_path(const gchar * path) = 0; ++ + + }; //FileSaveDialog + +diff -urNad inkscape-0.44~/src/file.cpp inkscape-0.44/src/file.cpp +--- inkscape-0.44~/src/file.cpp 2006-06-22 21:07:29.000000000 -0700 ++++ inkscape-0.44/src/file.cpp 2006-10-06 11:31:45.897264185 -0700 +@@ -626,7 +626,10 @@ + g_free(temp_filename); + } + } else { +- save_loc = g_path_get_dirname(doc->uri); /* \todo should use a getter */ ++ Glib::ustring uloc; ++ uloc = Glib::build_filename(Glib::path_get_dirname(doc->uri), ++ Glib::path_get_basename(doc->uri)); ++ save_loc = g_strdup(uloc.c_str()); + } + + { // convert save_loc from utf-8 to locale +@@ -659,7 +662,9 @@ + (char const *) _("Select file to save to"), + default_extension + ); +- } // FIXME: else (i.e. if reshowing an already shown dialog) save_loc is not used, it thus always displays the previously opened dir ++ } ++ else ++ saveDialogInstance->change_path(save_loc); + bool success = saveDialogInstance->show(); + char *fileName = ( success + ? g_strdup(saveDialogInstance->getFilename()) +@@ -705,7 +710,7 @@ + prefs_set_recent_file(SP_DOCUMENT_URI(doc), SP_DOCUMENT_NAME(doc)); + } + +- save_path = g_dirname(fileName); ++ save_path = g_path_get_dirname(fileName); + prefs_set_string_attribute("dialogs.save_as", "path", save_path); + g_free(save_path); + only in patch2: unchanged: --- inkscape-0.44.orig/debian/patches/00list +++ inkscape-0.44/debian/patches/00list @@ -0,0 +1 @@ +01_filesave_dialog_warning.dpatch