[meld] ui.statusbar: Don't update statusbar encoding directly



commit b09ede8732ef7aee26626edd757f736e1aaf4c6a
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Fri Jan 19 06:33:24 2018 +1000

    ui.statusbar: Don't update statusbar encoding directly
    
    We need this to go through the signal logic, to the file comparison
    checks, and finally through the buffer, where we'll change because of
    the GObject property bind. If we don't do this then failed reloads
    because of e.g., encoding errors, or users having unsaved changes will
    mean that we're showing the wrong encoding in the status bar.

 meld/ui/statusbar.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/meld/ui/statusbar.py b/meld/ui/statusbar.py
index 12270bc6..5f68f800 100644
--- a/meld/ui/statusbar.py
+++ b/meld/ui/statusbar.py
@@ -218,7 +218,6 @@ class MeldStatusBar(Gtk.Statusbar):
 
     def construct_encoding_selector(self):
         def change_encoding(selector, encoding):
-            self.props.source_encoding = encoding
             self.emit('encoding-changed', encoding)
             pop.hide()
 
@@ -244,6 +243,11 @@ class MeldStatusBar(Gtk.Statusbar):
 
     def construct_highlighting_selector(self):
         def change_language(selector, lang):
+            # TODO: Our other GObject properties are expected to be
+            # updated through a bound state from our parent. This is
+            # the only place where we assign to them instead of
+            # emitting a signal, and it makes the class logic as a
+            # whole kind of confusing.
             self.props.source_language = lang
             pop.hide()
 


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