Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3548)

Issue 5091045: Add ibus_config_watch/unwatch. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by Daiki Ueno
Modified:
12 years, 1 month ago
Reviewers:
shawn.p.huang, Yusuke Sato
Base URL:
git@github.com:ibus/ibus.git@master
Visibility:
Public.

Description

Add ibus_config_watch/unwatch. Currently IBusConfig proxy is notified every config value change. e.g. ibus-m17n will get notified even when ibus-anthy's config values are changed. With this patch, IBusConfig proxy will be able to restrict notification by calling ibus_config_watch(). For example, after: ibus_config_watch (config, "engine/M17N/hi/inscript", NULL); it will be notified value changes only under "engine/M17N/hi/inscript" section. BUG=none TEST=manually with modified ibus-m17n

Patch Set 1 #

Total comments: 14

Patch Set 2 : implement G_TYPE_INITABLE interface #

Total comments: 2

Patch Set 3 : remove all match rules on ibus_proxy_destroy() #

Patch Set 4 : partial rewrite with more generic internal functions #

Total comments: 25

Patch Set 5 : add unit test #

Total comments: 20

Patch Set 6 : use ibus_bus_add_match, don't spawn in test case #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+545 lines, -11 lines) Patch
M src/ibusbus.c View 1 2 3 4 5 1 chunk +0 lines, -4 lines 0 comments Download
M src/ibusconfig.h View 1 2 3 4 3 chunks +47 lines, -2 lines 0 comments Download
M src/ibusconfig.c View 1 2 3 4 5 8 chunks +243 lines, -5 lines 0 comments Download
M src/ibusinternal.h View 1 2 3 4 1 chunk +21 lines, -0 lines 0 comments Download
M src/tests/Makefile.am View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/tests/ibus-config.c View 1 2 3 4 5 2 chunks +233 lines, -0 lines 2 comments Download

Messages

Total messages: 14
Daiki Ueno
To test, add ibus_config_watch (config, klass->config_section, NULL); at the end of ibus_m17n_engine_class_init in ibus-m17n.
12 years, 7 months ago (2011-09-21 05:58:24 UTC) #1
Peng
https://codereview.appspot.com/5091045/diff/1/src/ibusconfig.c File src/ibusconfig.c (right): https://codereview.appspot.com/5091045/diff/1/src/ibusconfig.c#newcode55 src/ibusconfig.c:55: G_DEFINE_TYPE (IBusConfig, ibus_config, IBUS_TYPE_PROXY) Could you implement G_TYPE_INITABLE and ...
12 years, 7 months ago (2011-09-22 02:42:23 UTC) #2
Daiki Ueno
Thanks for the comments. I'll update the CL soon. BTW, this is not an urgent ...
12 years, 7 months ago (2011-09-22 23:25:40 UTC) #3
Daiki Ueno
Sorry for the delay. I've moved. https://codereview.appspot.com/5091045/diff/1/src/ibusconfig.c File src/ibusconfig.c (right): https://codereview.appspot.com/5091045/diff/1/src/ibusconfig.c#newcode55 src/ibusconfig.c:55: G_DEFINE_TYPE (IBusConfig, ibus_config, ...
12 years, 7 months ago (2011-09-28 02:43:48 UTC) #4
Peng
https://codereview.appspot.com/5091045/diff/1/src/ibusconfig.c File src/ibusconfig.c (right): https://codereview.appspot.com/5091045/diff/1/src/ibusconfig.c#newcode109 src/ibusconfig.c:109: } On 2011/09/28 02:43:48, Daiki Ueno wrote: > On ...
12 years, 7 months ago (2011-09-28 19:17:15 UTC) #5
Daiki Ueno
Sorry for not updating this issue for a long time. I have rebased it against ...
12 years, 2 months ago (2012-02-27 04:28:22 UTC) #6
Peng
https://codereview.appspot.com/5091045/diff/8003/src/ibusconfig.c File src/ibusconfig.c (right): https://codereview.appspot.com/5091045/diff/8003/src/ibusconfig.c#newcode29 src/ibusconfig.c:29: #define DBUS_INTERFACE_DBUS "org.freedesktop.DBus" Those macros are also used by ...
12 years, 2 months ago (2012-02-27 16:42:52 UTC) #7
Peng
+Yusuke, I think some IMEs in ChromeOS may want to use those two API.
12 years, 2 months ago (2012-02-27 16:44:05 UTC) #8
Yusuke Sato
On 2012/02/27 16:44:05, Peng wrote: > +Yusuke, I think some IMEs in ChromeOS may want ...
12 years, 2 months ago (2012-02-28 04:09:39 UTC) #9
Daiki Ueno
https://codereview.appspot.com/5091045/diff/8003/src/ibusconfig.c File src/ibusconfig.c (right): https://codereview.appspot.com/5091045/diff/8003/src/ibusconfig.c#newcode29 src/ibusconfig.c:29: #define DBUS_INTERFACE_DBUS "org.freedesktop.DBus" On 2012/02/27 16:42:52, Peng wrote: > ...
12 years, 2 months ago (2012-02-28 08:46:36 UTC) #10
Peng
http://codereview.appspot.com/5091045/diff/14002/src/ibusconfig.c File src/ibusconfig.c (right): http://codereview.appspot.com/5091045/diff/14002/src/ibusconfig.c#newcode191 src/ibusconfig.c:191: _add_match_rule (GDBusConnection *connection, const gchar *rule) Is it possible ...
12 years, 1 month ago (2012-02-28 16:57:59 UTC) #11
Daiki Ueno
https://codereview.appspot.com/5091045/diff/14002/src/ibusconfig.c File src/ibusconfig.c (right): https://codereview.appspot.com/5091045/diff/14002/src/ibusconfig.c#newcode191 src/ibusconfig.c:191: _add_match_rule (GDBusConnection *connection, const gchar *rule) On 2012/02/28 16:57:59, ...
12 years, 1 month ago (2012-02-29 02:57:49 UTC) #12
Peng
lgtm. with some comments. https://codereview.appspot.com/5091045/diff/16004/src/tests/ibus-config.c File src/tests/ibus-config.c (right): https://codereview.appspot.com/5091045/diff/16004/src/tests/ibus-config.c#newcode235 src/tests/ibus-config.c:235: ibus_config_unwatch (config, "test/s1", NULL); I ...
12 years, 1 month ago (2012-02-29 03:52:15 UTC) #13
Daiki Ueno
12 years, 1 month ago (2012-02-29 05:26:53 UTC) #14
On 2012/02/29 03:52:15, Peng wrote:
> lgtm. with some comments.
> 
> https://codereview.appspot.com/5091045/diff/16004/src/tests/ibus-config.c
> File src/tests/ibus-config.c (right):
> 
>
https://codereview.appspot.com/5091045/diff/16004/src/tests/ibus-config.c#new...
> src/tests/ibus-config.c:235: ibus_config_unwatch (config, "test/s1", NULL);
> I would like to add some tests after ibus_config_unwatch() to make sure the
> signals will not be received after unwatch.
> 
>
https://codereview.appspot.com/5091045/diff/16004/src/tests/ibus-config.c#new...
> src/tests/ibus-config.c:353: ibus_config_unwatch (config, "test/s1", "n1");
> ditto

I'll add them.  However, test_config_watch() is now ~150 lines.  I'm thinking of
using g_test_add() with fixtures to separate out test data from
test_config_watch().  That will simplify the code a lot.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b