[gnome-panel/gnome-3-2] panel: Do not assert on error when using default layout



commit 40da4f7de1dbc5e2db4658873d2f2116f336c4f2
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Oct 11 16:41:34 2011 +0200

    panel: Do not assert on error when using default layout
    
    Asserting is wrong: the default layout could be badly formatted, and in
    that case we should not abort but fail with a nice error. It turns out
    we already had the code for that, except that we never reached it since
    we asserted before :-)

 gnome-panel/panel-layout.c |   15 +++++----------
 gnome-panel/panel-layout.h |    3 +--
 2 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/gnome-panel/panel-layout.c b/gnome-panel/panel-layout.c
index d52a6a0..7c41f2b 100644
--- a/gnome-panel/panel-layout.c
+++ b/gnome-panel/panel-layout.c
@@ -473,8 +473,7 @@ panel_layout_append_group (GKeyFile    *keyfile,
 
 static void
 panel_layout_append_from_file_real (const char *layout_file,
-                                    int         screen_for_toplevels,
-                                    gboolean    error_fatal)
+                                    int         screen_for_toplevels)
 {
         GError    *error = NULL;
         GKeyFile  *keyfile = NULL;
@@ -522,9 +521,6 @@ out:
                 g_printerr ("Error while parsing default layout from '%s': %s\n",
                             layout_file, error->message);
                 g_error_free (error);
-
-                if (error_fatal)
-                        g_assert_not_reached ();
         }
 
         if (groups)
@@ -540,14 +536,13 @@ panel_layout_append_from_file_for_screen (const char *layout_file,
 {
         int screen_n = gdk_screen_get_number (screen);
 
-        panel_layout_append_from_file_real (layout_file, screen_n, FALSE);
+        panel_layout_append_from_file_real (layout_file, screen_n);
 }
 
 void
-panel_layout_append_from_file (const char *layout_file,
-                               gboolean    error_fatal)
+panel_layout_append_from_file (const char *layout_file)
 {
-        panel_layout_append_from_file_real (layout_file, -1, error_fatal);
+        panel_layout_append_from_file_real (layout_file, -1);
 }
 
 
@@ -1095,7 +1090,7 @@ panel_layout_load (void)
                 }
 
                 default_layout_file = panel_layout_get_default_layout_file ();
-                panel_layout_append_from_file (default_layout_file, TRUE);
+                panel_layout_append_from_file (default_layout_file);
                 g_free (default_layout_file);
 
                 toplevels = g_settings_get_strv (layout_settings,
diff --git a/gnome-panel/panel-layout.h b/gnome-panel/panel-layout.h
index 70ba81e..455be3a 100644
--- a/gnome-panel/panel-layout.h
+++ b/gnome-panel/panel-layout.h
@@ -32,8 +32,7 @@
 
 G_BEGIN_DECLS
 
-void panel_layout_append_from_file (const char *layout_file,
-                                    gboolean    error_fatal);
+void panel_layout_append_from_file (const char *layout_file);
 
 gboolean panel_layout_load         (void);
 



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