[gnome-builder] document: avoid extra set to read only



commit 1886d270637dddc3554a50c24f3045045e78273d
Author: Christian Hergert <christian hergert me>
Date:   Mon Dec 15 01:40:18 2014 -0800

    document: avoid extra set to read only

 src/editor/gb-editor-document.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/editor/gb-editor-document.c b/src/editor/gb-editor-document.c
index 86778fc..4e8057e 100644
--- a/src/editor/gb-editor-document.c
+++ b/src/editor/gb-editor-document.c
@@ -199,11 +199,11 @@ gb_editor_document_check_modified_cb (GObject      *object,
 
           read_only = !g_file_info_get_attribute_boolean (info,
                                                           G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE);
-          gb_editor_document_set_read_only (document, read_only);
+          if (gb_editor_document_get_read_only (GB_DOCUMENT (document)) != read_only)
+            gb_editor_document_set_read_only (document, read_only);
         }
 
-      if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_MODIFIED) &&
-          document->priv->mtime_set)
+      if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_MODIFIED) && document->priv->mtime_set)
         {
           GTimeVal tv;
 


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