diff options
author | Peng Wu <alexepico@gmail.com> | 2022-09-23 16:40:24 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2022-09-23 16:40:24 +0800 |
commit | e856577e1d77719d6001db79f3149e1f537d0aaf (patch) | |
tree | c390974548f952d9a4b3c7f819afff0674d9d885 | |
parent | abd006be68be04509801ca5ff52d759f9d21c724 (diff) | |
download | ibus-libpinyin-e856577e1d77719d6001db79f3149e1f537d0aaf.tar.gz |
Update m_sort_option variable
-rw-r--r-- | src/PYConfig.cc | 2 | ||||
-rw-r--r-- | src/PYConfig.h | 4 | ||||
-rw-r--r-- | src/PYPConfig.cc | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/PYConfig.cc b/src/PYConfig.cc index d92969c..1ba6704 100644 --- a/src/PYConfig.cc +++ b/src/PYConfig.cc @@ -43,7 +43,7 @@ Config::initDefaultValues (void) m_page_size = 5; m_display_style = DISPLAY_STYLE_TRADITIONAL; m_remember_every_input = FALSE; - m_sort_option = SORT_BY_PHRASE_LENGTH_AND_PINYIN_LENGTH_AND_FREQUENCY; + m_sort_option = SORT_BY_PHRASE_LENGTH | SORT_BY_PINYIN_LENGTH | SORT_BY_FREQUENCY; m_shift_select_candidate = FALSE; m_minus_equal_page = TRUE; diff --git a/src/PYConfig.h b/src/PYConfig.h index d39427d..4929e7a 100644 --- a/src/PYConfig.h +++ b/src/PYConfig.h @@ -58,7 +58,7 @@ public: guint pageSize (void) const { return m_page_size; } DisplayStyle displayStyle (void) const { return m_display_style; } gboolean rememberEveryInput (void) const { return m_remember_every_input; } - sort_option_t sortOption (void) const { return m_sort_option; } + guint sortOption (void) const { return m_sort_option; } gboolean shiftSelectCandidate (void) const { return m_shift_select_candidate; } gboolean minusEqualPage (void) const { return m_minus_equal_page; } gboolean commaPeriodPage (void) const { return m_comma_period_page; } @@ -144,7 +144,7 @@ protected: guint m_page_size; DisplayStyle m_display_style; gboolean m_remember_every_input; - sort_option_t m_sort_option; + guint m_sort_option; gboolean m_shift_select_candidate; gboolean m_minus_equal_page; diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc index d5db7a9..4730036 100644 --- a/src/PYPConfig.cc +++ b/src/PYPConfig.cc @@ -132,7 +132,7 @@ LibPinyinConfig::initDefaultValues (void) m_page_size = 5; m_display_style = DISPLAY_STYLE_TRADITIONAL; m_remember_every_input = FALSE; - m_sort_option = SORT_BY_PHRASE_LENGTH_AND_PINYIN_LENGTH_AND_FREQUENCY; + m_sort_option = SORT_BY_PHRASE_LENGTH | SORT_BY_PINYIN_LENGTH | SORT_BY_FREQUENCY; m_emoji_candidate = TRUE; m_english_candidate = TRUE; @@ -202,10 +202,10 @@ static const struct { static const struct{ gint sort_option_index; - sort_option_t sort_option; + guint sort_option; } sort_options [] = { - {0, SORT_BY_PHRASE_LENGTH_AND_FREQUENCY}, - {1, SORT_BY_PHRASE_LENGTH_AND_PINYIN_LENGTH_AND_FREQUENCY} + {0, SORT_BY_PHRASE_LENGTH | SORT_BY_FREQUENCY}, + {1, SORT_BY_PHRASE_LENGTH | SORT_BY_PINYIN_LENGTH | SORT_BY_FREQUENCY} }; static const struct{ @@ -290,7 +290,7 @@ LibPinyinConfig::readDefaultValues (void) m_remember_every_input = read (CONFIG_REMEMBER_EVERY_INPUT, false); index = read (CONFIG_SORT_OPTION, 0); - m_sort_option = SORT_BY_PHRASE_LENGTH_AND_PINYIN_LENGTH_AND_FREQUENCY; + m_sort_option = SORT_BY_PHRASE_LENGTH | SORT_BY_PINYIN_LENGTH | SORT_BY_FREQUENCY; for (guint i = 0; i < G_N_ELEMENTS (sort_options); i++) { if (index == sort_options[i].sort_option_index) { @@ -393,7 +393,7 @@ LibPinyinConfig::valueChanged (const std::string &schema_id, m_remember_every_input = normalizeGVariant (value, false); } else if (CONFIG_SORT_OPTION == name) { const gint index = normalizeGVariant (value, 0); - m_sort_option = SORT_BY_PHRASE_LENGTH_AND_PINYIN_LENGTH_AND_FREQUENCY; + m_sort_option = SORT_BY_PHRASE_LENGTH | SORT_BY_PINYIN_LENGTH | SORT_BY_FREQUENCY; for (guint i = 0; i < G_N_ELEMENTS (sort_options); i++) { if (index == sort_options[i].sort_option_index) { |