Skip to content

Commit

Permalink
Fix PinyinProperties::propertyActivate method
Browse files Browse the repository at this point in the history
  • Loading branch information
epico committed Jan 9, 2025
1 parent 2c247e2 commit 905a2d7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/PYPinyinProperties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,24 @@ PinyinProperties::propertyActivate (const gchar *prop_name, guint prop_state) {
}

const int len = strlen("LuaConverter.");
if (0 == strncmp (prop_name, "LuaConverter.", len) &&
prop_state == PROP_STATE_CHECKED) {
std::string name = prop_name + len;
if (name == "None")
m_config.luaConverter ("");
else
m_config.luaConverter (name);
if (0 == strncmp (prop_name, "LuaConverter.", len)) {
if (prop_state == PROP_STATE_CHECKED) {
std::string name = prop_name + len;
if (name == "None")
m_config.luaConverter ("");
else
m_config.luaConverter (name);
}

for (auto iter = m_props_lua_converter_vec.begin ();
iter != m_props_lua_converter_vec.end (); ++iter) {
Property *prop = *iter;
if (0 == g_strcmp0 (prop->getKey (), prop_name)) {
prop->setState ((IBusPropState)prop_state);
updateProperty (*prop);
}
}

return TRUE;
}

Expand Down
5 changes: 5 additions & 0 deletions src/PYProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class Property : public Object {
IBusPropList *props = NULL)
: Object (ibus_property_new (key, type, label, icon, tooltip, sensitive, visible, state, props)) { }

const gchar * getKey (void)
{
return ibus_property_get_key (get<IBusProperty> ());
}

void setLabel (IBusText *text)
{
ibus_property_set_label (get<IBusProperty> (), text);
Expand Down

0 comments on commit 905a2d7

Please sign in to comment.