[evolution-activesync] glib: check version before calling g_type_init
- From: Patrick Ohly <pohly src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-activesync] glib: check version before calling g_type_init
- Date: Mon, 14 Jul 2014 14:22:50 +0000 (UTC)
commit deed4b15cd894a2301dcc2b362d8777af01c05f3
Author: Patrick Ohly <patrick ohly intel com>
Date: Mon Jul 14 16:10:12 2014 +0200
glib: check version before calling g_type_init
g_type_init() has been deprecated since glib 2.36.0. Don't call it
unless necessary to avoid deprecation warnings.
check_tests/eas_autodiscover_tests.c | 2 ++
check_tests/eas_cal_info_translator_test.c | 2 ++
check_tests/eas_con_info_translator_test.c | 2 ++
check_tests/eas_connection_tests.c | 2 ++
check_tests/eas_email_info_translator_test.c | 4 +++-
check_tests/eas_gobjects_unittests.c | 4 +++-
check_tests/eas_libeasmail_tests.c | 2 ++
eas-daemon/libeas/eas-con-info-translator.c | 2 ++
eas-daemon/libeas/eas-connection.c | 6 ++++++
eas-daemon/src/activesyncd-server.c | 2 ++
libeasaccount/tests/libeasaccount_test.c | 2 ++
libeasclient/libeasmail.c | 2 ++
libeasclient/libeassync.c | 2 ++
libeastest/src/libeastest.c | 2 ++
14 files changed, 34 insertions(+), 2 deletions(-)
---
diff --git a/check_tests/eas_autodiscover_tests.c b/check_tests/eas_autodiscover_tests.c
index 5e0ace6..0dbdc12 100644
--- a/check_tests/eas_autodiscover_tests.c
+++ b/check_tests/eas_autodiscover_tests.c
@@ -278,7 +278,9 @@ Suite* eas_autodiscover_suite (void)
{
Suite* s = suite_create ("autodiscover");
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
/* tc_autodiscover test case */
TCase *tc_autodiscover = tcase_create ("core");
diff --git a/check_tests/eas_cal_info_translator_test.c b/check_tests/eas_cal_info_translator_test.c
index 3af15b2..4ada01e 100644
--- a/check_tests/eas_cal_info_translator_test.c
+++ b/check_tests/eas_cal_info_translator_test.c
@@ -42,7 +42,9 @@ static void test_eas_cal_info_translator_parse_request(const char* vCalendarName
gchar *buf;
gboolean parseResponse;
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
calInfo = eas_item_info_new();
calInfo->server_id = serv;
diff --git a/check_tests/eas_con_info_translator_test.c b/check_tests/eas_con_info_translator_test.c
index 2f635ba..e96b81b 100644
--- a/check_tests/eas_con_info_translator_test.c
+++ b/check_tests/eas_con_info_translator_test.c
@@ -39,7 +39,9 @@ static void test_info_translator_parse_request(const char* vCardName,const char*
EasItemInfo* conInfo = NULL;
size_t readResult;
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
conInfo = eas_item_info_new();
conInfo->server_id = serv;
//endregion
diff --git a/check_tests/eas_connection_tests.c b/check_tests/eas_connection_tests.c
index 91ecee7..bd2f690 100644
--- a/check_tests/eas_connection_tests.c
+++ b/check_tests/eas_connection_tests.c
@@ -45,7 +45,9 @@ Suite* eas_connection_suite (void)
{
Suite* s = suite_create ("connection");
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
/* tc_autodiscover test case */
TCase *tc_connection = tcase_create ("core");
diff --git a/check_tests/eas_email_info_translator_test.c b/check_tests/eas_email_info_translator_test.c
index 9df117a..78aff75 100644
--- a/check_tests/eas_email_info_translator_test.c
+++ b/check_tests/eas_email_info_translator_test.c
@@ -42,7 +42,9 @@ static void test_eas_email_info_translator_add(const char* Serializeddata,const
long size;
gchar *buf;
//endregion
-g_type_init();
+#if !GLIB_CHECK_VERSION(2,36,0)
+ g_type_init();
+#endif
// check the XML file, did the XML file exists
size = pathconf(".", _PC_PATH_MAX);
if ((buf = (char *)malloc((size_t)size)) != NULL)
diff --git a/check_tests/eas_gobjects_unittests.c b/check_tests/eas_gobjects_unittests.c
index fb7c96c..e898d95 100644
--- a/check_tests/eas_gobjects_unittests.c
+++ b/check_tests/eas_gobjects_unittests.c
@@ -89,7 +89,9 @@ START_TEST (test_add_item_req_obj)
// initise G type library to allow use of G type objects which provide
// a higher level of programming syntax including the psuedo object
// oriented approach supported by G types
- g_type_init();
+#if !GLIB_CHECK_VERSION(2,36,0)
+ g_type_init();
+#endif
g_debug("gobject: EAS_TYPE_ADD_ITEM_REQ ++");
self_eas_add_item_req = g_object_new (EAS_TYPE_ADD_ITEM_REQ, NULL);
diff --git a/check_tests/eas_libeasmail_tests.c b/check_tests/eas_libeasmail_tests.c
index d5e5419..c76090f 100644
--- a/check_tests/eas_libeasmail_tests.c
+++ b/check_tests/eas_libeasmail_tests.c
@@ -1426,7 +1426,9 @@ START_TEST (test_eas_mail_get_item_estimate)
guint estimate = 0;
progress_loop = g_main_loop_new (NULL, FALSE);
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init(); // must call before calling g_cancellable_new
+#endif
g_thread_init (NULL);
testGetMailHandler (&email_handler, accountuid);
diff --git a/eas-daemon/libeas/eas-con-info-translator.c b/eas-daemon/libeas/eas-con-info-translator.c
index 23a3786..3a6e047 100644
--- a/eas-daemon/libeas/eas-con-info-translator.c
+++ b/eas-daemon/libeas/eas-con-info-translator.c
@@ -1149,7 +1149,9 @@ eas_con_info_translator_parse_request (xmlDocPtr doc,
g_debug ("eas_con_info_translator_parse_request ++");
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
vcard = e_vcard_new_from_string (contactInfo->data);
g_return_val_if_fail (vcard != NULL, FALSE);
diff --git a/eas-daemon/libeas/eas-connection.c b/eas-daemon/libeas/eas-connection.c
index b373fea..860dd10 100644
--- a/eas-daemon/libeas/eas-connection.c
+++ b/eas-daemon/libeas/eas-connection.c
@@ -1708,7 +1708,9 @@ eas_connection_autodiscover (const gchar* email,
g_debug ("eas_connection_autodiscover++");
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
dbus_g_thread_init();
if (!email) {
@@ -1820,7 +1822,9 @@ eas_connection_find (const gchar* accountId)
g_debug ("eas_connection_find++ : account_uid[%s]",
(accountId ? accountId : "NULL"));
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
dbus_g_thread_init();
if (!accountId) return NULL;
@@ -1890,7 +1894,9 @@ eas_connection_new (EasAccount* account, GError** error)
g_debug ("eas_connection_new++");
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
dbus_g_thread_init();
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
diff --git a/eas-daemon/src/activesyncd-server.c b/eas-daemon/src/activesyncd-server.c
index f58808b..1721786 100644
--- a/eas-daemon/src/activesyncd-server.c
+++ b/eas-daemon/src/activesyncd-server.c
@@ -170,7 +170,9 @@ int main (int argc, char** argv)
guint result;
GError* error = NULL;
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
dbus_g_thread_init();
#if 0
g_log_set_handler (NULL,
diff --git a/libeasaccount/tests/libeasaccount_test.c b/libeasaccount/tests/libeasaccount_test.c
index 8d01c09..750a3d4 100644
--- a/libeasaccount/tests/libeasaccount_test.c
+++ b/libeasaccount/tests/libeasaccount_test.c
@@ -305,7 +305,9 @@ int main (int argc, char** argv) {
g_print("main Starting.\n");
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
mainloop = g_main_loop_new(NULL, FALSE);
if (mainloop == NULL) {
diff --git a/libeasclient/libeasmail.c b/libeasclient/libeasmail.c
index c493e18..e6d3f6d 100644
--- a/libeasclient/libeasmail.c
+++ b/libeasclient/libeasmail.c
@@ -130,7 +130,9 @@ eas_mail_handler_new (const char* account_uid, GError **error)
EasEmailHandler *object = NULL;
EasEmailHandlerPrivate *priv = NULL;
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
/* Ick. See https://bugzilla.gnome.org/show_bug.cgi?id=662396 */
eas_connection_error_quark();
diff --git a/libeasclient/libeassync.c b/libeasclient/libeassync.c
index cebfcbd..c9febeb 100644
--- a/libeasclient/libeassync.c
+++ b/libeasclient/libeassync.c
@@ -123,7 +123,9 @@ eas_sync_handler_new (const gchar* account_uid)
GError* error = NULL;
EasSyncHandler *object = NULL;
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
g_debug ("eas_sync_handler_new++ : account_uid[%s]",
(account_uid ? account_uid : "NULL"));
diff --git a/libeastest/src/libeastest.c b/libeastest/src/libeastest.c
index 36247e7..e19c5a2 100644
--- a/libeastest/src/libeastest.c
+++ b/libeastest/src/libeastest.c
@@ -79,7 +79,9 @@ eas_test_handler_new (void)
GError* error = NULL;
EasTestHandler *self = NULL;
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
dbus_g_thread_init();
g_debug ("eas_test_handler_new++");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]