[libgdata] Bug 653530 — Bogus run-time warnings



commit 900a93016b00087dadf956e339c2b6a9201ce74f
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed Jun 29 09:07:14 2011 +0100

    Bug 653530 â Bogus run-time warnings
    
    Remove usage of g_simple_async_result_report_error_in_idle() because it fails
    to set a source tag. Instead, we build an async result ourselves with the
    correct source tag.
    
    Closes: bgo#653530

 gdata/services/calendar/gdata-calendar-service.c   |   35 +++++++++++++------
 gdata/services/contacts/gdata-contacts-service.c   |   18 +++++++---
 gdata/services/documents/gdata-documents-service.c |    9 +++--
 gdata/services/picasaweb/gdata-picasaweb-service.c |   18 +++++++---
 gdata/services/youtube/gdata-youtube-service.c     |    9 +++--
 5 files changed, 60 insertions(+), 29 deletions(-)
---
diff --git a/gdata/services/calendar/gdata-calendar-service.c b/gdata/services/calendar/gdata-calendar-service.c
index 240416a..75a0ac1 100644
--- a/gdata/services/calendar/gdata-calendar-service.c
+++ b/gdata/services/calendar/gdata-calendar-service.c
@@ -361,9 +361,12 @@ gdata_calendar_service_query_all_calendars_async (GDataCalendarService *self, GD
 	/* Ensure we're authenticated first */
 	if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)),
 	                                               get_calendar_authorization_domain ()) == FALSE) {
-		g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data,
-		                                     GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
-		                                     _("You must be authenticated to query all calendars."));
+		GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, gdata_service_query_async);
+		g_simple_async_result_set_error (result, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s",
+		                                 _("You must be authenticated to query all calendars."));
+		g_simple_async_result_complete_in_idle (result);
+		g_object_unref (result);
+
 		return;
 	}
 
@@ -455,9 +458,12 @@ gdata_calendar_service_query_own_calendars_async (GDataCalendarService *self, GD
 	/* Ensure we're authenticated first */
 	if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)),
 	                                               get_calendar_authorization_domain ()) == FALSE) {
-		g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data,
-		                                     GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
-		                                     _("You must be authenticated to query your own calendars."));
+		GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, gdata_service_query_async);
+		g_simple_async_result_set_error (result, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s",
+		                                 _("You must be authenticated to query your own calendars."));
+		g_simple_async_result_complete_in_idle (result);
+		g_object_unref (result);
+
 		return;
 	}
 
@@ -557,9 +563,12 @@ gdata_calendar_service_query_events_async (GDataCalendarService *self, GDataCale
 	/* Ensure we're authenticated first */
 	if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)),
 	                                               get_calendar_authorization_domain ()) == FALSE) {
-		g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data,
-		                                     GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
-		                                     _("You must be authenticated to query your own calendars."));
+		GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, gdata_service_query_async);
+		g_simple_async_result_set_error (result, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s",
+		                                 _("You must be authenticated to query your own calendars."));
+		g_simple_async_result_complete_in_idle (result);
+		g_object_unref (result);
+
 		return;
 	}
 
@@ -567,8 +576,12 @@ gdata_calendar_service_query_events_async (GDataCalendarService *self, GDataCale
 	uri = gdata_entry_get_content_uri (GDATA_ENTRY (calendar));
 	if (uri == NULL) {
 		/* Erroring out is probably the safest thing to do */
-		g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR,
-		                                     _("The calendar did not have a content URI."));
+		GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, gdata_service_query_async);
+		g_simple_async_result_set_error (result, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s",
+		                                 _("The calendar did not have a content URI."));
+		g_simple_async_result_complete_in_idle (result);
+		g_object_unref (result);
+
 		return;
 	}
 
diff --git a/gdata/services/contacts/gdata-contacts-service.c b/gdata/services/contacts/gdata-contacts-service.c
index 89bc712..6bbcac3 100644
--- a/gdata/services/contacts/gdata-contacts-service.c
+++ b/gdata/services/contacts/gdata-contacts-service.c
@@ -303,9 +303,12 @@ gdata_contacts_service_query_contacts_async (GDataContactsService *self, GDataQu
 	/* Ensure we're authenticated first */
 	if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)),
 	                                               get_contacts_authorization_domain ()) == FALSE) {
-		g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data,
-		                                     GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
-		                                     _("You must be authenticated to query contacts."));
+		GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, gdata_service_query_async);
+		g_simple_async_result_set_error (result, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s",
+		                                 _("You must be authenticated to query contacts."));
+		g_simple_async_result_complete_in_idle (result);
+		g_object_unref (result);
+
 		return;
 	}
 
