[gnome-settings-daemon/docking-stations] Fix error logic in apply_configuration_from_filename()



commit 13c97eda09070ce7a5e3b65a782335b85fa8485d
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Nov 16 12:29:11 2011 -0600

    Fix error logic in apply_configuration_from_filename()
    
    It was not propagating non-RANDR errors like 'file not found' correctly.
    Thus, the callers had no idea if any configuration was applied at all.
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 plugins/xrandr/gsd-xrandr-manager.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index 0b08981..8f76487 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -444,14 +444,17 @@ apply_configuration_from_filename (GsdXrandrManager *manager,
                         if (no_matching_config_is_an_error) {
                                 g_propagate_error (error, my_error);
                                 return FALSE;
+                        } else {
+                                /* This is not an error; the user probably changed his monitors
+                                 * and so they don't match any of the stored configurations.
+                                 */
+                                g_error_free (my_error);
+                                return TRUE;
                         }
+                } else {
+                        g_propagate_error (error, my_error);
+                        return FALSE;
                 }
-
-                /* This is not an error; the user probably changed his monitors
-                 * and so they don't match any of the stored configurations.
-                 */
-                g_error_free (my_error);
-                return TRUE;
         }
 
         if (up_client_get_lid_is_closed (priv->upower_client))



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