gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22223 - gnunet-gtk/src/setup


From: gnunet
Subject: [GNUnet-SVN] r22223 - gnunet-gtk/src/setup
Date: Sat, 23 Jun 2012 16:35:51 +0200

Author: grothoff
Date: 2012-06-23 16:35:51 +0200 (Sat, 23 Jun 2012)
New Revision: 22223

Modified:
   gnunet-gtk/src/setup/gnunet-setup.c
Log:
-code cleanup

Modified: gnunet-gtk/src/setup/gnunet-setup.c
===================================================================
--- gnunet-gtk/src/setup/gnunet-setup.c 2012-06-23 08:46:43 UTC (rev 22222)
+++ gnunet-gtk/src/setup/gnunet-setup.c 2012-06-23 14:35:51 UTC (rev 22223)
@@ -71,6 +71,14 @@
 }
 
 
+/**
+ * User clicked on some widget, update the help button label and link.
+ *
+ * @param widget widget that was clicked on (unused)
+ * @param event the current event
+ * @param user_data context with the option specification to evaluate
+ * @return FALSE (continue event handling)
+ */
 static gboolean
 help_click_callback (GtkWidget * widget, GdkEventButton * event,
                      gpointer user_data)
@@ -78,7 +86,7 @@
   const struct GNUNET_SETUP_OptionSpecification *os = user_data;
   GtkLinkButton *help;
 
-  if (event->type != GDK_BUTTON_PRESS)
+  if (GDK_BUTTON_PRESS != event->type)
     return FALSE;
   help = GTK_LINK_BUTTON (GNUNET_SETUP_get_object ("GNUNET_setup_help_text"));
   gtk_link_button_set_uri (help, os->help_url);
@@ -110,7 +118,7 @@
   {
     vs = &os->visibility[i];
     widget = GTK_WIDGET (GNUNET_SETUP_get_object (vs->widget_name));
-    if (widget == NULL)
+    if (NULL == widget)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Widget `%s' not found\n"),
                   vs->widget_name);
@@ -153,6 +161,8 @@
 
 /**
  * Function called whenever a widget changes its state.
+ *
+ * @param os details about the option
  */
 static void
 widget_state_change_callback (const struct GNUNET_SETUP_OptionSpecification 
*os)
@@ -196,7 +206,7 @@
   char *value;
 
   i = 0;
-  while (option_specifications[i].widget_name != NULL)
+  while (NULL != option_specifications[i].widget_name)
   {
     os = &option_specifications[i];
     widget = GNUNET_SETUP_get_object (os->widget_name);
@@ -207,7 +217,7 @@
       i++;
       continue;
     }
-    if (os->load_function != NULL)
+    if (NULL != os->load_function)
     {
       if ((NULL == os->section) || (NULL == os->option))
       {
@@ -255,7 +265,7 @@
       g_signal_connect (widget, "button-press-event",
                         G_CALLBACK (&help_click_callback), (void *) os);
     }
-    if (os->change_signal != NULL)
+    if (NULL != os->change_signal)
     {
       GNUNET_assert (NULL != os->save_function);
       g_signal_connect_swapped (widget, os->change_signal,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]