Merge lp:~3v1n0/bamf/ucc-support into lp:bamf

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 645
Merged at revision: 618
Proposed branch: lp:~3v1n0/bamf/ucc-support
Merge into: lp:bamf
Prerequisite: lp:~3v1n0/bamf/better-lib-caching
Diff against target: 270 lines (+53/-43)
6 files modified
src/bamf-matcher.c (+9/-9)
tests/bamfdaemon/test-matcher.c (+23/-23)
tests/data/unity-control-center.desktop (+4/-2)
tests/data/unity-display-panel.desktop (+8/-4)
tests/data/unity-mouse-panel.desktop (+8/-4)
tests/libbamf/test-application.c (+1/-1)
To merge this branch: bzr merge lp:~3v1n0/bamf/ucc-support
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+276170@code.launchpad.net

Commit message

BamfMatcher: update special g-c-c code to unity-control-center

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve
lp:~3v1n0/bamf/ucc-support updated
646. By Marco Trevisan (Treviño)

TestApplication: use unity-control-center binary

647. By Marco Trevisan (Treviño)

BamfMatcher: revert change to update app desktop file on u-c-c update, it might break launcher

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/bamf-matcher.c'
2--- src/bamf-matcher.c 2015-02-02 10:01:42 +0000
3+++ src/bamf-matcher.c 2015-11-03 10:03:05 +0000
4@@ -68,7 +68,7 @@
5 // Prefixes that must be considered starting point of exec strings
6 const gchar* EXEC_GOOD_PREFIXES[] =
7 {
8- "^gnome-control-center$", "^libreoffice$", "^ooffice$", "^wine$", "^steam$",
9+ "^unity-control-center$", "^libreoffice$", "^ooffice$", "^wine$", "^steam$",
10 "^sol$"
11 };
12
13@@ -2151,7 +2151,7 @@
14 }
15
16 static char *
17-get_gnome_control_center_window_hint (BamfMatcher * self, BamfLegacyWindow * window)
18+get_unity_control_center_window_hint (BamfMatcher * self, BamfLegacyWindow * window)
19 {
20 const gchar *role;
21 GList *list;
22@@ -2163,21 +2163,21 @@
23
24 if (role)
25 {
26- gchar *exec = g_strconcat ("gnome-control-center ", role, NULL);
27+ gchar *exec = g_strconcat ("unity-control-center ", role, NULL);
28 list = g_hash_table_lookup (self->priv->desktop_file_table, exec);
29 g_free (exec);
30 }
31
32 if (!role || !list)
33 {
34- list = g_hash_table_lookup (self->priv->desktop_id_table, "gnome-control-center");
35+ list = g_hash_table_lookup (self->priv->desktop_id_table, "unity-control-center");
36 }
37
38 return (list ? (char *) list->data : NULL);
39 }
40
41 static void
42-on_gnome_control_center_window_role_changed (BamfLegacyWindow *window, BamfMatcher* self)
43+on_unity_control_center_window_role_changed (BamfLegacyWindow *window, BamfMatcher* self)
44 {
45 g_return_if_fail (BAMF_IS_MATCHER (self));
46 g_return_if_fail (BAMF_IS_LEGACY_WINDOW (window));
47@@ -2186,7 +2186,7 @@
48 const char *new_hint;
49
50 old_hint = bamf_legacy_window_get_hint (window, _BAMF_DESKTOP_FILE);
51- new_hint = get_gnome_control_center_window_hint (self, window);
52+ new_hint = get_unity_control_center_window_hint (self, window);
53
54 if (new_hint && g_strcmp0 (new_hint, old_hint) != 0)
55 {
56@@ -2218,17 +2218,17 @@
57 return;
58 }
59 }
60- else if (g_strcmp0 (bamf_legacy_window_get_class_name (window), "Gnome-control-center") == 0)
61+ else if (g_strcmp0 (bamf_legacy_window_get_class_name (window), "Unity-control-center") == 0)
62 {
63 char *old_hint = bamf_legacy_window_get_hint (window, _BAMF_DESKTOP_FILE);
64- const char *new_hint = get_gnome_control_center_window_hint (self, window);
65+ const char *new_hint = get_unity_control_center_window_hint (self, window);
66
67 if (new_hint && g_strcmp0 (old_hint, new_hint) != 0)
68 {
69 bamf_legacy_window_set_hint (window, _BAMF_DESKTOP_FILE, new_hint);
70 }
71
72- g_signal_connect (window, "role-changed", (GCallback) on_gnome_control_center_window_role_changed, self);
73+ g_signal_connect (window, "role-changed", (GCallback) on_unity_control_center_window_role_changed, self);
74 g_free (old_hint);
75 }
76
77
78=== modified file 'tests/bamfdaemon/test-matcher.c'
79--- tests/bamfdaemon/test-matcher.c 2015-02-02 10:01:42 +0000
80+++ tests/bamfdaemon/test-matcher.c 2015-11-03 10:03:05 +0000
81@@ -558,7 +558,7 @@
82 }
83
84 static void
85-test_match_gnome_control_center_panels (void)
86+test_match_unity_control_center_panels (void)
87 {
88 BamfMatcher *matcher;
89 BamfWindow *window;
90@@ -570,16 +570,16 @@
91 screen = bamf_legacy_screen_get_default ();
92 matcher = bamf_matcher_get_default ();
93 guint xid = g_random_int ();
94- const char *exec = "gnome-control-center";
95- const char *class_name = "Gnome-control-center";
96- const char *class_instance = "gnome-control-center";
97+ const char *exec = "unity-control-center";
98+ const char *class_name = "Unity-control-center";
99+ const char *class_instance = "unity-control-center";
100
101 cleanup_matcher_tables (matcher);
102 export_matcher_on_bus (matcher);
103
104- bamf_matcher_load_desktop_file (matcher, DATA_DIR"/gnome-control-center.desktop");
105- bamf_matcher_load_desktop_file (matcher, DATA_DIR"/gnome-display-panel.desktop");
106- bamf_matcher_load_desktop_file (matcher, DATA_DIR"/gnome-mouse-panel.desktop");
107+ bamf_matcher_load_desktop_file (matcher, DATA_DIR"/unity-control-center.desktop");
108+ bamf_matcher_load_desktop_file (matcher, DATA_DIR"/unity-display-panel.desktop");
109+ bamf_matcher_load_desktop_file (matcher, DATA_DIR"/unity-mouse-panel.desktop");
110
111 test_win = bamf_legacy_window_test_new (xid, "System Settings", NULL, exec);
112 bamf_legacy_window_test_set_wmclass (test_win, class_name, class_instance);
113@@ -587,42 +587,42 @@
114 _bamf_legacy_screen_open_test_window (screen, test_win);
115
116 hint = bamf_legacy_window_get_hint (BAMF_LEGACY_WINDOW (test_win), _BAMF_DESKTOP_FILE);
117- g_assert_cmpstr (hint, ==, DATA_DIR"/gnome-control-center.desktop");
118+ g_assert_cmpstr (hint, ==, DATA_DIR"/unity-control-center.desktop");
119 g_free (hint);
120- app = bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/gnome-control-center.desktop");
121+ app = bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/unity-control-center.desktop");
122 g_assert (find_window_in_app (app, BAMF_LEGACY_WINDOW (test_win)));
123
124 bamf_legacy_window_test_set_name (test_win, "Displays");
125 bamf_legacy_window_test_set_role (test_win, "display");
126- g_assert (!bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/gnome-control-center.desktop"));
127- app = bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/gnome-display-panel.desktop");
128+ g_assert (!bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/unity-control-center.desktop"));
129+ app = bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/unity-display-panel.desktop");
130 g_assert (app);
131 window = BAMF_WINDOW (bamf_view_get_children (BAMF_VIEW (app))->data);
132 test_win = BAMF_LEGACY_WINDOW_TEST (bamf_window_get_window (window));
133 hint = bamf_legacy_window_get_hint (BAMF_LEGACY_WINDOW (test_win), _BAMF_DESKTOP_FILE);
134- g_assert_cmpstr (hint, ==, DATA_DIR"/gnome-display-panel.desktop");
135+ g_assert_cmpstr (hint, ==, DATA_DIR"/unity-display-panel.desktop");
136 g_free (hint);
137
138 bamf_legacy_window_test_set_name (test_win, "Mouse and Touchpad");
139 bamf_legacy_window_test_set_role (test_win, "mouse");
140- g_assert (!bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/gnome-display-panel.desktop"));
141- app = bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/gnome-mouse-panel.desktop");
142+ g_assert (!bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/unity-display-panel.desktop"));
143+ app = bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/unity-mouse-panel.desktop");
144 g_assert (app);
145 window = BAMF_WINDOW (bamf_view_get_children (BAMF_VIEW (app))->data);
146 test_win = BAMF_LEGACY_WINDOW_TEST (bamf_window_get_window (window));
147 hint = bamf_legacy_window_get_hint (BAMF_LEGACY_WINDOW (test_win), _BAMF_DESKTOP_FILE);
148- g_assert_cmpstr (hint, ==, DATA_DIR"/gnome-mouse-panel.desktop");
149+ g_assert_cmpstr (hint, ==, DATA_DIR"/unity-mouse-panel.desktop");
150 g_free (hint);
151
152 bamf_legacy_window_test_set_name (test_win, "Invalid Panel");
153 bamf_legacy_window_test_set_role (test_win, "invalid-role");
154- g_assert (!bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/gnome-mouse-panel.desktop"));
155- app = bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/gnome-control-center.desktop");
156+ g_assert (!bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/unity-mouse-panel.desktop"));
157+ app = bamf_matcher_get_application_by_desktop_file (matcher, DATA_DIR"/unity-control-center.desktop");
158 g_assert (app);
159 window = BAMF_WINDOW (bamf_view_get_children (BAMF_VIEW (app))->data);
160 test_win = BAMF_LEGACY_WINDOW_TEST (bamf_window_get_window (window));
161 hint = bamf_legacy_window_get_hint (BAMF_LEGACY_WINDOW (test_win), _BAMF_DESKTOP_FILE);
162- g_assert_cmpstr (hint, ==, DATA_DIR"/gnome-control-center.desktop");
163+ g_assert_cmpstr (hint, ==, DATA_DIR"/unity-control-center.desktop");
164 g_free (hint);
165
166 g_object_unref (matcher);
167@@ -1077,12 +1077,12 @@
168 g_assert_cmpstr (trimmed, ==, "libreoffice --writer");
169 g_free (trimmed);
170
171- trimmed = bamf_matcher_get_trimmed_exec (matcher, "/usr/bin/gnome-control-center");
172- g_assert_cmpstr (trimmed, ==, "gnome-control-center");
173+ trimmed = bamf_matcher_get_trimmed_exec (matcher, "/usr/bin/unity-control-center");
174+ g_assert_cmpstr (trimmed, ==, "unity-control-center");
175 g_free (trimmed);
176
177- trimmed = bamf_matcher_get_trimmed_exec (matcher, "gnome-control-center foo-panel");
178- g_assert_cmpstr (trimmed, ==, "gnome-control-center foo-panel");
179+ trimmed = bamf_matcher_get_trimmed_exec (matcher, "unity-control-center foo-panel");
180+ g_assert_cmpstr (trimmed, ==, "unity-control-center foo-panel");
181 g_free (trimmed);
182
183 // Other exec strings
184@@ -1251,7 +1251,7 @@
185 g_test_add_func (DOMAIN"/Matching/Application/DesktopLess", test_match_desktopless_application);
186 g_test_add_func (DOMAIN"/Matching/Application/Desktop", test_match_desktop_application);
187 g_test_add_func (DOMAIN"/Matching/Application/LibreOffice", test_match_libreoffice_windows);
188- g_test_add_func (DOMAIN"/Matching/Application/GnomeControlCenter", test_match_gnome_control_center_panels);
189+ g_test_add_func (DOMAIN"/Matching/Application/UnityControlCenter", test_match_unity_control_center_panels);
190 g_test_add_func (DOMAIN"/Matching/Application/JavaWebStart", test_match_javaws_windows);
191 g_test_add_func (DOMAIN"/Matching/Application/JavaWebStart/HintIngored", test_match_javaws_windows_hint_ignored);
192 g_test_add_func (DOMAIN"/Matching/Application/JavaWebStart/NoDesktopMatch", test_match_javaws_windows_no_desktop_match);
193
194=== renamed file 'tests/data/bin/gnome-control-center' => 'tests/data/bin/unity-control-center'
195=== renamed file 'tests/data/gnome-control-center.desktop' => 'tests/data/unity-control-center.desktop'
196--- tests/data/gnome-control-center.desktop 2013-01-08 19:13:06 +0000
197+++ tests/data/unity-control-center.desktop 2015-11-03 10:03:05 +0000
198@@ -1,9 +1,11 @@
199 [Desktop Entry]
200 Name=System Settings
201 Icon=preferences-system
202-Exec=gnome-control-center --overview
203+Exec=unity-control-center --overview
204 Terminal=false
205 Type=Application
206 StartupNotify=true
207 Categories=GNOME;GTK;System;
208-OnlyShowIn=GNOME;Unity;
209+OnlyShowIn=Unity;
210+Keywords=Preferences;Settings;
211+X-Ubuntu-Gettext-Domain=unity-control-center
212
213=== renamed file 'tests/data/gnome-display-panel.desktop' => 'tests/data/unity-display-panel.desktop'
214--- tests/data/gnome-display-panel.desktop 2013-01-08 19:13:06 +0000
215+++ tests/data/unity-display-panel.desktop 2015-11-03 10:03:05 +0000
216@@ -1,10 +1,14 @@
217 [Desktop Entry]
218 Name=Displays
219 Comment=Change resolution and position of monitors and projectors
220-Exec=gnome-control-center display
221-Icon=preferences-desktop-display
222+Exec=unity-control-center display
223+Icon=unity-display-panel
224 Terminal=false
225 Type=Application
226 StartupNotify=true
227-Categories=GNOME;GTK;Settings;HardwareSettings;X-GNOME-Settings-Panel;
228-OnlyShowIn=GNOME;Unity;
229+Categories=GNOME;GTK;Settings;HardwareSettings;X-Unity-Settings-Panel;
230+OnlyShowIn=Unity;
231+X-Unity-Settings-Panel=display
232+# Translators: those are keywords for the display control-center panel
233+Keywords=Panel;Projector;xrandr;Screen;Resolution;Refresh;
234+X-Ubuntu-Gettext-Domain=unity-control-center
235
236=== renamed file 'tests/data/gnome-mouse-panel.desktop' => 'tests/data/unity-mouse-panel.desktop'
237--- tests/data/gnome-mouse-panel.desktop 2013-01-08 19:13:06 +0000
238+++ tests/data/unity-mouse-panel.desktop 2015-11-03 10:03:05 +0000
239@@ -1,10 +1,14 @@
240 [Desktop Entry]
241-Name=Mouse and Touchpad
242+Name=Mouse & Touchpad
243 Comment=Set your mouse and touchpad preferences
244-Exec=gnome-control-center mouse
245+Exec=unity-control-center mouse
246 Icon=input-mouse
247 Terminal=false
248 Type=Application
249 StartupNotify=true
250-Categories=GNOME;GTK;Settings;HardwareSettings;X-GNOME-Settings-Panel;
251-OnlyShowIn=GNOME;Unity;
252+Categories=GNOME;GTK;Settings;HardwareSettings;X-Unity-Settings-Panel;
253+OnlyShowIn=Unity;
254+X-Unity-Settings-Panel=mouse
255+# Translators: those are keywords for the mouse and touchpad control-center panel
256+Keywords=Trackpad;Pointer;Click;Tap;Double;Button;Trackball;
257+X-Ubuntu-Gettext-Domain=unity-control-center
258
259=== modified file 'tests/libbamf/test-application.c'
260--- tests/libbamf/test-application.c 2014-03-07 18:21:01 +0000
261+++ tests/libbamf/test-application.c 2015-11-03 10:03:05 +0000
262@@ -59,7 +59,7 @@
263 test_favorite_valid_desktop_file_system (void)
264 {
265 BamfApplication *application;
266- const gchar *desktop_file = DATA_DIR"/gnome-control-center.desktop";
267+ const gchar *desktop_file = DATA_DIR"/unity-control-center.desktop";
268 application = bamf_application_new_favorite (desktop_file);
269
270 g_assert_cmpstr (bamf_application_get_desktop_file (application), ==, desktop_file);

Subscribers

People subscribed via source and target branches