Merge lp:~charlesk/indicator-power/remove-g-type-init into lp:indicator-power/13.04

Proposed by Charles Kerr
Status: Merged
Approved by: Allan LeSage
Approved revision: 161
Merged at revision: 161
Proposed branch: lp:~charlesk/indicator-power/remove-g-type-init
Merge into: lp:indicator-power/13.04
Diff against target: 153 lines (+2/-48)
5 files modified
configure.ac (+1/-1)
debian/control (+1/-1)
tests/test-dbus-listener.cc (+0/-19)
tests/test-device.cc (+0/-26)
tests/test-indicator.cc (+0/-1)
To merge this branch: bzr merge lp:~charlesk/indicator-power/remove-g-type-init
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Indicator Applet Developers Pending
Review via email: mp+143770@code.launchpad.net

Description of the change

g_type_init() is deprecated as of glib 2.35.4, so bump our glib minimum requirement and remove the g_type_init() call.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2012-11-16 12:21:47 +0000
3+++ configure.ac 2013-01-17 21:10:27 +0000
4@@ -29,7 +29,7 @@
5 ###########################
6 # Dependencies
7 ###########################
8-GLIB_REQUIRED_VERSION=2.33
9+GLIB_REQUIRED_VERSION=2.35.4
10 GIO_REQUIRED_VERSION=2.26
11 GTK_REQUIRED_VERSION=3.0
12 INDICATOR_REQUIRED_VERSION=0.3.90
13
14=== modified file 'debian/control'
15--- debian/control 2012-11-15 17:14:24 +0000
16+++ debian/control 2013-01-17 21:10:27 +0000
17@@ -9,7 +9,7 @@
18 libxorg-gtest-dev,
19 libgtest-dev,
20 libgtk-3-dev,
21- libglib2.0-dev (>= 2.33),
22+ libglib2.0-dev (>= 2.35.4),
23 libindicator3-dev (>= 0.3.90),
24 libupower-glib-dev (>= 0.9.5),
25 gnome-settings-daemon-dev (>= 3.1.4),
26
27=== modified file 'tests/test-dbus-listener.cc'
28--- tests/test-dbus-listener.cc 2012-05-29 22:28:15 +0000
29+++ tests/test-dbus-listener.cc 2013-01-17 21:10:27 +0000
30@@ -26,24 +26,6 @@
31 ****
32 ***/
33
34-namespace
35-{
36- void ensure_glib_initialized ()
37- {
38- static bool initialized = false;
39-
40- if (G_UNLIKELY(!initialized))
41- {
42- initialized = true;
43- g_type_init();
44- }
45- }
46-}
47-
48-/***
49-****
50-***/
51-
52 class DbusListenerTest : public ::testing::Test
53 {
54 protected:
55@@ -138,7 +120,6 @@
56 gsd_power_error_string = NULL;
57
58 // bring up the test bus
59- ensure_glib_initialized ();
60 mainloop = g_main_loop_new (NULL, FALSE);
61 bus = g_test_dbus_new (G_TEST_DBUS_NONE);
62 g_test_dbus_up (bus);
63
64=== modified file 'tests/test-device.cc'
65--- tests/test-device.cc 2012-11-16 17:58:24 +0000
66+++ tests/test-device.cc 2013-01-17 21:10:27 +0000
67@@ -21,20 +21,6 @@
68 #include "device.h"
69 #include "indicator-power.h"
70
71-namespace
72-{
73- void ensure_glib_initialized ()
74- {
75- static bool initialized = false;
76-
77- if (G_UNLIKELY(!initialized))
78- {
79- initialized = true;
80- g_type_init();
81- }
82- }
83-}
84-
85 class DeviceTest : public ::testing::Test
86 {
87 private:
88@@ -63,8 +49,6 @@
89 log_handler_id = g_log_set_handler ("Indicator-Power", flags, log_count_func, this);
90 log_count_ipower_expected = 0;
91 log_count_ipower_actual = 0;
92-
93- ensure_glib_initialized ();
94 }
95
96 virtual void TearDown()
97@@ -111,8 +95,6 @@
98
99 TEST_F(DeviceTest, GObjectNew)
100 {
101- ensure_glib_initialized ();
102-
103 GObject * o = G_OBJECT (g_object_new (INDICATOR_POWER_DEVICE_TYPE, NULL));
104 ASSERT_TRUE (o != NULL);
105 ASSERT_TRUE (INDICATOR_IS_POWER_DEVICE(o));
106@@ -129,8 +111,6 @@
107 guint64 u64;
108 const gchar * key;
109
110- ensure_glib_initialized ();
111-
112 o = G_OBJECT (g_object_new (INDICATOR_POWER_DEVICE_TYPE, NULL));
113 ASSERT_TRUE (o != NULL);
114 ASSERT_TRUE (INDICATOR_IS_POWER_DEVICE(o));
115@@ -174,8 +154,6 @@
116
117 TEST_F(DeviceTest, New)
118 {
119- ensure_glib_initialized ();
120-
121 IndicatorPowerDevice * device = indicator_power_device_new ("/object/path",
122 UP_DEVICE_KIND_BATTERY,
123 50.0,
124@@ -195,8 +173,6 @@
125
126 TEST_F(DeviceTest, NewFromVariant)
127 {
128- ensure_glib_initialized ();
129-
130 GVariant * variant = g_variant_new ("(susdut)",
131 "/object/path",
132 (guint32) UP_DEVICE_KIND_BATTERY,
133@@ -221,8 +197,6 @@
134
135 TEST_F(DeviceTest, BadAccessors)
136 {
137- ensure_glib_initialized ();
138-
139 // test that these functions can handle being passed NULL pointers
140 IndicatorPowerDevice * device = NULL;
141 indicator_power_device_get_kind (device);
142
143=== modified file 'tests/test-indicator.cc'
144--- tests/test-indicator.cc 2012-10-26 07:14:11 +0000
145+++ tests/test-indicator.cc 2013-01-17 21:10:27 +0000
146@@ -46,7 +46,6 @@
147 if (G_UNLIKELY(!initialized))
148 {
149 initialized = true;
150- g_type_init();
151 g_log_set_handler ("Gtk", (GLogLevelFlags)(G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING), quiet_log_func, NULL);
152 g_log_set_handler ("GLib-GObject", (GLogLevelFlags)(G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING), quiet_log_func, NULL);
153 }

Subscribers

People subscribed via source and target branches