[uim-commit] r2539 - in branches/1.0: fep helper qt uim

ekato at freedesktop.org ekato at freedesktop.org
Sun Dec 11 23:36:34 PST 2005


Author: ekato
Date: 2005-12-11 23:36:18 -0800 (Sun, 11 Dec 2005)
New Revision: 2539

Modified:
   branches/1.0/fep/str.c
   branches/1.0/fep/udsock.c
   branches/1.0/fep/uim-fep.c
   branches/1.0/helper/dict-main-gtk.c
   branches/1.0/helper/dict-word-list-win-gtk.c
   branches/1.0/helper/helper-candwin-gtk.c
   branches/1.0/helper/im-switcher-gtk.c
   branches/1.0/qt/pref-qt.cpp
   branches/1.0/uim/agent.c
   branches/1.0/uim/intl.c
   branches/1.0/uim/slib.c
   branches/1.0/uim/uim-module-manager.c
Log:
* qt/pref-qt.cpp
* fep/uim-fep.c
* fep/str.c
* fep/udsock.c
* helper/dict-word-list-win-gtk.c
* helper/im-switcher-gtk.c
* helper/helper-candwin-gtk.c
* helper/dict-main-gtk.c
* uim/agent.c
* uim/intl.c
* uim/uim-module-manager.c
* uim/slib.c
  - Port r2532, 2533, and 2538 from trunk.


Modified: branches/1.0/fep/str.c
===================================================================
--- branches/1.0/fep/str.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/fep/str.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -73,7 +73,7 @@
 {
   if (setlocale(LC_CTYPE, "") == NULL) {
     printf("locale not supported\n");
-    exit(1);
+    exit(EXIT_FAILURE);
   }
   s_utf8 = (strcasecmp(get_enc(), "UTF-8") == 0 || strcasecmp(get_enc(), "UTF8") == 0);
 }

Modified: branches/1.0/fep/udsock.c
===================================================================
--- branches/1.0/fep/udsock.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/fep/udsock.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -118,7 +118,7 @@
   strncpy(s_servaddr.sun_path, sock_path, UNIX_PATH_MAX - 1);
   if (bind(s_recv_sockfd, (struct sockaddr *)&s_servaddr, sizeof(s_servaddr)) < 0) {
     perror(sock_path);
-    exit(1);
+    exit(EXIT_FAILURE);
   }
   chmod(sock_path, S_IRUSR|S_IWUSR);
 }

Modified: branches/1.0/fep/uim-fep.c
===================================================================
--- branches/1.0/fep/uim-fep.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/fep/uim-fep.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -203,7 +203,7 @@
   if (i == nr) {
     printf("%s is not a input method\n\n", engine);
     usage();
-    exit(1);
+    exit(EXIT_FAILURE);
   }
 }
 

Modified: branches/1.0/helper/dict-main-gtk.c
===================================================================
--- branches/1.0/helper/dict-main-gtk.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/helper/dict-main-gtk.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -224,7 +224,7 @@
 
   if (result == -1) {
     g_printerr(_("Error:%s\n"), get_error_msg());
-    exit(-1);
+    exit(EXIT_FAILURE);
   }
 
   /* connect to uim helper message bus */

Modified: branches/1.0/helper/dict-word-list-win-gtk.c
===================================================================
--- branches/1.0/helper/dict-word-list-win-gtk.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/helper/dict-word-list-win-gtk.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -272,7 +272,7 @@
   dict = uim_dict_open(N_("Anthy private dictionary"));
   if (!dict) {
     warn_dict_open();
-    exit(1);
+    exit(EXIT_FAILURE);
   }
 #endif
   word_list_view_set_dict(WORD_LIST_VIEW(word_list), dict);

Modified: branches/1.0/helper/helper-candwin-gtk.c
===================================================================
--- branches/1.0/helper/helper-candwin-gtk.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/helper/helper-candwin-gtk.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -586,7 +586,7 @@
     n = read(fd, buf, CANDIDATE_BUFFER_SIZE - 1);
     if (n == 0) {
       close(fd);
-      exit(-1);
+      exit(EXIT_FAILURE);
     }
     if (n == -1)
       return TRUE;

Modified: branches/1.0/helper/im-switcher-gtk.c
===================================================================
--- branches/1.0/helper/im-switcher-gtk.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/helper/im-switcher-gtk.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -536,7 +536,7 @@
 
   if (result == -1) {
     fprintf(stderr, "Error:%s\n", get_error_msg());
-    exit(-1);
+    exit(EXIT_FAILURE);
   }
 
   /* connect to uim helper message bus */

