[gthumb] [photobucket] removed unused code
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] [photobucket] removed unused code
- Date: Wed, 19 May 2010 18:53:42 +0000 (UTC)
commit 57f00a06e2aeacdb06d1a58b0adbc760d56d0e35
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue May 18 21:37:49 2010 +0200
[photobucket] removed unused code
extensions/photobucket/photobucket-service.c | 203 --------------------------
extensions/photobucket/photobucket-service.h | 17 --
2 files changed, 0 insertions(+), 220 deletions(-)
---
diff --git a/extensions/photobucket/photobucket-service.c b/extensions/photobucket/photobucket-service.c
index d67ea50..965107f 100644
--- a/extensions/photobucket/photobucket-service.c
+++ b/extensions/photobucket/photobucket-service.c
@@ -143,209 +143,6 @@ photobucket_service_new (OAuthConnection *conn)
}
-#if 0
-
-
-/* -- photobucket_service_get_user_info -- */
-
-
-static void
-get_logged_in_user_ready_cb (SoupSession *session,
- SoupMessage *msg,
- gpointer user_data)
-{
- PhotobucketService *self = user_data;
- GSimpleAsyncResult *result;
- SoupBuffer *body;
- DomDocument *doc = NULL;
- GError *error = NULL;
-
- result = oauth_connection_get_result (self->priv->conn);
-
- if (msg->status_code != 200) {
- g_simple_async_result_set_error (result,
- SOUP_HTTP_ERROR,
- msg->status_code,
- "%s",
- soup_status_get_phrase (msg->status_code));
- g_simple_async_result_complete_in_idle (result);
- return;
- }
-
- body = soup_message_body_flatten (msg->response_body);
- if (photobucket_utils_parse_response (body, &doc, result, &error)) {
- DomElement *root;
- char *uid = NULL;
-
- root = DOM_ELEMENT (doc)->first_child;
- if (g_strcmp0 (root->tag_name, "users_getLoggedInUser_response") == 0)
- uid = g_strdup (dom_element_get_inner_text (root));
-
- if (uid == NULL) {
- error = g_error_new_literal (OAUTH_CONNECTION_ERROR, 0, _("Unknown error"));
- g_simple_async_result_set_from_error (result, error);
- }
- else
- g_simple_async_result_set_op_res_gpointer (result, uid, g_free);
-
- g_object_unref (doc);
- }
- else
- g_simple_async_result_set_from_error (result, error);
-
- g_simple_async_result_complete_in_idle (result);
-
- soup_buffer_free (body);
-}
-
-
-void
-photobucket_service_get_logged_in_user (PhotobucketService *self,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- GHashTable *data_set;
- SoupMessage *msg;
-
- gth_task_progress (GTH_TASK (self->priv->conn), _("Connecting to the server"), _("Getting account information"), TRUE, 0.0);
-
- data_set = g_hash_table_new (g_str_hash, g_str_equal);
- g_hash_table_insert (data_set, "method", "photobucket.users.getLoggedInUser");
- oauth_connection_add_signature (self->priv->conn, "photobucket.users.getLoggedInUser", );
- msg = soup_form_request_new_from_hash ("POST", PHOTOBUCKET_HTTPS_REST_SERVER, data_set);
- oauth_connection_send_message (self->priv->conn,
- msg,
- cancellable,
- callback,
- user_data,
- photobucket_service_get_logged_in_user,
- get_logged_in_user_ready_cb,
- self);
-
- g_hash_table_destroy (data_set);
-}
-
-
-char *
-photobucket_service_get_logged_in_user_finish (PhotobucketService *self,
- GAsyncResult *result,
- GError **error)
-{
- if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error))
- return NULL;
- else
- return g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result)));
-}
-
-
-/* -- photobucket_service_get_user_info -- */
-
-
-static void
-get_user_info_ready_cb (SoupSession *session,
- SoupMessage *msg,
- gpointer user_data)
-{
- PhotobucketService *self = user_data;
- GSimpleAsyncResult *result;
- SoupBuffer *body;
- DomDocument *doc = NULL;
- GError *error = NULL;
-
- result = oauth_connection_get_result (self->priv->conn);
-
- if (msg->status_code != 200) {
- g_simple_async_result_set_error (result,
- SOUP_HTTP_ERROR,
- msg->status_code,
- "%s",
- soup_status_get_phrase (msg->status_code));
- g_simple_async_result_complete_in_idle (result);
- return;
- }
-
- body = soup_message_body_flatten (msg->response_body);
- if (photobucket_utils_parse_response (body, &doc, &error)) {
- DomElement *node;
- PhotobucketUser *user = NULL;
-
- for (node = DOM_ELEMENT (doc)->first_child; node; node = node->next_sibling) {
- if (g_strcmp0 (node->tag_name, "users_getInfo_response") == 0) {
- DomElement *child;
-
- for (child = node->first_child; child; child = child->next_sibling) {
- if (g_strcmp0 (child->tag_name, "user") == 0) {
- user = photobucket_user_new ();
- dom_domizable_load_from_element (DOM_DOMIZABLE (user), child);
- g_simple_async_result_set_op_res_gpointer (result, user, (GDestroyNotify) g_object_unref);
- }
- }
- }
- }
-
- if (user == NULL) {
- error = g_error_new_literal (OAUTH_CONNECTION_ERROR, 0, _("Unknown error"));
- g_simple_async_result_set_from_error (result, error);
- }
-
- g_object_unref (doc);
- }
- else
- g_simple_async_result_set_from_error (result, error);
-
- g_simple_async_result_complete_in_idle (result);
-
- soup_buffer_free (body);
-}
-
-
-void
-photobucket_service_get_user_info (PhotobucketService *self,
- const char *fields,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- GHashTable *data_set;
- SoupMessage *msg;
-
- gth_task_progress (GTH_TASK (self->priv->conn), _("Connecting to the server"), _("Getting account information"), TRUE, 0.0);
-
- data_set = g_hash_table_new (g_str_hash, g_str_equal);
- g_hash_table_insert (data_set, "method", "photobucket.users.getInfo");
- g_hash_table_insert (data_set, "uids", (char *) oauth_connection_get_user_id (self->priv->conn));
- g_hash_table_insert (data_set, "fields", (char *) fields);
- oauth_connection_add_api_sig (self->priv->conn, data_set);
- msg = soup_form_request_new_from_hash ("POST", PHOTOBUCKET_HTTPS_REST_SERVER, data_set);
- oauth_connection_send_message (self->priv->conn,
- msg,
- cancellable,
- callback,
- user_data,
- photobucket_service_get_user_info,
- get_user_info_ready_cb,
- self);
-
- g_hash_table_destroy (data_set);
-}
-
-
-PhotobucketUser *
-photobucket_service_get_user_info_finish (PhotobucketService *self,
- GAsyncResult *result,
- GError **error)
-{
- if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error))
- return NULL;
- else
- return g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result)));
-}
-
-
-#endif
-
-
/* -- photobucket_service_get_albums -- */
diff --git a/extensions/photobucket/photobucket-service.h b/extensions/photobucket/photobucket-service.h
index fb54680..af51d5c 100644
--- a/extensions/photobucket/photobucket-service.h
+++ b/extensions/photobucket/photobucket-service.h
@@ -52,23 +52,6 @@ struct _PhotobucketServiceClass
GType photobucket_service_get_type (void) G_GNUC_CONST;
PhotobucketService * photobucket_service_new (OAuthConnection *conn);
-#if 0
-void photobucket_service_get_logged_in_user (PhotobucketService *self,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-char * photobucket_service_get_logged_in_user_finish (PhotobucketService *self,
- GAsyncResult *result,
- GError **error);
-void photobucket_service_get_user_info (PhotobucketService *self,
- const char *fields,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-PhotobucketUser * photobucket_service_get_user_info_finish (PhotobucketService *self,
- GAsyncResult *result,
- GError **error);
-#endif
void photobucket_service_get_albums (PhotobucketService *self,
PhotobucketAccount *account,
GCancellable *cancellable,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]