@@ -466,9 +469,12 @@ gdata_contacts_service_query_groups_async (GDataContactsService *self, GDataQuer
 	/* Ensure we're authenticated first */
 	if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)),
 	                                               get_contacts_authorization_domain ()) == FALSE) {
-		g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data,
-		                                     GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
-		                                     _("You must be authenticated to query contact groups."));
+		GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, gdata_service_query_async);
+		g_simple_async_result_set_error (result, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s",
+		                                 _("You must be authenticated to query contact groups."));
+		g_simple_async_result_complete_in_idle (result);
+		g_object_unref (result);
+
 		return;
 	}
 
diff --git a/gdata/services/documents/gdata-documents-service.c b/gdata/services/documents/gdata-documents-service.c
index 5c00258..032152a 100644
--- a/gdata/services/documents/gdata-documents-service.c
+++ b/gdata/services/documents/gdata-documents-service.c
@@ -407,9 +407,12 @@ gdata_documents_service_query_documents_async (GDataDocumentsService *self, GDat
 	/* Ensure we're authenticated first */
 	if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)),
 	                                               get_documents_authorization_domain ()) == FALSE) {
-		g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data,
-		                                     GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
-		                                     _("You must be authenticated to query documents."));
+		GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, gdata_service_query_async);
+		g_simple_async_result_set_error (result, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s",
+		                                 _("You must be authenticated to query documents."));
+		g_simple_async_result_complete_in_idle (result);
+		g_object_unref (result);
+
 		return;
 	}
 
diff --git a/gdata/services/picasaweb/gdata-picasaweb-service.c b/gdata/services/picasaweb/gdata-picasaweb-service.c
index 1ba6123..919779c 100644
--- a/gdata/services/picasaweb/gdata-picasaweb-service.c
+++ b/gdata/services/picasaweb/gdata-picasaweb-service.c
@@ -350,17 +350,23 @@ gdata_picasaweb_service_query_all_albums_async (GDataPicasaWebService *self, GDa
 
 	if (query != NULL && gdata_query_get_q (query) != NULL) {
 		/* Bug #593336 â Query parameter "q=..." isn't valid for album kinds */
-		g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data,
-		                                     GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER,
-		                                     _("Query parameter not allowed for albums."));
+		GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, gdata_service_query_async);
+		g_simple_async_result_set_error (result, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_BAD_QUERY_PARAMETER, "%s",
+		                                 _("Query parameter not allowed for albums."));
+		g_simple_async_result_complete_in_idle (result);
+		g_object_unref (result);
+
 		return;
 	}
 
 	uri = create_uri (self, username, "feed");
 	if (uri == NULL) {
-		g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data,
-		                                     GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
-		                                     _("You must specify a username or be authenticated to query all albums."));
+		GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, gdata_service_query_async);
+		g_simple_async_result_set_error (result, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s",
+		                                 _("You must specify a username or be authenticated to query all albums."));
+		g_simple_async_result_complete_in_idle (result);
+		g_object_unref (result);
+
 		return;
 	}
 
diff --git a/gdata/services/youtube/gdata-youtube-service.c b/gdata/services/youtube/gdata-youtube-service.c
index 57bbdd3..dfcf6a1 100644
--- a/gdata/services/youtube/gdata-youtube-service.c
+++ b/gdata/services/youtube/gdata-youtube-service.c
@@ -776,9 +776,12 @@ gdata_youtube_service_query_related_async (GDataYouTubeService *self, GDataYouTu
 	related_link = gdata_entry_look_up_link (GDATA_ENTRY (video), "http://gdata.youtube.com/schemas/2007#video.related";);
 	if (related_link == NULL) {
 		/* Erroring out is probably the safest thing to do */
-		g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data,
-		                                     GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR,
-		                                     _("The video did not have a related videos <link>."));
+		GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, gdata_service_query_async);
+		g_simple_async_result_set_error (result, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, "%s",
+		                                 _("The video did not have a related videos <link>."));
+		g_simple_async_result_complete_in_idle (result);
+		g_object_unref (result);
+
 		return;
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]