[geany/geany] 3ab657: Notify user when trying to save read-only document

Nick Treleaven git-noreply at xxxxx
Fri Sep 26 10:44:07 UTC 2014


Branch:      refs/heads/master
Author:      Nick Treleaven <nick.treleaven at btinternet.com>
Committer:   Nick Treleaven <nick.treleaven at btinternet.com>
Date:        Fri, 26 Sep 2014 10:44:07 UTC
Commit:      3ab65790910c494cf94db67d7e65bd5738aae6f1
             https://github.com/geany/geany/commit/3ab65790910c494cf94db67d7e65bd5738aae6f1

Log Message:
-----------
Notify user when trying to save read-only document


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

Modified: src/document.c
9 lines changed, 6 insertions(+), 3 deletions(-)
===================================================================
@@ -1929,11 +1929,14 @@ gboolean document_save_file(GeanyDocument *doc, gboolean force)
 		return dialogs_show_save_as();
 	}
 
-	/* the "changed" flag should exclude the "readonly" flag, but check it anyway for safety */
-	if (doc->readonly)
-		return FALSE;
 	if (!force && !doc->changed)
 		return FALSE;
+	if (doc->readonly)
+	{
+		ui_set_statusbar(TRUE,
+			_("Cannot save read-only document '%s'!"), DOC_FILENAME(doc));
+		return FALSE;
+	}
 	if (doc->priv->protected)
 	{
 		return save_file_handle_infobars(doc, force);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list