summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/PYLibPinyin.cc14
-rw-r--r--src/PYLibPinyin.h4
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);