diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-01-17 23:01:37 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-01-17 23:01:37 +0000 |
commit | a39901745760040aefe046da10e3841e05caa829 (patch) | |
tree | 58ffa067227d0a1e6b58a6055a49f4aa3a11be5d | |
parent | 06c8a32dc8fdb3150bed5db3d8ee5919f070a810 (diff) | |
parent | 5535cc541da4b436c662bef27589f5b929ed982e (diff) | |
download | ayatana-indicator-power-a39901745760040aefe046da10e3841e05caa829.tar.gz ayatana-indicator-power-a39901745760040aefe046da10e3841e05caa829.tar.bz2 ayatana-indicator-power-a39901745760040aefe046da10e3841e05caa829.zip |
g_type_init() is deprecated as of glib 2.35.4, so bump our glib minimum requirement and remove the g_type_init() call.
Approved by PS Jenkins bot.
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | tests/test-dbus-listener.cc | 19 | ||||
-rw-r--r-- | tests/test-device.cc | 26 | ||||
-rw-r--r-- | tests/test-indicator.cc | 1 |
5 files changed, 2 insertions, 48 deletions
diff --git a/configure.ac b/configure.ac index f4ada8a..0601c16 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ LT_INIT ########################### # Dependencies ########################### -GLIB_REQUIRED_VERSION=2.33 +GLIB_REQUIRED_VERSION=2.35.4 GIO_REQUIRED_VERSION=2.26 GTK_REQUIRED_VERSION=3.0 INDICATOR_REQUIRED_VERSION=0.3.90 diff --git a/debian/control b/debian/control index b53f5be..e9ebbd2 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 9), libxorg-gtest-dev, libgtest-dev, libgtk-3-dev, - libglib2.0-dev (>= 2.33), + libglib2.0-dev (>= 2.35.4), libindicator3-dev (>= 0.3.90), libupower-glib-dev (>= 0.9.5), gnome-settings-daemon-dev (>= 3.1.4), diff --git a/tests/test-dbus-listener.cc b/tests/test-dbus-listener.cc index 8bf74bf..7764498 100644 --- a/tests/test-dbus-listener.cc +++ b/tests/test-dbus-listener.cc @@ -26,24 +26,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. **** ***/ -namespace -{ - void ensure_glib_initialized () - { - static bool initialized = false; - - if (G_UNLIKELY(!initialized)) - { - initialized = true; - g_type_init(); - } - } -} - -/*** -**** -***/ - class DbusListenerTest : public ::testing::Test { protected: @@ -138,7 +120,6 @@ class DbusListenerTest : public ::testing::Test gsd_power_error_string = NULL; // bring up the test bus - ensure_glib_initialized (); mainloop = g_main_loop_new (NULL, FALSE); bus = g_test_dbus_new (G_TEST_DBUS_NONE); g_test_dbus_up (bus); diff --git a/tests/test-device.cc b/tests/test-device.cc index d9d7956..ab329f1 100644 --- a/tests/test-device.cc +++ b/tests/test-device.cc @@ -21,20 +21,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "device.h" #include "indicator-power.h" -namespace -{ - void ensure_glib_initialized () - { - static bool initialized = false; - - if (G_UNLIKELY(!initialized)) - { - initialized = true; - g_type_init(); - } - } -} - class DeviceTest : public ::testing::Test { private: @@ -63,8 +49,6 @@ class DeviceTest : public ::testing::Test log_handler_id = g_log_set_handler ("Indicator-Power", flags, log_count_func, this); log_count_ipower_expected = 0; log_count_ipower_actual = 0; - - ensure_glib_initialized (); } virtual void TearDown() @@ -111,8 +95,6 @@ class DeviceTest : public ::testing::Test TEST_F(DeviceTest, GObjectNew) { - ensure_glib_initialized (); - GObject * o = G_OBJECT (g_object_new (INDICATOR_POWER_DEVICE_TYPE, NULL)); ASSERT_TRUE (o != NULL); ASSERT_TRUE (INDICATOR_IS_POWER_DEVICE(o)); @@ -129,8 +111,6 @@ TEST_F(DeviceTest, Properties) guint64 u64; const gchar * key; - ensure_glib_initialized (); - o = G_OBJECT (g_object_new (INDICATOR_POWER_DEVICE_TYPE, NULL)); ASSERT_TRUE (o != NULL); ASSERT_TRUE (INDICATOR_IS_POWER_DEVICE(o)); @@ -174,8 +154,6 @@ TEST_F(DeviceTest, Properties) TEST_F(DeviceTest, New) { - ensure_glib_initialized (); - IndicatorPowerDevice * device = indicator_power_device_new ("/object/path", UP_DEVICE_KIND_BATTERY, 50.0, @@ -195,8 +173,6 @@ TEST_F(DeviceTest, New) TEST_F(DeviceTest, NewFromVariant) { - ensure_glib_initialized (); - GVariant * variant = g_variant_new ("(susdut)", "/object/path", (guint32) UP_DEVICE_KIND_BATTERY, @@ -221,8 +197,6 @@ TEST_F(DeviceTest, NewFromVariant) TEST_F(DeviceTest, BadAccessors) { - ensure_glib_initialized (); - // test that these functions can handle being passed NULL pointers IndicatorPowerDevice * device = NULL; indicator_power_device_get_kind (device); diff --git a/tests/test-indicator.cc b/tests/test-indicator.cc index 824a5ac..6fd9bf7 100644 --- a/tests/test-indicator.cc +++ b/tests/test-indicator.cc @@ -46,7 +46,6 @@ namespace if (G_UNLIKELY(!initialized)) { initialized = true; - g_type_init(); g_log_set_handler ("Gtk", (GLogLevelFlags)(G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING), quiet_log_func, NULL); g_log_set_handler ("GLib-GObject", (GLogLevelFlags)(G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING), quiet_log_func, NULL); } |