[uim-commit] r295 - in trunk/qt: quiminputcontextplugin/src
quiminputcontextplugin-qt4
kzk@freedesktop.org
kzk@freedesktop.org
Fri Jan 14 15:48:33 PST 2005
Author: kzk
Date: 2005-01-14 15:48:31 -0800 (Fri, 14 Jan 2005)
New Revision: 295
Modified:
trunk/qt/quiminputcontextplugin-qt4/quiminputcontext.cpp
trunk/qt/quiminputcontextplugin/src/quiminputcontext.cpp
Log:
* qt/quiminputcontextplugin/src/quiminputcontext.cpp
* qt/quiminputcontextplugin-qt4/quiminputcontext.cpp
- add check if displayLimit is 0
- remove candidate selection by number key support
because this function is implemented in uim scm
level.
Modified: trunk/qt/quiminputcontextplugin/src/quiminputcontext.cpp
===================================================================
--- trunk/qt/quiminputcontextplugin/src/quiminputcontext.cpp 2005-01-14 23:44:13 UTC (rev 294)
+++ trunk/qt/quiminputcontextplugin/src/quiminputcontext.cpp 2005-01-14 23:48:31 UTC (rev 295)
@@ -1,6 +1,6 @@
/*
-Copyright (c) 2003,2004 uim Project http://uim.freedesktop.org/
+Copyright (c) 2003,2004,2005 uim Project http://uim.freedesktop.org/
All rights reserved.
@@ -147,23 +147,6 @@
QKeyEvent *keyevent = ( QKeyEvent * ) event;
int qkey = keyevent->key();
- /* Handle Candwin Specific Key */
- if ( candwinIsActive && type == QEvent::KeyPress )
- {
- // Candidate Selection
- if ( Qt::Key_0 <= qkey && qkey <= Qt::Key_9 )
- {
- int selectedIndex = 0;
- if ( qkey == Qt::Key_0 )
- selectedIndex = 9;
- else
- selectedIndex = qkey - Qt::Key_0 - 1;
-
- cwin->setIndexInPage( selectedIndex );
- return TRUE;
- }
- }
-
int modifier = 0;
if ( keyevent->state() & Qt::ShiftButton )
modifier |= UMod_Shift;
@@ -284,7 +267,6 @@
uim_prop_list_update( m_uc );
uim_prop_label_update( m_uc );
-
uim_helper_client_focus_in( m_uc );
}
@@ -445,7 +427,8 @@
}
void QUimInputContext::clearPreedit()
{
- psegs.clear();
+ if( !psegs.isEmpty() )
+ psegs.clear();
}
void QUimInputContext::pushbackPreeditString( int attr, const QString& str )
@@ -578,7 +561,7 @@
uim_candidate cand;
for ( int i = 0; i < nr; i++ )
{
- cand = uim_get_candidate( m_uc, i, i % displayLimit );
+ cand = uim_get_candidate( m_uc, i, displayLimit ? i % displayLimit : i );
list.append( cand );
}
cwin->setCandidates( displayLimit, list );
Modified: trunk/qt/quiminputcontextplugin-qt4/quiminputcontext.cpp
===================================================================
--- trunk/qt/quiminputcontextplugin-qt4/quiminputcontext.cpp 2005-01-14 23:44:13 UTC (rev 294)
+++ trunk/qt/quiminputcontextplugin-qt4/quiminputcontext.cpp 2005-01-14 23:48:31 UTC (rev 295)
@@ -120,23 +120,6 @@
QKeyEvent *keyevent = ( QKeyEvent * ) event;
int qkey = keyevent->key();
- /* Handle Candwin Specific Key */
- if ( candwinIsActive && type == QEvent::KeyPress )
- {
- // Candidate Selection
- if ( Qt::Key_0 <= qkey && qkey <= Qt::Key_9 )
- {
- int selectedIndex = 0;
- if ( qkey == Qt::Key_0 )
- selectedIndex = 9;
- else
- selectedIndex = qkey - Qt::Key_0 - 1;
-
- cwin->setIndexInPage( selectedIndex );
- return TRUE;
- }
- }
-
int modifier = 0;
if ( keyevent->modifiers() & Qt::ShiftModifier )
modifier |= UMod_Shift;
@@ -570,7 +553,7 @@
uim_candidate cand;
for ( int i = 0; i < nr; i++ )
{
- cand = uim_get_candidate( m_uc, i, i % displayLimit );
+ cand = uim_get_candidate( m_uc, i, displayLimit ? i % displayLimit : i );
list.append( cand );
}
cwin->setCandidates( displayLimit, list );
More information about the Uim-commit
mailing list