[uim-commit] r568 - trunk/qt

makeinu at freedesktop.org makeinu at freedesktop.org
Sun Feb 6 07:54:19 PST 2005


Author: makeinu
Date: 2005-02-06 07:54:16 -0800 (Sun, 06 Feb 2005)
New Revision: 568

Modified:
   trunk/qt/pref-qt.cpp
Log:
* qt/pref-qt.cpp:
  - Enable sub group feature.


Modified: trunk/qt/pref-qt.cpp
===================================================================
--- trunk/qt/pref-qt.cpp	2005-02-06 15:48:36 UTC (rev 567)
+++ trunk/qt/pref-qt.cpp	2005-02-06 15:54:16 UTC (rev 568)
@@ -297,12 +297,9 @@
     /* default QVGroupBox */
     QVGroupBox *defaultGroupVBox = new QVGroupBox( this );
     vLayout->addWidget( defaultGroupVBox );    
+    defaultGroupVBox->hide();
 
-    /* 2004-02-03 Kazuki Ohta <mover at hct.zaq.ne.jp>
-     * subgrouping feature seems to unstable and cause the crash in some reason.
-     *
-     * SubgroupData *sd = new SubgroupData( this, group_name );
-     */
+    SubgroupData *sd = new SubgroupData( this, group_name );
 
     /* add various widgets to the vbox */
     char **custom_syms = uim_custom_collect_by_group( group_name );
@@ -310,15 +307,13 @@
     {
         for( char **custom_sym = custom_syms; *custom_sym; custom_sym++ )
         {
-            /*
             QVGroupBox *vbox = sd->searchGroupVBoxByCustomSym( *custom_sym );
             if( vbox == NULL )
             {
                 vbox = defaultGroupVBox;
+                vbox->show();
             }
-            */
             
-            QVGroupBox *vbox = defaultGroupVBox;
             UimCustomItemIface *iface = addCustom( vbox, *custom_sym );
             if( iface )
                 m_customIfaceList.append( iface );
@@ -327,18 +322,8 @@
         uim_custom_symbol_list_free( custom_syms );
     }
 
-    /* 2004-02-02 Kazuki Ohta <mover at hct.zaq.ne.jp>
-     *
-     * This is very adhoc hack!!
-     * if "main" subgroup's gvbox dosn't have child, hides it!
-     */
-    if( defaultGroupVBox && defaultGroupVBox->children()->isEmpty() )
-    {
-        defaultGroupVBox->hide();
-    }
-
     /* free */
-//    delete sd;
+    delete sd;
     uim_custom_group_free( group );
 
     /* bottom up */
@@ -510,15 +495,17 @@
          * The subgroup "main" doesn't contain any contents.
          * So, we need to create default QVGroupBox for it.
          */
+        QVGroupBox *gvbox;
         if( QString::compare( *sgrp, "main" ) == 0 )
         {
-            uim_custom_group_free( sgroup_custom );
-            continue;
+            gvbox = NULL;
         }
+        else
+        {
+            gvbox = new QVGroupBox( _FU8(sgroup_custom->label), parentWidget );
+            parentWidget->layout()->add( gvbox );
+        }
 
-        QVGroupBox *gvbox = new QVGroupBox( _FU8(sgroup_custom->label), parentWidget );
-        parentWidget->layout()->add( gvbox );
-        
         char **custom_syms = uim_custom_collect_by_group( *sgrp );
         if( !custom_syms )
             continue;



More information about the Uim-commit mailing list