SF.net SVN: geany: [921] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Mon Oct 23 20:56:17 UTC 2006


Revision: 921
          http://svn.sourceforge.net/geany/?rev=921&view=rev
Author:   eht16
Date:     2006-10-23 13:56:11 -0700 (Mon, 23 Oct 2006)

Log Message:
-----------
Don't allow changing the encoding or setting a BOM if the file is read only.

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-10-23 20:32:37 UTC (rev 920)
+++ trunk/ChangeLog	2006-10-23 20:56:11 UTC (rev 921)
@@ -3,6 +3,8 @@
  * src/encodings.c, src/encodings.h, src/document.c, src/callbacks.c,
    src/dialogs.c: Added new encoding "None" to open files without any
                   character conversions (fixes #1580456).
+ * src/callbacks.c: Don't allow changing the encoding or setting a BOM
+                    if the file is read only.
 
 
 2006-10-22  Enrico Tröger  <enrico.troeger at uvena.de>

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2006-10-23 20:32:37 UTC (rev 920)
+++ trunk/src/callbacks.c	2006-10-23 20:56:11 UTC (rev 921)
@@ -2153,6 +2153,11 @@
 	if (app->ignore_callback || ! DOC_IDX_VALID(idx) || encodings[i].charset == NULL ||
 		utils_strcmp(encodings[i].charset, doc_list[idx].encoding)) return;
 
+	if (doc_list[idx].readonly)
+	{
+		utils_beep();
+		return;
+	}
 	document_undo_add(idx, UNDO_ENCODING, g_strdup(doc_list[idx].encoding));
 
 	document_set_encoding(idx, encodings[i].charset);
@@ -2206,6 +2211,11 @@
 		gint idx = document_get_cur_idx();
 
 		if (idx == -1 || ! doc_list[idx].is_valid) return;
+		if (doc_list[idx].readonly)
+		{
+			utils_beep();
+			return;
+		}
 
 		document_undo_add(idx, UNDO_BOM, GINT_TO_POINTER(doc_list[idx].has_bom));
 


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