[gnome-control-center] display/config-manager-dbus: Clear the current state on error



commit d0ca7e0abc7c81e6f3998237544c3559bb27671c
Author: Rui Matos <tiagomatos gmail com>
Date:   Mon Aug 21 14:44:31 2017 +0200

    display/config-manager-dbus: Clear the current state on error
    
    This ensures that the higher levels notice that there was an error and
    show the appropriate UI instead of showing the previous state.

 panels/display/cc-display-config-manager-dbus.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/panels/display/cc-display-config-manager-dbus.c b/panels/display/cc-display-config-manager-dbus.c
index 3ec65aa..8912faa 100644
--- a/panels/display/cc-display-config-manager-dbus.c
+++ b/panels/display/cc-display-config-manager-dbus.c
@@ -65,6 +65,8 @@ got_current_state (GObject      *object,
     {
       if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
         {
+          self = CC_DISPLAY_CONFIG_MANAGER_DBUS (data);
+          g_clear_pointer (&self->current_state, g_variant_unref);
           _cc_display_config_manager_emit_changed (CC_DISPLAY_CONFIG_MANAGER (data));
           g_warning ("Error calling GetCurrentState: %s", error->message);
         }


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