SF.net SVN: geany:[5455] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Wed Dec 1 13:06:01 UTC 2010


Revision: 5455
          http://geany.svn.sourceforge.net/geany/?rev=5455&view=rev
Author:   ntrel
Date:     2010-12-01 13:06:01 +0000 (Wed, 01 Dec 2010)

Log Message:
-----------
Warn about file truncation if unsafe file saving fails.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/document.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-11-30 18:25:16 UTC (rev 5454)
+++ trunk/ChangeLog	2010-12-01 13:06:01 UTC (rev 5455)
@@ -1,3 +1,9 @@
+2010-12-01  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/document.c:
+   Warn about file truncation if unsafe file saving fails.
+
+
 2010-11-30  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/utils.c:

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2010-11-30 18:25:16 UTC (rev 5454)
+++ trunk/src/document.c	2010-12-01 13:06:01 UTC (rev 5455)
@@ -1792,6 +1792,7 @@
 	{
 		gchar *msg = g_strdup(error->message);
 		g_error_free(error);
+		/* geany will warn about file truncation for unsafe saving below */
 		return msg;
 	}
 	return NULL;
@@ -1917,6 +1918,12 @@
 	if (errmsg != NULL)
 	{
 		ui_set_statusbar(TRUE, _("Error saving file (%s)."), errmsg);
+
+		if (!file_prefs.use_safe_file_saving)
+		{
+			setptr(errmsg,
+				g_strdup_printf(_("%s\n\nThe file on disk may now be truncated!"), errmsg));
+		}
 		dialogs_show_msgbox_with_secondary(GTK_MESSAGE_ERROR, _("Error saving file."), errmsg);
 		doc->priv->file_disk_status = FILE_OK;
 		utils_beep();


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