[uim-commit] r360 - in trunk: helper qt/uim-kdehelper/src/pref

yamaken@freedesktop.org yamaken@freedesktop.org
Wed Jan 26 09:56:37 PST 2005


Author: yamaken
Date: 2005-01-26 09:56:32 -0800 (Wed, 26 Jan 2005)
New Revision: 360

Modified:
   trunk/helper/pref-gtk.c
   trunk/qt/uim-kdehelper/src/pref/uim-pref-qt.cpp
Log:
* qt/uim-kdehelper/src/pref/uim-pref-qt.cpp
  - (UimPrefDialog::UimPrefDialog): Add error handling around
    uim_custom_enable(). uim-pref-qt should abort execution if the
    initialization failed. uim_init() should also be treated as same
    way

* helper/pref-gtk.c
  - (main): Add error handlings around uim_init() and
    uim_custom_enable()


Modified: trunk/helper/pref-gtk.c
===================================================================
--- trunk/helper/pref-gtk.c	2005-01-26 17:21:41 UTC (rev 359)
+++ trunk/helper/pref-gtk.c	2005-01-26 17:56:32 UTC (rev 360)
@@ -1936,8 +1936,6 @@
 int 
 main (int argc, char *argv[])
 {
-  GtkWidget *pref;
-  
   setlocale(LC_ALL, "");
   bindtextdomain(PACKAGE, LOCALEDIR);
   textdomain(PACKAGE);
@@ -1947,14 +1945,24 @@
   
   gtk_init(&argc, &argv);
 
-  uim_init();
-  uim_custom_enable();  
+  if (uim_init() < 0) {
+    fprintf(stderr, "uim_init() failed.\n");
+    return -1;
+  }
 
-  pref = create_pref_window();
+  if (uim_custom_enable()) {
+    GtkWidget *pref;
+  
+    pref = create_pref_window();
 
-  gtk_widget_show_all(pref);
+    gtk_widget_show_all(pref);
 
-  gtk_main();
+    gtk_main();
+  } else {
+    fprintf(stderr, "uim_custom_enable() failed.\n");
+    uim_quit();
+    return -1;
+  }
 
   uim_quit();
 

Modified: trunk/qt/uim-kdehelper/src/pref/uim-pref-qt.cpp
===================================================================
--- trunk/qt/uim-kdehelper/src/pref/uim-pref-qt.cpp	2005-01-26 17:21:41 UTC (rev 359)
+++ trunk/qt/uim-kdehelper/src/pref/uim-pref-qt.cpp	2005-01-26 17:56:32 UTC (rev 360)
@@ -68,9 +68,11 @@
       m_isValueChanged( false )
 {
     uim_init();
-    uim_custom_enable();
-
-    setupWidgets();
+    if (uim_custom_enable()) {
+      setupWidgets();
+    } else {
+      qDebug("uim_custom_enable() failed.");
+    }
 }
 
 UimPrefDialog::~UimPrefDialog()



More information about the Uim-commit mailing list