Modified: branches/1.0/qt/pref-qt.cpp
===================================================================
--- branches/1.0/qt/pref-qt.cpp	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/qt/pref-qt.cpp	2005-12-12 07:36:18 UTC (rev 2539)
@@ -107,13 +107,13 @@
                         "This file will override all conflicted settings set by\n"
                         "this tool (stored in ~/.uim.d/customs/*.scm).\n"
                         "Please check the file if you find your settings aren't applied.");
+
         QConfirmDialog *d = new QConfirmDialog( msg,
                                                 "/uim/qt/warnDotUim",
                                                 this );
         d->setCaption( _("~/.uim exists!") );
         d->exec();
-        // To avoid crashes... --ekato 2005.02.25
-        //delete d;
+        delete d;            
     }
 }
 
@@ -335,30 +335,25 @@
 
 void QConfirmDialog::setupWidgets( const QString&msg )
 {
-    QVBoxLayout *vbox = new QVBoxLayout( this );
-    vbox->setSpacing( 6 );
-    vbox->setMargin( 6 );
-
+    QVBoxLayout *vLayout = new QVBoxLayout( this );
+    vLayout->setSpacing( 6 );
+    vLayout->setMargin( 6 );
     QLabel *msgLabel = new QLabel( msg, this );
     KSeparator *sep = new KSeparator( this );
+    vLayout->addWidget( msgLabel );
+    vLayout->addWidget( sep );
 
-    QHBoxLayout *buttonHBox = new QHBoxLayout(vbox, 4);
-
+    QHBoxLayout *buttonHLayout = new QHBoxLayout( vLayout );
     QCheckBox *checkBox = new QCheckBox( _("Show this dialog on startup"), this );
     QSettings settings;
     bool isWarnDotUim = settings.readBoolEntry( m_confname, true );
     checkBox->setChecked( isWarnDotUim );
-
     QPushButton *ok = new QPushButton( _("OK"), this );
     ok->setDefault(true);
-    buttonHBox->addWidget( checkBox );
-    buttonHBox->addStretch();
-    buttonHBox->addWidget( ok );
+    buttonHLayout->addWidget( checkBox );
+    buttonHLayout->addStretch();    
+    buttonHLayout->addWidget( ok );
 
-    vbox->addWidget( msgLabel );
-    vbox->addWidget( sep );
-    vbox->addLayout( buttonHBox );
-
     QObject::connect( ok, SIGNAL(clicked()),
                       this, SLOT(accept()) );
     QObject::connect( checkBox, SIGNAL(toggled(bool)),

Modified: branches/1.0/uim/agent.c
===================================================================
--- branches/1.0/uim/agent.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/uim/agent.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -72,7 +72,7 @@
   int i, nr;
   if (uim_init() == -1) {
     printf("failed to init\n");
-    exit(0);
+    exit(EXIT_FAILURE);
   }
   /**/
   uc =uim_create_context(&default_context,

Modified: branches/1.0/uim/intl.c
===================================================================
--- branches/1.0/uim/intl.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/uim/intl.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -40,7 +40,6 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include "config.h"
 #ifdef ENABLE_NLS
 #include <locale.h>
 #endif

Modified: branches/1.0/uim/slib.c
===================================================================
--- branches/1.0/uim/slib.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/uim/slib.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -511,7 +511,7 @@
   if (fatal_exit_hook)
     (*fatal_exit_hook) ();
   else
-    exit (1);
+    exit (EXIT_FAILURE);
   return (NIL);
 }
 

Modified: branches/1.0/uim/uim-module-manager.c
===================================================================
--- branches/1.0/uim/uim-module-manager.c	2005-12-12 07:31:35 UTC (rev 2538)
+++ branches/1.0/uim/uim-module-manager.c	2005-12-12 07:36:18 UTC (rev 2539)
@@ -225,8 +225,10 @@
   uim_scm_init_subr_1("write-loader.scm", write_loader_scm);
   uim_scm_init_subr_1("write-installed-modules.scm", write_installed_modules_scm);
 
-  if (!uim_scm_require_file("uim-module-manager.scm"))
-    exit(1);
+  if (!uim_scm_require_file("uim-module-manager.scm")) {
+    perror("failed to require uim-module-manager.scm");
+    exit(EXIT_FAILURE);
+  }
 
   if (path) {
     char *extra_file = concat(path, "/installed-modules.scm");



More information about the uim-commit mailing list