[ibus-indic-table] Fixed bug bug-742852.patch
anish
anishpatil at fedoraproject.org
Mon Oct 3 09:35:40 UTC 2011
commit 15f0cdc601160aff8fdad2d2db4c9b21b0880903
Author: anish <anish at dhcp193-44.pnq.redhat.com>
Date: Mon Oct 3 15:05:24 2011 +0530
Fixed bug bug-742852.patch
bug-742852.patch | 150 +++++++++++++++++++++++++++++++++++++++++++++++++
ibus-indic-table.spec | 11 +++-
2 files changed, 158 insertions(+), 3 deletions(-)
---
diff --git a/bug-742852.patch b/bug-742852.patch
new file mode 100644
index 0000000..337d689
--- /dev/null
+++ b/bug-742852.patch
@@ -0,0 +1,150 @@
+Only in ibus-indic-table-1.3.1/engine: factory.pyc
+diff -rup ibus-indic-table-1.3.1-org/engine/indic_table.py ibus-indic-table-1.3.1/engine/indic_table.py
+--- ibus-indic-table-1.3.1-org/engine/indic_table.py 2011-09-30 18:18:14.407474939 +0530
++++ ibus-indic-table-1.3.1/engine/indic_table.py 2011-10-03 14:41:27.995697799 +0530
+@@ -95,6 +95,10 @@ class editor(object):
+ self._onechar = self._config.get_value (self._config_section, "OneChar", False)
+ # list used to keep chars when shift key is been pressed
+ self._k_list = []
++ # dict used to keep aux strings
++ self._ap_dict = {}
++ # list used to track caret chars after pressing space
++ self._caret_chars = []
+ # self._chinese_mode: the candidate filter mode,
+ # 0 is simplify Chinese
+ # 1 is traditional Chinese
+@@ -343,6 +347,24 @@ class editor(object):
+ return res
+ else:
+ return _candi
++
++ def get_strings (self):
++ '''Get strings'''
++ if self._candidates[0]:
++ if self._py_mode:
++ _p_index = 8
++ else:
++ _p_index = self.get_index ('phrase')
++ _candi = u'###' + self._candidates[0][ int (self._lookup_table.get_cursor_pos() ) ][ _p_index ] + u'###'
++ return _candi
++ else:
++ input_chars = self.get_input_chars ()
++ if input_chars:
++ _candi = u''.join( ['###'] + map( str, input_chars) + ['###'] )
++ else:
++ _candi = u''
++ return _candi
++
+ def add_caret (self, addstr):
+ '''add length to caret position'''
+ self._caret += len(addstr)
+@@ -470,6 +492,7 @@ class editor(object):
+ # this is a system phrase haven't been used:
+ attrs.append ( ibus.AttributeForeground (0x000000, 0, len(_phrase)) )
+ self._lookup_table.append_candidate ( ibus.Text(_phrase + _tbks, attrs) )
++ self._ap_dict[_phrase] = _tbks
+ self._lookup_table.show_cursor (False)
+
+ def filter_candidates (self, candidates):
+@@ -790,6 +813,22 @@ class editor(object):
+ '''Process Left Shift Key Event as immediately commit to preedit strings'''
+ if self._chars[0]:
+ self._k_list.extend( self._tabkey_list)
++ _ic = self.get_strings ()
++ if _ic:
++ res = patt_edit.match (_ic)
++ if res:
++ _ic = u''
++ ures = patt_uncommit.match (res.group(1))
++ if ures:
++ _ic = u''.join (ures.groups())
++ else:
++ _ic += res.group (1)
++ _ic += res.group(2)
++ _ic += res.group(3)
++ if _ic in self._ap_dict:
++ _ic = self._ap_dict[_ic]
++ for _char_ic in _ic:
++ self._k_list.extend(self._parser(_char_ic))
+ self.commit_to_preedit ()
+ return True
+ else:
+@@ -810,6 +849,22 @@ class editor(object):
+ # we have invalid input, so do not commit
+ return (False,u'')
+ if self._t_chars :
++ _ic = self.get_strings ()
++ if _ic:
++ res = patt_edit.match (_ic)
++ if res:
++ _ic = u''
++ ures = patt_uncommit.match (res.group(1))
++ if ures:
++ _ic = u''.join (ures.groups())
++ else:
++ _ic += res.group (1)
++ _ic += res.group(2)
++ _ic += res.group(3)
++ if _ic in self._ap_dict:
++ _ic = self._ap_dict[_ic]
++ for _char_ic in _ic:
++ self._caret_chars.extend(_char_ic)
+ # user has input sth
+ istr = self.get_all_input_strings ()
+ self.commit_to_preedit ()
+@@ -843,8 +898,12 @@ class tabengine (ibus.EngineBase):
+ super(tabengine,self).__init__ (bus,obj_path)
+ self._bus = bus
+ self.db = db
++
++ try:
++ tabengine._page_size = int(self.db.get_ime_property('page_size'))
++ except:
++ tabengine._page_size = 6
+
+- tabengine._page_size = int(self.db.get_ime_property('page_size'))
+ if tabengine._page_size > 15:
+ tabengine._page_size = 6
+
+@@ -1157,7 +1216,20 @@ class tabengine (ibus.EngineBase):
+
+ def _update_aux (self):
+ '''Update Aux String in UI'''
+- _ic = self._editor.get_aux_strings ()
++ _ic = self._editor.get_strings ()
++ if _ic:
++ res = patt_edit.match (_ic)
++ if res:
++ _ic = u''
++ ures = patt_uncommit.match (res.group(1))
++ if ures:
++ _ic = u''.join (ures.groups())
++ else:
++ _ic += res.group (1)
++ _ic += res.group(2)
++ _ic += res.group(3)
++ if _ic in self._editor._ap_dict:
++ _ic = self._editor.get_aux_strings()+self._editor._ap_dict[_ic]
+ if _ic:
+ attrs = ibus.AttrList([ ibus.AttributeForeground(0x9515b5,0, len(_ic)) ])
+ #attrs = [ scim.Attribute(0,len(_ic),scim.ATTR_FOREGROUND,0x5540c1)]
+@@ -1459,8 +1531,14 @@ class tabengine (ibus.EngineBase):
+ if sp_res[2]:
+ alphabates.extend(sp_res[2])
+ str_alphabates = ''.join(alphabates)
+- self.db.check_phrase (sp_res[1], str_alphabates)
+- self._editor._k_list=[]
++ caret_alphabates = ''.join(self._editor._caret_chars)
++ if caret_alphabates:
++ new_str_alphabates = str_alphabates + caret_alphabates
++ self.db.check_phrase (sp_res[1], new_str_alphabates)
++ else:
++ self.db.check_phrase (sp_res[1], str_alphabates)
++ self._editor._k_list = []
++ self._editor._caret_chars = []
+ # self.db.check_phrase (sp_res[1], sp_res[2])
+ else:
+ if sp_res[1] == u' ':
+Only in ibus-indic-table-1.3.1/engine: indic_table.pyc
+Only in ibus-indic-table-1.3.1/engine: tabdict.pyc
+Only in ibus-indic-table-1.3.1/engine: tabsqlitedb.pyc
diff --git a/ibus-indic-table.spec b/ibus-indic-table.spec
index b5e3d11..01cf3b5 100644
--- a/ibus-indic-table.spec
+++ b/ibus-indic-table.spec
@@ -1,6 +1,6 @@
Name: ibus-indic-table
Version: 1.3.1
-Release: 7%{?dist}
+Release: 8%{?dist}
Summary: The Table engine for IBus platform
License: LGPLv2+
Group: System Environment/Libraries
@@ -11,6 +11,7 @@ Patch1: bug-703124.patch
Patch2: bug-683826-683743.patch
Patch3: bug-741176.patch
Patch4: bug-741176-minor-symbol.patch
+Patch5: bug-742852.patch
Requires: ibus
BuildRequires: ibus-devel
BuildArch: noarch
@@ -25,6 +26,7 @@ The Indic Table engine for IBus platform.
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
%build
%configure --disable-static --disable-additional
@@ -45,11 +47,14 @@ make DESTDIR=${RPM_BUILD_ROOT} NO_INDEX=true install pkgconfigdir=%{_datadir}/pk
%{_datadir}/pkgconfig/%{name}.pc
%changelog
+* Mon Oct 03 2011 Anish Patil <apatil at redhat.com> - 1.3.1-8
+- Fixed the bug 742852
+
* Fri Sep 30 2011 Anish Patil <apatil at redhat.com> - 1.3.1-7
- Added patch in spec file
+- Added patch in spec file
* Fri Sep 30 2011 Anish Patil <apatil at redhat.com> - 1.3.1-6
- Resolves bug #741176 added unicode support for localized string
+- Resolves bug #741176 added unicode support for localized string
* Mon Sep 26 2011 Anish Patil <apatil at redhat.com> - 1.3.1-5
- reolves bug #741176
More information about the scm-commits
mailing list