[GnomeMeeting-devel-list] [PATCH] gtk_menu_extentions.c and warnings
- From: PUYDT Julien <julien puydt laposte net>
- To: GnomeMeeting Devel Liste <gnomemeeting-devel-list gnome org>
- Subject: [GnomeMeeting-devel-list] [PATCH] gtk_menu_extentions.c and warnings
- Date: Wed, 07 Apr 2004 17:37:07 +0200
Hi,
the following very small patch makes it so that instead of silently
failing, some functions will spit out a warning. That should make it
easier to hack menus in gnomemeeting.
Snark
diff -ur gnomemeeting-cvs-20040407.CVS/lib/gtk_menu_extensions.c gnomemeeting-cvs-20040407.CVS.patched/lib/gtk_menu_extensions.c
--- gnomemeeting-cvs-20040407.CVS/lib/gtk_menu_extensions.c 2004-03-27 20:03:11.000000000 +0100
+++ gnomemeeting-cvs-20040407.CVS.patched/lib/gtk_menu_extensions.c 2004-04-07 17:20:17.000000000 +0200
@@ -71,16 +71,15 @@
gpointer data)
{
gboolean show_icons = TRUE;
-
- if (gm_conf_entry_get_type (entry) == GM_CONF_BOOL && data) {
-
- gdk_threads_enter ();
-
- show_icons = gm_conf_entry_get_bool (entry);
- gtk_menu_show_icons (GTK_WIDGET (data), show_icons);
- gdk_threads_leave ();
- }
+ g_return_if_fail (gm_conf_entry_get_type (entry) == GM_CONF_BOOL && data);
+
+ gdk_threads_enter ();
+
+ show_icons = gm_conf_entry_get_bool (entry);
+ gtk_menu_show_icons (GTK_WIDGET (data), show_icons);
+
+ gdk_threads_leave ();
}
@@ -346,8 +345,7 @@
{
GtkWidget *menu_item = NULL;
- if (!menu || !id)
- return;
+ g_return_if_fail (menu != NULL && id != NULL);
menu_item = (GtkWidget *) g_object_get_data (G_OBJECT (menu), id);
@@ -366,8 +364,7 @@
int i = 0;
- if (!menu || !id)
- return;
+ g_return_if_fail (menu != NULL && id != NULL);
menu_item = (GtkWidget *) g_object_get_data (G_OBJECT (menu), id);
menu_entry = (MenuEntry *) g_object_get_data (G_OBJECT (menu), "menu_entry");
@@ -395,10 +392,9 @@
gtk_menu_get_widget (GtkWidget *menu,
const char *id)
{
- if (!menu || !id)
- return NULL;
- else
- return (GtkWidget *) g_object_get_data (G_OBJECT (menu), id);
+ g_return_val_if_fail (menu != NULL && id != NULL, NULL);
+
+ return (GtkWidget *) g_object_get_data (G_OBJECT (menu), id);
}
@@ -447,8 +443,7 @@
int group_last_pos = 0;
int i = 0;
- if (!widget)
- return;
+ g_return_if_fail (widget != NULL);
group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (widget));
group_last_pos = g_slist_length (group) - 1; /* If length 1,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]