diff options
author | Peng Wu <alexepico@gmail.com> | 2012-08-08 16:26:17 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-08-08 16:26:17 +0800 |
commit | 2249b3cbdb13c3465b03b55e74eeea85f8612dcc (patch) | |
tree | ed91f1448a75c4c8ff40afbf33dbcfc65f6e0e08 /src | |
parent | 4a830d6660e877fd879e9b4ae55c4fda9a2087aa (diff) | |
download | ibus-libpinyin-2249b3cbdb13c3465b03b55e74eeea85f8612dcc.tar.gz ibus-libpinyin-2249b3cbdb13c3465b03b55e74eeea85f8612dcc.tar.bz2 ibus-libpinyin-2249b3cbdb13c3465b03b55e74eeea85f8612dcc.zip |
update PYLibPinyin.*
Diffstat (limited to 'src')
-rw-r--r-- | src/PYLibPinyin.cc | 14 | ||||
-rw-r--r-- | src/PYLibPinyin.h | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/PYLibPinyin.cc b/src/PYLibPinyin.cc index 27d1ad5..293bd0b 100644 --- a/src/PYLibPinyin.cc +++ b/src/PYLibPinyin.cc @@ -54,7 +54,7 @@ LibPinyinBackEnd::~LibPinyinBackEnd () { } pinyin_context_t * -LibPinyinBackEnd::initPinyinContext () +LibPinyinBackEnd::initPinyinContext (Config *config) { pinyin_context_t * context = NULL; @@ -78,11 +78,12 @@ LibPinyinBackEnd::initPinyinContext () pinyin_instance_t * LibPinyinBackEnd::allocPinyinInstance () { + Config * config = &LibPinyinPinyinConfig::instance (); if (NULL == m_pinyin_context) { - m_pinyin_context = initPinyinContext (); + m_pinyin_context = initPinyinContext (config); } - setPinyinOptions (&LibPinyinPinyinConfig::instance ()); + setPinyinOptions (config); return pinyin_alloc_instance (m_pinyin_context); } @@ -93,7 +94,7 @@ LibPinyinBackEnd::freePinyinInstance (pinyin_instance_t *instance) } pinyin_context_t * -LibPinyinBackEnd::initChewingContext () +LibPinyinBackEnd::initChewingContext (Config *config) { pinyin_context_t * context = NULL; @@ -117,11 +118,12 @@ LibPinyinBackEnd::initChewingContext () pinyin_instance_t * LibPinyinBackEnd::allocChewingInstance () { + Config *config = &LibPinyinBopomofoConfig::instance (); if (NULL == m_chewing_context) { - m_chewing_context = initChewingContext (); + m_chewing_context = initChewingContext (config); } - setChewingOptions (&LibPinyinBopomofoConfig::instance ()); + setChewingOptions (config); return pinyin_alloc_instance (m_chewing_context); } diff --git a/src/PYLibPinyin.h b/src/PYLibPinyin.h index 1dba971..e1d1803 100644 --- a/src/PYLibPinyin.h +++ b/src/PYLibPinyin.h @@ -41,8 +41,8 @@ public: gboolean setPinyinOptions (Config *config); gboolean setChewingOptions (Config *config); - pinyin_context_t * initPinyinContext (); - pinyin_context_t * initChewingContext (); + pinyin_context_t * initPinyinContext (Config *config); + pinyin_context_t * initChewingContext (Config *config); pinyin_instance_t *allocPinyinInstance (); void freePinyinInstance (pinyin_instance_t *instance); |