[dconf-editor] Do not share modifications_handler.



commit 73c8cf507bb5bdccabdb61523010bdf5adeab92e
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Nov 26 18:16:12 2018 +0100

    Do not share modifications_handler.

 editor/modifications-list.vala     | 12 +++++-------
 editor/modifications-revealer.vala | 11 +++++++----
 2 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/editor/modifications-list.vala b/editor/modifications-list.vala
index 8b13dc6..428309a 100644
--- a/editor/modifications-list.vala
+++ b/editor/modifications-list.vala
@@ -87,14 +87,12 @@ private class ModificationsList : OverlayedList
     * * Modifications list public functions
     \*/
 
-    internal bool dismiss_selected_modification (ModificationsHandler modifications_handler)
+    internal string? get_selected_row_name ()
     {
         ListBoxRow? selected_row = main_list_box.get_selected_row ();
         if (selected_row == null)
-            return false;
-
-        modifications_handler.dismiss_change (((DelayedSettingView) (!) selected_row).full_name);
-        return true;
+            return null;
+        return ((DelayedSettingView) (!) selected_row).full_name;
     }
 
     internal void bind_model (GLib.ListStore modifications, ListBoxCreateWidgetFunc 
delayed_setting_row_create)
@@ -115,7 +113,7 @@ private class ModificationsList : OverlayedList
 
     internal void gkey_value_push (string full_name, uint16 context_id, Variant key_value, bool 
is_key_default)
     {
-        main_list_box.foreach ((widget) => {
+        main_list_box.@foreach ((widget) => {
                 DelayedSettingView row = (DelayedSettingView) widget;
                 if (row.full_name == full_name && row.context_id == context_id)
                     row.update_gsettings_key_current_value (key_value, is_key_default);
@@ -124,7 +122,7 @@ private class ModificationsList : OverlayedList
 
     internal void dkey_value_push (string full_name, Variant? key_value_or_null)
     {
-        main_list_box.foreach ((widget) => {
+        main_list_box.@foreach ((widget) => {
                 DelayedSettingView row = (DelayedSettingView) widget;
                 if (row.full_name == full_name)
                     row.update_dconf_key_current_value (key_value_or_null);
diff --git a/editor/modifications-revealer.vala b/editor/modifications-revealer.vala
index cc0b011..609164c 100644
--- a/editor/modifications-revealer.vala
+++ b/editor/modifications-revealer.vala
@@ -144,10 +144,13 @@ private class ModificationsRevealer : Revealer, AdaptativeWidget
         if (!delayed_list_button.active)
             return false;
 
-        bool dismissed = modifications_list.dismiss_selected_modification (modifications_handler);
-        if (dismissed)
-            update ();
-        return dismissed;
+        string? selected_row_name = modifications_list.get_selected_row_name ();
+        if (selected_row_name == null)
+            return false;
+
+        modifications_handler.dismiss_change ((!) selected_row_name);
+        update ();
+        return true;
     }
 
     internal void hide_modifications_list ()


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