summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2010-06-05 07:38:04 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2010-06-05 07:38:04 +0800
commit77d9c68257fbc8de007b1524239d9bdb39346655 (patch)
tree355d3ce1ebfb0b41ccd07fc9aad71b43e1b2a788
parent52442871862a6558cf616601b97c7bd57d00d12a (diff)
downloadibus-libpinyin-77d9c68257fbc8de007b1524239d9bdb39346655.tar.gz
ibus-libpinyin-77d9c68257fbc8de007b1524239d9bdb39346655.tar.xz
ibus-libpinyin-77d9c68257fbc8de007b1524239d9bdb39346655.zip
Fix some build warning and verify some config item.
-rw-r--r--src/Bopomofo.h12
-rw-r--r--src/BopomofoEditor.cc14
-rw-r--r--src/Config.cc5
3 files changed, 16 insertions, 15 deletions
diff --git a/src/Bopomofo.h b/src/Bopomofo.h
index ef278c3..abd9813 100644
--- a/src/Bopomofo.h
+++ b/src/Bopomofo.h
@@ -77,16 +77,4 @@ const static wchar_t bopomofo_char[] = {
L'ˊ', L'ˇ', L'ˋ', L'˙',
};
-const static gchar * bopomofo_select_keys[] = {
- "1234567890",
- "asdfghjkl;",
- "1qaz2wsxed",
- "asdfzxcvgb",
- "1234qweras",
- "aoeu;qjkix",
- "aoeuhtnsid",
- "aoeuidhtns",
- "qweasdzxcr"
-};
-
#endif /* __PY_BOPOMOFO_H_ */
diff --git a/src/BopomofoEditor.cc b/src/BopomofoEditor.cc
index 621cfd4..e6b9c25 100644
--- a/src/BopomofoEditor.cc
+++ b/src/BopomofoEditor.cc
@@ -25,10 +25,20 @@
#include "SimpTradConverter.h"
namespace PY {
-
-#include "Bopomofo.h"
#include "BopomofoKeyboard.h"
+const static gchar * bopomofo_select_keys[] = {
+ "1234567890",
+ "asdfghjkl;",
+ "1qaz2wsxed",
+ "asdfzxcvgb",
+ "1234qweras",
+ "aoeu;qjkix",
+ "aoeuhtnsid",
+ "aoeuidhtns",
+ "qweasdzxcr"
+};
+
BopomofoEditor::BopomofoEditor (PinyinProperties & props, Config & config)
: PhoneticEditor (props, config),
m_select_mode (FALSE)
diff --git a/src/Config.cc b/src/Config.cc
index dbeffd8..e2d5bc5 100644
--- a/src/Config.cc
+++ b/src/Config.cc
@@ -454,6 +454,7 @@ BopomofoConfig::readDefaultValues (void)
m_bopomofo_keyboard_mapping = read (CONFIG_BOPOMOFO_KEYBOARD_MAPPING, 0);
m_select_keys = read (CONFIG_SELECT_KEYS, 0);
+ if (m_select_keys >= 9) m_select_keys = 0;
m_guide_key = read (CONFIG_GUIDE_KEY, true);
m_auxiliary_select_key_f = read (CONFIG_AUXILIARY_SELECT_KEY_F, true);
m_auxiliary_select_key_kp = read (CONFIG_AUXILIARY_SELECT_KEY_KP, true);
@@ -483,8 +484,10 @@ BopomofoConfig::valueChanged (const std::string & section,
m_special_phrases = normalizeGValue (value, false);
else if (CONFIG_BOPOMOFO_KEYBOARD_MAPPING == name)
m_bopomofo_keyboard_mapping = normalizeGValue (value, 0);
- else if (CONFIG_SELECT_KEYS == name)
+ else if (CONFIG_SELECT_KEYS == name) {
m_select_keys = normalizeGValue (value, 0);
+ if (m_select_keys >= 9) m_select_keys = 0;
+ }
else if (CONFIG_GUIDE_KEY == name)
m_guide_key = normalizeGValue (value, true);
else if (CONFIG_AUXILIARY_SELECT_KEY_F == name)