[uim-commit] r541 - trunk/qt

kzk at freedesktop.org kzk at freedesktop.org
Sat Feb 5 00:34:04 PST 2005


Author: kzk
Date: 2005-02-05 00:34:02 -0800 (Sat, 05 Feb 2005)
New Revision: 541

Modified:
   trunk/qt/immodule-plugin.cpp
   trunk/qt/pref-customwidgets.h
Log:
* qt/immodule-plugin.cpp
  - register only "uim" as plugin (exclude "uim-anthy", "uim-prime", etc.)
* qt/pref-customwidgtes.h
  - forgot to commit...


Modified: trunk/qt/immodule-plugin.cpp
===================================================================
--- trunk/qt/immodule-plugin.cpp	2005-02-05 08:18:05 UTC (rev 540)
+++ trunk/qt/immodule-plugin.cpp	2005-02-05 08:34:02 UTC (rev 541)
@@ -56,26 +56,31 @@
 
     QStringList keys() const
     {
-        return createImList();
+        QStringList imList;
+        imList << "uim";
+        return imList;
     }
 
     QInputContext *create( const QString &key )
     {
         QString imname = QString::null;
         if ( QString::compare( key, "uim" ) == 0 )
+        {
             imname = uim_get_default_im_name( setlocale( LC_ALL, NULL ) );
-        else
-            imname = key.mid( 4 );
+            QStringList langs = languages( "uim" );
+            QUimInputContext *uic = new QUimInputContextWithSlave( imname, langs[ 0 ] );
+            return uic;
+        }
 
-        QStringList langs = createLanguageList( key );
-        QUimInputContext *uic = new QUimInputContextWithSlave( imname, langs[ 0 ] );
-
-        return uic;
+        return NULL;
     }
 
     QStringList languages( const QString &key )
     {
-        return createLanguageList( key );
+        if ( key == QString( "uim" ) )
+            return "ja:ko:zh:*";
+
+        return QStringList();
     }
 
     QString displayName( const QString &key )
@@ -85,16 +90,13 @@
 
     QString description( const QString &key )
     {
-        return displayName( key ) + ": an input method provided via the uim input method framework";
+        return displayName( key ) + ": the universal input method framework";
     }
 
 protected:
     void uimInit();
     void uimQuit();
 
-    QStringList createImList() const;
-    QStringList createLanguageList( const QString &key ) const;
-
     bool uimReady;
 };
 
@@ -113,61 +115,4 @@
     }
 }
 
-QStringList UimInputContextPlugin::createImList() const
-{
-    QStringList lst;
-
-    // default
-    lst.append( "uim" );
-
-    uim_context tmp_uc = uim_create_context( NULL, "UTF-8",
-                         NULL, NULL, uim_iconv, NULL );
-    int nr = uim_get_nr_im( tmp_uc );
-    if ( uimReady )
-    {
-        for ( int i = 0; i < nr; i++ )
-        {
-            const char *name = uim_get_im_name( tmp_uc, i );
-            QString qs( name );
-            qs = "uim-" + qs;
-            lst << qs;
-
-#ifdef ENABLE_DEBUG
-            qDebug( "name = %s", name );
-#endif
-        }
-    }
-    uim_release_context( tmp_uc );
-
-    return lst;
-}
-
-QStringList UimInputContextPlugin::createLanguageList( const QString &key ) const
-{
-    if ( key == QString( "uim" ) )
-        return "ja:ko:zh:*";
-
-    uim_context tmp_uc = uim_create_context( NULL, "UTF-8",
-                         NULL, NULL, uim_iconv, NULL );
-    int nr = uim_get_nr_im( tmp_uc );
-    if ( uimReady )
-    {
-        for ( int i = 0; i < nr; i++ )
-        {
-            const char *name = uim_get_im_name( tmp_uc, i );
-            const char *lang = uim_get_im_language( tmp_uc, i );
-
-            if ( key == QString( "uim-" ) + name )
-            {
-                // ":" separated languages for future extension
-                QStringList langs = QStringList::split( ":", lang );
-                return langs;
-            }
-        }
-    }
-    uim_release_context( tmp_uc );
-
-    return QStringList();
-}
-
 Q_EXPORT_PLUGIN( UimInputContextPlugin )

Modified: trunk/qt/pref-customwidgets.h
===================================================================
--- trunk/qt/pref-customwidgets.h	2005-02-05 08:18:05 UTC (rev 540)
+++ trunk/qt/pref-customwidgets.h	2005-02-05 08:34:02 UTC (rev 541)
@@ -291,6 +291,7 @@
 
 protected:
     virtual void keyPressEvent( QKeyEvent *e );
+    virtual bool eventFilter( QObject * watched, QEvent * e );
 
 protected:
     QString m_keystr;



More information about the Uim-commit mailing list