[goffice] Warning fix.



commit 5f5d91c1998a19e4bda0ffc0af5ae53dc36a74e0
Author: Morten Welinder <terra gnome org>
Date:   Thu May 7 08:52:54 2009 -0400

    Warning fix.
---
 ChangeLog                 |    5 +++++
 goffice/gtk/goffice-gtk.c |   11 +++--------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 771a394..ee45b02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-07  Morten Welinder  <terra gnome org>
+
+	* goffice/gtk/goffice-gtk.c (go_gtk_url_is_writeable): Avoid a
+	warning and further reports like #580409.
+
 2009-05-06  Morten Welinder  <mwelinder gmail com>
 
 	* configure.in: Post-release bump.
diff --git a/goffice/gtk/goffice-gtk.c b/goffice/gtk/goffice-gtk.c
index e688287..0c75be3 100644
--- a/goffice/gtk/goffice-gtk.c
+++ b/goffice/gtk/goffice-gtk.c
@@ -983,24 +983,19 @@ go_gtk_url_is_writeable (GtkWindow *parent, char const *uri,
 	} else if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
 		char *dirname = go_dirname_from_uri (uri, TRUE);
 		char *basename = go_basename_from_uri (uri);
-		char *msg = g_markup_printf_escaped (
-			_("A file called <i>%s</i> already exists in %s.\n\n"
-			  "Do you want to save over it?"),
-			basename, dirname);
-		/* gcc complains over this, but the format seems right and
-		   is not supposed to be constant.  Using "%s" is wrong.  */
 		GtkWidget *dialog = gtk_message_dialog_new_with_markup (parent,
 			 GTK_DIALOG_DESTROY_WITH_PARENT,
 			 GTK_MESSAGE_WARNING,
 			 GTK_BUTTONS_OK_CANCEL,
-			 msg);
+			 _("A file called <i>%s</i> already exists in %s.\n\n"
+			   "Do you want to save over it?"),
+			 basename, dirname);
 		gtk_dialog_set_default_response (GTK_DIALOG (dialog),
 			overwrite_by_default ? GTK_RESPONSE_OK : GTK_RESPONSE_CANCEL);
 		result = GTK_RESPONSE_OK ==
 			go_gtk_dialog_run (GTK_DIALOG (dialog), parent);
 		g_free (dirname);
 		g_free (basename);
-		g_free (msg);
 	}
 
 	g_free (filename);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]