diff options
| author | Peng Wu <alexepico@gmail.com> | 2020-11-23 10:58:22 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2020-11-23 10:58:22 +0800 |
| commit | 9b00002f464bc66c55bcfeaf2ab0e1ca5e2a4f1e (patch) | |
| tree | 4a307c8a1679218849adf2fe6ed5ac223360e3ae /src | |
| parent | a7a048ecf430664711c26f7fedca4470adb0fcc0 (diff) | |
Fixes import/export pinyin dictionary
Diffstat (limited to 'src')
| -rw-r--r-- | src/PYPConfig.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc index 24e5828..6cf5b33 100644 --- a/src/PYPConfig.cc +++ b/src/PYPConfig.cc @@ -608,11 +608,13 @@ PinyinConfig::valueChanged (const std::string &schema_id, 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 ()); + if (!filename.empty ()) + 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 ()); + if (!filename.empty ()) + LibPinyinBackEnd::instance ().exportPinyinDictionary (filename.c_str ()); } else if (CONFIG_CLEAR_USER_DATA == name) { std::string target = normalizeGVariant (value, std::string("")); |
