Merge lp:~didrocks/unity/ignore_gconf_change_on_destruction into lp:unity

Proposed by Didier Roche-Tolomelli
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 1180
Proposed branch: lp:~didrocks/unity/ignore_gconf_change_on_destruction
Merge into: lp:unity
Diff against target: 69 lines (+28/-15)
2 files modified
src/PlacesHomeView.cpp (+25/-15)
src/PlacesHomeView.h (+3/-0)
To merge this branch: bzr merge lp:~didrocks/unity/ignore_gconf_change_on_destruction
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+59051@code.launchpad.net

Description of the change

unregister gconf notify events on destruction (LP: #762120)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/PlacesHomeView.cpp'
2--- src/PlacesHomeView.cpp 2011-04-20 12:27:19 +0000
3+++ src/PlacesHomeView.cpp 2011-04-26 12:45:20 +0000
4@@ -119,21 +119,21 @@
5 MEDIA_DIR,
6 GCONF_CLIENT_PRELOAD_NONE,
7 NULL);
8- gconf_client_notify_add(_client,
9- BROWSER_DIR"/exec",
10- (GConfClientNotifyFunc)OnKeyChanged,
11- this,
12- NULL, NULL);
13- gconf_client_notify_add(_client,
14- MAIL_DIR"/command",
15- (GConfClientNotifyFunc)OnKeyChanged,
16- this,
17- NULL, NULL);
18- gconf_client_notify_add(_client,
19- MEDIA_DIR"/exec",
20- (GConfClientNotifyFunc)OnKeyChanged,
21- this,
22- NULL, NULL);
23+ _browser_gconf_notify = gconf_client_notify_add(_client,
24+ BROWSER_DIR"/exec",
25+ (GConfClientNotifyFunc)OnKeyChanged,
26+ this,
27+ NULL, NULL);
28+ _mail_gconf_notify = gconf_client_notify_add(_client,
29+ MAIL_DIR"/command",
30+ (GConfClientNotifyFunc)OnKeyChanged,
31+ this,
32+ NULL, NULL);
33+ _media_gconf_notify = gconf_client_notify_add(_client,
34+ MEDIA_DIR"/exec",
35+ (GConfClientNotifyFunc)OnKeyChanged,
36+ this,
37+ NULL, NULL);
38
39 _last_activate_time.tv_sec = 0;
40 _last_activate_time.tv_nsec = 0;
41@@ -179,6 +179,16 @@
42
43 if (_ubus_handle != 0)
44 ubus_server_unregister_interest (ubus_server_get_default (), _ubus_handle);
45+
46+ if (_browser_gconf_notify)
47+ gconf_client_notify_remove (_client, _browser_gconf_notify);
48+ if (_mail_gconf_notify)
49+ gconf_client_notify_remove (_client, _mail_gconf_notify);
50+ if (_media_gconf_notify)
51+ gconf_client_notify_remove (_client, _media_gconf_notify);
52+ gconf_client_remove_dir (_client, BROWSER_DIR, NULL);
53+ gconf_client_remove_dir (_client, MAIL_DIR, NULL);
54+ gconf_client_remove_dir (_client, MEDIA_DIR, NULL);
55 }
56
57 void
58
59=== modified file 'src/PlacesHomeView.h'
60--- src/PlacesHomeView.h 2011-04-20 12:27:19 +0000
61+++ src/PlacesHomeView.h 2011-04-26 12:45:20 +0000
62@@ -72,6 +72,9 @@
63 struct timespec _last_activate_time;
64
65 guint _ubus_handle;
66+ guint _browser_gconf_notify;
67+ guint _mail_gconf_notify;
68+ guint _media_gconf_notify;
69 };
70
71