Skip to content

Commit

Permalink
Allow input method .conf file to be disabled with Enable=False
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed May 2, 2024
1 parent 001a8fc commit cd31d21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/fcitx/inputmethodconfig_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ FCITX_CONFIGURATION(
Option<std::string> label{this, "Label", "Label"};
Option<std::string> languageCode{this, "LangCode", "Language Code"};
Option<std::string> addon{this, "Addon", "Addon"};
Option<bool> configurable{this, "Configurable", "Configurable", false};)
Option<bool> configurable{this, "Configurable", "Configurable", false};
Option<bool> enable{this, "Enable", "Enable", true};
)

FCITX_CONFIGURATION(InputMethodInfo, Option<InputMethodInfoBase> im{
this, "InputMethod", "Input Method"};)
Expand Down
3 changes: 3 additions & 0 deletions src/lib/fcitx/inputmethodmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ void InputMethodManagerPrivate::loadStaticEntries(

InputMethodInfo imInfo;
imInfo.load(config);
if (!*imInfo.im->enable) {
continue;
}
// Remove ".conf"
InputMethodEntry entry = toInputMethodEntry(name, imInfo);
if (checkEntry(entry, addonNames)) {
Expand Down

0 comments on commit cd31d21

Please sign in to comment.