[uim-commit] r551 - trunk/helper

makeinu at freedesktop.org makeinu at freedesktop.org
Sat Feb 5 05:53:05 PST 2005


Author: makeinu
Date: 2005-02-05 05:53:01 -0800 (Sat, 05 Feb 2005)
New Revision: 551

Modified:
   trunk/helper/pref-gtk.c
Log:
* helper/pref-gtk.c
  - (create_sub_group_widgets):
    Renamed from create_sub_group_widget.
    Skip empty sub group.


Modified: trunk/helper/pref-gtk.c
===================================================================
--- trunk/helper/pref-gtk.c	2005-02-05 13:30:53 UTC (rev 550)
+++ trunk/helper/pref-gtk.c	2005-02-05 13:53:01 UTC (rev 551)
@@ -64,8 +64,8 @@
 static GtkWidget *create_pref_treeview(void);
 static GtkWidget *create_group_widget(const char *group_name);
 #if USE_SUB_GROUP
-static void create_sub_group_widget(GtkWidget *parent_widget,
-				    const char *parent_group);
+static void create_sub_group_widgets(GtkWidget *parent_widget,
+				     const char *parent_group);
 #endif
 
 static void
@@ -352,7 +352,7 @@
   gtk_box_pack_start (GTK_BOX(vbox), group_label, FALSE, TRUE, 8);
 
 #if USE_SUB_GROUP
-  create_sub_group_widget(vbox, group_name);
+  create_sub_group_widgets(vbox, group_name);
 #else
   {
     char **custom_syms, **custom_sym;
@@ -375,7 +375,7 @@
 }
 
 #if USE_SUB_GROUP
-static void create_sub_group_widget(GtkWidget *parent_widget, const char *parent_group)
+static void create_sub_group_widgets(GtkWidget *parent_widget, const char *parent_group)
 {
     char **sgrp_syms = uim_custom_group_subgroups(parent_group);
     char **sgrp_sym;
@@ -387,9 +387,18 @@
 	GtkWidget *frame;
 	GtkWidget *vbox;
 
-	if(sgrp == NULL)
+	if(!sgrp)
 	  continue;
 
+	custom_syms = uim_custom_collect_by_group(*sgrp_sym);
+
+	if (!custom_syms)
+	  continue;
+	if (!*custom_syms) {
+	  uim_custom_symbol_list_free(custom_syms);
+	  continue;
+	}
+
 	frame = gtk_frame_new(sgrp->label);
 	gtk_frame_set_label_align(GTK_FRAME(frame), 0.02, 0.5);
 	gtk_box_pack_start(GTK_BOX(parent_widget), frame, FALSE, FALSE, 0);
@@ -399,13 +408,10 @@
 
 	gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
 
-	custom_syms = uim_custom_collect_by_group(*sgrp_sym);
-	if (custom_syms) {
-	  for (custom_sym = custom_syms; *custom_sym; custom_sym++) {
-	    uim_pref_gtk_add_custom(vbox, *custom_sym);
-	  }
-	  uim_custom_symbol_list_free(custom_syms);
+	for (custom_sym = custom_syms; *custom_sym; custom_sym++) {
+	  uim_pref_gtk_add_custom(vbox, *custom_sym);
 	}
+	uim_custom_symbol_list_free(custom_syms);
 
 	uim_custom_group_free(sgrp);
     }



More information about the Uim-commit mailing list