Merge lp:~azzar1/unity/glib-deprecated into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3044
Proposed branch: lp:~azzar1/unity/glib-deprecated
Merge into: lp:unity
Diff against target: 149 lines (+25/-10)
9 files modified
hud/StandaloneHud.cpp (+0/-2)
launcher/StandaloneLauncher.cpp (+0/-1)
launcher/StandaloneSwitcher.cpp (+0/-1)
tests/test_main_dbus.cpp (+2/-0)
tests/test_main_xless.cpp (+2/-0)
tests/test_service_main.c (+2/-1)
tests/unit/TestMain.cpp (+0/-2)
unity-shared/IconLoader.cpp (+19/-2)
unity-shared/StandaloneAppManager.cpp (+0/-1)
To merge this branch: bzr merge lp:~azzar1/unity/glib-deprecated
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Stephen M. Webb (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+143694@code.launchpad.net

Commit message

Remove deprecated glib function.

Description of the change

Remove deprecated function.

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

Problem reproduced. Problem fixed.

review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hud/StandaloneHud.cpp'
2--- hud/StandaloneHud.cpp 2012-11-08 09:12:24 +0000
3+++ hud/StandaloneHud.cpp 2013-01-17 16:13:29 +0000
4@@ -132,8 +132,6 @@
5 // no real tests right now, just make sure we don't get any criticals and such
6 // waiting on nice perceptual diff support before we can build real tests
7 // for views
8-
9- g_type_init ();
10 gtk_init (&argc, &argv);
11
12 nux::NuxInitialize(0);
13
14=== modified file 'launcher/StandaloneLauncher.cpp'
15--- launcher/StandaloneLauncher.cpp 2012-11-22 16:35:20 +0000
16+++ launcher/StandaloneLauncher.cpp 2013-01-17 16:13:29 +0000
17@@ -41,7 +41,6 @@
18
19 int main(int argc, char** argv)
20 {
21- g_type_init();
22 gtk_init(&argc, &argv);
23 nux::NuxInitialize(0);
24
25
26=== modified file 'launcher/StandaloneSwitcher.cpp'
27--- launcher/StandaloneSwitcher.cpp 2012-12-19 09:45:55 +0000
28+++ launcher/StandaloneSwitcher.cpp 2013-01-17 16:13:29 +0000
29@@ -299,7 +299,6 @@
30
31 int main(int argc, char** argv)
32 {
33- g_type_init();
34 gtk_init(&argc, &argv);
35 nux::NuxInitialize(0);
36
37
38=== modified file 'tests/test_main_dbus.cpp'
39--- tests/test_main_dbus.cpp 2012-03-14 06:24:18 +0000
40+++ tests/test_main_dbus.cpp 2013-01-17 16:13:29 +0000
41@@ -9,7 +9,9 @@
42 int main(int argc, char** argv)
43 {
44 ::testing::InitGoogleTest(&argc, argv);
45+#if G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION) <= GLIB_VERSION_2_34
46 g_type_init();
47+#endif
48
49 nux::NuxInitialize (0);
50
51
52=== modified file 'tests/test_main_xless.cpp'
53--- tests/test_main_xless.cpp 2012-09-10 21:34:10 +0000
54+++ tests/test_main_xless.cpp 2013-01-17 16:13:29 +0000
55@@ -6,7 +6,9 @@
56 int main(int argc, char** argv)
57 {
58 ::testing::InitGoogleTest(&argc, argv);
59+#if G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION) <= GLIB_VERSION_2_34
60 g_type_init();
61+#endif
62 setlocale(LC_ALL, "C");
63
64 // Slightly higher as we're more likely to test things we know will fail
65
66=== modified file 'tests/test_service_main.c'
67--- tests/test_service_main.c 2012-11-06 18:19:09 +0000
68+++ tests/test_service_main.c 2013-01-17 16:13:29 +0000
69@@ -43,8 +43,9 @@
70 gint
71 main(gint argc, gchar** argv)
72 {
73+#if G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION) <= GLIB_VERSION_2_34
74 g_type_init();
75-
76+#endif
77 loop_ = g_main_loop_new(NULL, FALSE);
78
79 lens_ = service_lens_new();
80
81=== modified file 'tests/unit/TestMain.cpp'
82--- tests/unit/TestMain.cpp 2012-11-06 18:19:09 +0000
83+++ tests/unit/TestMain.cpp 2013-01-17 16:13:29 +0000
84@@ -60,8 +60,6 @@
85 main(int argc, char** argv)
86 {
87 g_setenv("GSETTINGS_SCHEMA_DIR", BUILDDIR"/settings/", TRUE);
88-
89- g_type_init();
90
91 gtk_init(&argc, &argv);
92
93
94=== modified file 'unity-shared/IconLoader.cpp'
95--- unity-shared/IconLoader.cpp 2012-11-06 18:19:09 +0000
96+++ unity-shared/IconLoader.cpp 2013-01-17 16:13:29 +0000
97@@ -634,11 +634,27 @@
98
99 void PushSchedulerJob()
100 {
101- ::g_io_scheduler_push_job (LoaderJobFunc, this, nullptr, G_PRIORITY_HIGH_IDLE, nullptr);
102+#if G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION) <= GLIB_VERSION_2_34
103+ g_io_scheduler_push_job (LoaderJobFunc, this, nullptr, G_PRIORITY_HIGH_IDLE, nullptr);
104+#else
105+ glib::Object<GTask> task(g_task_new(nullptr, nullptr, [] (GObject*, GAsyncResult*, gpointer data) {
106+ auto self = static_cast<IconLoaderTask*>(data);
107+ self->LoadIconComplete(data);
108+ }, this));
109+
110+ g_task_set_priority(task, G_PRIORITY_HIGH_IDLE);
111+ g_task_set_task_data(task, this, nullptr);
112+
113+ g_task_run_in_thread(task, LoaderJobFunc);
114+#endif
115 }
116
117 // Loading/rendering of pixbufs is done in a separate thread
118+#if G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION) <= GLIB_VERSION_2_34
119 static gboolean LoaderJobFunc(GIOSchedulerJob* job, GCancellable *canc, gpointer data)
120+#else
121+ static void LoaderJobFunc(GTask* job, gpointer source_object, gpointer data, GCancellable* canc)
122+#endif
123 {
124 auto task = static_cast<IconLoaderTask*>(data);
125
126@@ -669,9 +685,10 @@
127 }
128 }
129
130+#if G_ENCODE_VERSION (GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION) <= GLIB_VERSION_2_34
131 g_io_scheduler_job_send_to_mainloop_async (job, LoadIconComplete, task, nullptr);
132-
133 return FALSE;
134+#endif
135 }
136
137 // this will be invoked back in the thread from which push_job was called
138
139=== modified file 'unity-shared/StandaloneAppManager.cpp'
140--- unity-shared/StandaloneAppManager.cpp 2012-11-27 01:19:45 +0000
141+++ unity-shared/StandaloneAppManager.cpp 2013-01-17 16:13:29 +0000
142@@ -178,7 +178,6 @@
143
144 int main(int argc, char* argv[])
145 {
146- g_type_init();
147 gtk_init(&argc, &argv);
148 nux::logging::configure_logging(::getenv("UNITY_APP_LOG_SEVERITY"));
149 g_log_set_default_handler(capture_g_log_calls, NULL);