[gnome-panel] panel: Do not assert on error when using default layout
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] panel: Do not assert on error when using default layout
- Date: Tue, 11 Oct 2011 15:28:07 +0000 (UTC)
commit 077891cdfae7f0b247c1285de22d753d966712be
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 4045c4c..596d97f 100644
--- a/gnome-panel/panel-layout.c
+++ b/gnome-panel/panel-layout.c
@@ -571,8 +571,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;
@@ -620,9 +619,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)
@@ -638,14 +634,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);
}
@@ -1193,7 +1188,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]