Migration request from DConf DB to GSettings DB in each ibus engine

141 views
Skip to first unread message

Takao Fujiwara

unread,
Dec 18, 2017, 2:34:08 AM12/18/17
to ibus-...@googlegroups.com
IBus engine maintainers,

I'd request each IBus engine maintainer to migrate their DConf DB to
GSettings one.
Currently IBus provides IBusConfig APIs using DConf or GConf likes
ibus_config_get_value(), ibus_config_set_value() to refer their
preferences and now I'm thinking each engine can use GSettings APIs
directly likes g_settings_get_value(), g_settings_set_value() without
IBusBus instead of the DConf APIs.
If your engine does not use IBusConfig, probably I think you don't
have to migrate your DB to GSettings one.
I'm thinking to delete IBusConfig in coming IBus 1.6 [1].

Please refer org.freedesktop.ibus.engine.anthy.gschema.xml of
https://github.com/fujiwarat/ibus-anthy/blob/master/data/org.freedesktop.ibus.engine.anthy.gschema.xml.in
ibus-anthy uses "a{sv}" or "av" format which can add new elements
instead of new keys.

You can test it:
% cp org.freedesktop.ibus.engine.anthy.gschema.xml.in \
org.freedesktop.ibus.engine.anthy.gschema.xml
% cp org.freedesktop.ibus.engine.anthy.gschema.xml \
/usr/share/glib-2.0/schemas
% sudo glib-compile-schemas /usr/share/glib-2.0/schemas
% gsettings list-recursively org.freedesktop.ibus.engine.anthy.common

If your DConf DB does not have the complicated format,
gsettings-schema-convert command can change GConf DB to GSettings DB
[2].

My concern about GSettings was that GSettings cannot add new keys
against the pre-registered DBs although DConf can do and waited for
GSettingsList implementation to resolve the concern but seems
GSettingsList won't be available [3].
Thinking about GSettings, GSettings provides various formats with
GVariant against DConf and I think we can migrate DConf DBs to
GSettings ones.
The idea is to use "av" format or tuple format and I could migrate
ibus-anthy from DConf to GSettings ultimately [4].

Let me know if you have any concerns or problems in the migration.

[1] https://github.com/ibus/ibus/wiki/Plans1.6
[2] https://github.com/ibus/ibus/blob/master/data/dconf/Makefile.am#L54
[3] https://bugzilla.gnome.org/show_bug.cgi?id=622126
[4] https://github.com/fujiwarat/ibus-anthy/commit/ae039c727a89c8a27d5224adafb656a37d345d22
Reply all
Reply to author
Forward
0 new messages