Merge lp://staging/~agateau/indicator-applet/indicator-set-server into lp://staging/indicator-applet/0.4

Proposed by Aurélien Gâteau
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~agateau/indicator-applet/indicator-set-server
Merge into: lp://staging/indicator-applet/0.4
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~agateau/indicator-applet/indicator-set-server
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+9751@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Aurélien Gâteau (agateau) wrote :

indicate_indicator_new_with_server() only allows creating an instance of Indicator using a custom server, it does not make it possible to create IndicatorMessage instances.

Adding an indicate_indicator_set_server() function solves this problem.

Revision history for this message
Ted Gould (ted) wrote :

On Thu, 2009-08-06 at 10:00 +0000, Aurélien Gâteau wrote:
> indicate_indicator_new_with_server() only allows creating an instance of Indicator using a custom server, it does not make it possible to create IndicatorMessage instances.
>
> Adding an indicate_indicator_set_server() function solves this problem.

Ah, yes. Can you add documentation to the function as it would be part
of the API?

322. By Aurélien Gâteau

Updated documentation

Revision history for this message
Aurélien Gâteau (agateau) wrote :

> On Thu, 2009-08-06 at 10:00 +0000, Aurélien Gâteau wrote:
> Ah, yes. Can you add documentation to the function as it would be part
> of the API?

Done!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libindicate/indicator.c'
2--- libindicate/indicator.c 2009-08-03 22:31:00 +0000
3+++ libindicate/indicator.c 2009-08-05 13:51:59 +0000
4@@ -220,16 +220,29 @@
5
6 IndicateIndicator * indicator = g_object_new(INDICATE_TYPE_INDICATOR, NULL);
7
8+ indicate_indicator_set_server (indicator, server);
9+
10+ return indicator;
11+}
12+
13+void
14+indicate_indicator_set_server (IndicateIndicator * indicator, IndicateServer * server)
15+{
16 IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator);
17+
18+ if (server != NULL) {
19+ g_object_ref(server);
20+ }
21+
22 if (priv->server != NULL) {
23+ indicate_server_remove_indicator (priv->server, indicator);
24 g_object_unref(priv->server);
25- priv->server = NULL;
26 }
27
28 priv->server = server;
29- g_object_ref(priv->server);
30-
31- return indicator;
32+ if (server != NULL) {
33+ indicate_server_add_indicator (server, indicator);
34+ }
35 }
36
37
38
39=== modified file 'libindicate/indicator.h'
40--- libindicate/indicator.h 2009-08-03 22:31:00 +0000
41+++ libindicate/indicator.h 2009-08-05 13:51:59 +0000
42@@ -119,6 +119,9 @@
43
44 gboolean indicate_indicator_is_visible (IndicateIndicator * indicator);
45
46+/* Define this indicator server */
47+void indicate_indicator_set_server (IndicateIndicator * indicator, IndicateServer * server);
48+
49 /* Every entry has an ID, here's how to get it */
50 guint indicate_indicator_get_id (IndicateIndicator * indicator);
51

Subscribers

People subscribed via source and target branches

to status/vote changes: