SF.net SVN: geany: [908] trunk/src/dialogs.c

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Oct 20 16:40:16 UTC 2006


Revision: 908
          http://svn.sourceforge.net/geany/?rev=908&view=rev
Author:   ntrel
Date:     2006-10-20 09:40:12 -0700 (Fri, 20 Oct 2006)

Log Message:
-----------
Use Untitled string for unsaved dialog.

Modified Paths:
--------------
    trunk/src/dialogs.c

Modified: trunk/src/dialogs.c
===================================================================
--- trunk/src/dialogs.c	2006-10-20 12:31:22 UTC (rev 907)
+++ trunk/src/dialogs.c	2006-10-20 16:40:12 UTC (rev 908)
@@ -334,19 +334,18 @@
 #ifndef G_OS_WIN32
 	GtkWidget *dialog, *button, *label, *image, *hbox, *align;
 #endif
-	gchar *msg;
+	gchar *msg, *short_fn = NULL;
 	gint ret;
 
 	if (doc_list[idx].file_name != NULL)
 	{
-		gchar *short_fn = g_path_get_basename(doc_list[idx].file_name);
-		msg = g_strdup_printf(_("The file '%s' is not saved."), short_fn);
-		g_free(short_fn);
+		short_fn = g_path_get_basename(doc_list[idx].file_name);
 	}
-	else
-	{
-		msg = g_strdup(_("This unnamed file is not saved."));
-	}
+
+	msg = g_strdup_printf(_("The file '%s' is not saved."),
+		(short_fn != NULL) ? short_fn : GEANY_STRING_UNTITLED);
+	g_free(short_fn);
+
 #ifdef G_OS_WIN32
 	ret = win32_message_dialog_unsaved(msg);
 #else


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list