summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-01-27 15:09:04 +0800
committerPeng Wu <alexepico@gmail.com>2015-01-27 15:09:04 +0800
commit37ec389207a5a9764df6f668ae7a0ff265cd116a (patch)
tree937a3a10be2b0c84eb05574955104da088738e3f
parent2445fbdb8f5f8300d3670249fbf6095a72c343b5 (diff)
downloadibus-libpinyin-37ec389207a5a9764df6f668ae7a0ff265cd116a.tar.gz
ibus-libpinyin-37ec389207a5a9764df6f668ae7a0ff265cd116a.tar.xz
ibus-libpinyin-37ec389207a5a9764df6f668ae7a0ff265cd116a.zip
update class LibPinyinConfig to support export user phrases
-rw-r--r--src/PYPConfig.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
index c9d2194..ff897ea 100644
--- a/src/PYPConfig.cc
+++ b/src/PYPConfig.cc
@@ -53,6 +53,7 @@ const gchar * const CONFIG_AUXILIARY_SELECT_KEY_F = "AuxiliarySelectKey_F";
const gchar * const CONFIG_AUXILIARY_SELECT_KEY_KP = "AuxiliarySelectKey_KP";
const gchar * const CONFIG_ENTER_KEY = "EnterKey";
const gchar * const CONFIG_IMPORT_DICTIONARY = "ImportDictionary";
+const gchar * const CONFIG_EXPORT_DICTIONARY = "ExportDictionary";
const gchar * const CONFIG_CLEAR_USER_DATA = "ClearUserData";
/* const gchar * const CONFIG_CTRL_SWITCH = "CtrlSwitch"; */
const gchar * const CONFIG_MAIN_SWITCH = "MainSwitch";
@@ -150,6 +151,9 @@ LibPinyinConfig::readDefaultValues (void)
if (0 == strcmp(CONFIG_IMPORT_DICTIONARY, name))
continue;
+ if (0 == strcmp(CONFIG_EXPORT_DICTIONARY, name))
+ continue;
+
if (0 == strcmp(CONFIG_CLEAR_USER_DATA, name))
continue;
@@ -420,7 +424,11 @@ PinyinConfig::valueChanged (const std::string &section,
m_auto_commit = normalizeGVariant (value, false);
else if (CONFIG_IMPORT_DICTIONARY == name) {
std::string filename = normalizeGVariant (value, std::string(""));
- LibPinyinBackEnd::instance ().importPinyinDictionary(filename.c_str ());
+ LibPinyinBackEnd::instance ().importPinyinDictionary (filename.c_str ());
+ }
+ else if (CONFIG_EXPORT_DICTIONARY == name) {
+ std::string filename = normalizeGVariant (value, std::string(""));
+ LibPinyinBackEnd::instance ().exportPinyinDictionary (filename.c_str ());
}
else if (CONFIG_CLEAR_USER_DATA == name) {
std::string target = normalizeGVariant (value, std::string(""));