[uim-commit] r239 - in trunk: helper qt/uim-kdehelper/src/candwin

ekato@freedesktop.org ekato@freedesktop.org
Mon Jan 10 19:07:37 PST 2005


Author: ekato
Date: 2005-01-10 19:07:34 -0800 (Mon, 10 Jan 2005)
New Revision: 239

Modified:
   trunk/helper/helper-candwin-gtk.c
   trunk/qt/uim-kdehelper/src/candwin/uim-candwin-qt.cpp
Log:
* helper/helper-candwin-gtk.c (candwin_active) : Split candidate
  line with "\t" into only 2 segment since prime may return
  candidate string containing tab.
* qt/uim-kdehelper/src/candwin/uim-candwin-qt.cpp
  (CandidateWindow::activeCand) : Ditto.


Modified: trunk/helper/helper-candwin-gtk.c
===================================================================
--- trunk/helper/helper-candwin-gtk.c	2005-01-10 23:44:27 UTC (rev 238)
+++ trunk/helper/helper-candwin-gtk.c	2005-01-11 03:07:34 UTC (rev 239)
@@ -449,7 +449,7 @@
       GtkTreeIter ti;
       if (node) {
 	gchar *str = node->data;
-	gchar **column = g_strsplit(str, "\t", 0);
+	gchar **column = g_strsplit(str, "\t", 2);
 	gtk_list_store_append(store, &ti);
 	gtk_list_store_set(store, &ti,
 			   COLUMN_HEADING, column[0],

Modified: trunk/qt/uim-kdehelper/src/candwin/uim-candwin-qt.cpp
===================================================================
--- trunk/qt/uim-kdehelper/src/candwin/uim-candwin-qt.cpp	2005-01-10 23:44:27 UTC (rev 238)
+++ trunk/qt/uim-kdehelper/src/candwin/uim-candwin-qt.cpp	2005-01-11 03:07:34 UTC (rev 239)
@@ -137,7 +137,7 @@
             break;
 
         // split heading_label and cand_str
-        const QStringList l = QStringList::split( "\t", list [ i ] );
+        QStringList l = QStringList::split( "\t", list [ i ], true );
 
         // store data
         CandData d;
@@ -153,10 +153,16 @@
 
         d.label = headString;
 
+	// XXX Current prime (0.4.6) may return candidate string
+	// containing "\t", and we can't handle annotation in another
+	// window yet.
+	l.pop_front();
+	QString candString = l.join( "\t" );
+
         if ( codec )
-            d.str = codec->toUnicode( l [ 1 ] );
+            d.str = codec->toUnicode( candString );
         else
-            d.str = l [ 1 ];
+            d.str = candString;
 
         stores.append( d );
     }



More information about the Uim-commit mailing list