summaryrefslogtreecommitdiffstats
path: root/src/PYPConfig.cc
diff options
context:
space:
mode:
authorMarcin Mielniczuk <marmistrz.dev@zoho.eu>2018-12-27 16:56:18 +0100
committerPeng Wu <alexepico@gmail.com>2019-01-03 13:53:03 +0800
commit42b2a4c1fbef71dadc97d0a820d96db977393495 (patch)
tree10c1c959565f1971110f5ec9a79dbabbf4854f5a /src/PYPConfig.cc
parentdd4699124dbaacf5119092d82c090917b78a5f1a (diff)
downloadibus-libpinyin-42b2a4c1fbef71dadc97d0a820d96db977393495.tar.gz
ibus-libpinyin-42b2a4c1fbef71dadc97d0a820d96db977393495.tar.xz
ibus-libpinyin-42b2a4c1fbef71dadc97d0a820d96db977393495.zip
Support configurable opencc config
Diffstat (limited to 'src/PYPConfig.cc')
-rw-r--r--src/PYPConfig.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
index a0f2d76..e7165e1 100644
--- a/src/PYPConfig.cc
+++ b/src/PYPConfig.cc
@@ -48,6 +48,7 @@ const gchar * const CONFIG_INIT_FULL_PUNCT = "init-full-punct";
const gchar * const CONFIG_INIT_SIMP_CHINESE = "init-simplified-chinese";
const gchar * const CONFIG_DICTIONARIES = "dictionaries";
const gchar * const CONFIG_LUA_CONVERTER = "lua-converter";
+const gchar * const CONFIG_OPENCC_CONFIG = "opencc-config";
const gchar * const CONFIG_BOPOMOFO_KEYBOARD_MAPPING = "bopomofo-keyboard-mapping";
const gchar * const CONFIG_SELECT_KEYS = "select-keys";
const gchar * const CONFIG_GUIDE_KEY = "guide-key";
@@ -118,6 +119,7 @@ LibPinyinConfig::initDefaultValues (void)
m_dictionaries = "";
m_lua_converter = "";
+ m_opencc_config = "s2t.json";
m_main_switch = "<Shift>";
m_letter_switch = "";
@@ -400,6 +402,7 @@ PinyinConfig::readDefaultValues (void)
m_minus_equal_page = read (CONFIG_MINUS_EQUAL_PAGE, true);
m_comma_period_page = read (CONFIG_COMMA_PERIOD_PAGE, true);
m_auto_commit = read (CONFIG_AUTO_COMMIT, false);
+ m_opencc_config = read (CONFIG_OPENCC_CONFIG, "s2t.json");
/* lua */
m_lua_converter = read (CONFIG_LUA_CONVERTER, "");
@@ -464,6 +467,8 @@ PinyinConfig::valueChanged (const std::string &schema_id,
m_comma_period_page = normalizeGVariant (value, true);
else if (CONFIG_LUA_CONVERTER == name)
m_lua_converter = normalizeGVariant (value, std::string (""));
+ else if (CONFIG_OPENCC_CONFIG == name)
+ m_opencc_config = normalizeGVariant (value, std::string (""));
else if (CONFIG_AUTO_COMMIT == name)
m_auto_commit = normalizeGVariant (value, false);
else if (CONFIG_IMPORT_DICTIONARY == name) {