[gthumb] picasaweb: removed album creation



commit ece66b8b21cc57e92bca54a949b3af246754ea11
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Oct 26 16:56:05 2017 +0200

    picasaweb: removed album creation
    
    no longer supported by the google API

 .../picasaweb/data/ui/export-to-picasaweb.ui       |   34 +-------
 extensions/picasaweb/dlg-export-to-picasaweb.c     |   90 -----------------
 extensions/picasaweb/picasa-web-service.c          |  101 --------------------
 extensions/picasaweb/picasa-web-service.h          |    8 --
 4 files changed, 1 insertions(+), 232 deletions(-)
---
diff --git a/extensions/picasaweb/data/ui/export-to-picasaweb.ui 
b/extensions/picasaweb/data/ui/export-to-picasaweb.ui
index eb0c9c7..1b59413 100644
--- a/extensions/picasaweb/data/ui/export-to-picasaweb.ui
+++ b/extensions/picasaweb/data/ui/export-to-picasaweb.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.20.1 -->
 <interface>
   <requires lib="gtk+" version="3.0"/>
   <object class="GtkListStore" id="account_liststore">
@@ -301,38 +301,6 @@
                         <property name="position">0</property>
                       </packing>
                     </child>
-                    <child>
-                      <object class="GtkBox" id="vbox5">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="orientation">vertical</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <object class="GtkButton" id="add_album_button">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <child>
-                              <object class="GtkImage" id="image1">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="icon_name">list-add-symbolic</property>
-                              </object>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
                   </object>
                   <packing>
                     <property name="expand">True</property>
diff --git a/extensions/picasaweb/dlg-export-to-picasaweb.c b/extensions/picasaweb/dlg-export-to-picasaweb.c
index de5b25c..a342df3 100644
--- a/extensions/picasaweb/dlg-export-to-picasaweb.c
+++ b/extensions/picasaweb/dlg-export-to-picasaweb.c
@@ -296,92 +296,6 @@ update_album_list (DialogData *data)
 
 
 static void
-create_album_ready_cb (GObject      *source_object,
-                      GAsyncResult *result,
-                      gpointer      user_data)
-{
-       DialogData       *data = user_data;
-       PicasaWebService *picasaweb = PICASA_WEB_SERVICE (source_object);
-       PicasaWebAlbum   *album;
-       GError           *error = NULL;
-
-       album = picasa_web_service_create_album_finish (picasaweb, result, &error);
-       if (error != NULL) {
-               gth_task_dialog (GTH_TASK (data->service), TRUE, NULL);
-               _gtk_error_dialog_from_gerror_show (GTK_WINDOW (data->browser), _("Could not create the 
album"), error);
-               g_clear_error (&error);
-               return;
-       }
-
-       data->albums = g_list_append (data->albums, album);
-       update_album_list (data);
-}
-
-
-static void
-new_album_dialog_response_cb (GtkDialog *dialog,
-                             int        response_id,
-                             gpointer   user_data)
-{
-       DialogData *data = user_data;
-
-       switch (response_id) {
-       case GTK_RESPONSE_DELETE_EVENT:
-       case GTK_RESPONSE_CANCEL:
-               gtk_widget_destroy (GTK_WIDGET (dialog));
-               break;
-
-       case GTK_RESPONSE_OK:
-               {
-                       PicasaWebAlbum *album;
-
-                       album = picasa_web_album_new ();
-                       picasa_web_album_set_title (album, picasa_album_properties_dialog_get_name 
(PICASA_ALBUM_PROPERTIES_DIALOG (dialog)));
-                       album->access = picasa_album_properties_dialog_get_access 
(PICASA_ALBUM_PROPERTIES_DIALOG (dialog));
-                       picasa_web_service_create_album (data->service,
-                                                        album,
-                                                        data->cancellable,
-                                                        create_album_ready_cb,
-                                                        data);
-
-                       g_object_unref (album);
-               }
-               gtk_widget_destroy (GTK_WIDGET (dialog));
-               break;
-
-       default:
-               break;
-       }
-}
-
-
-static void
-add_album_button_clicked_cb (GtkButton *button,
-                            gpointer   user_data)
-{
-       DialogData *data = user_data;
-       GtkWidget  *dialog;
-
-       dialog = picasa_album_properties_dialog_new (g_file_info_get_edit_name (data->location->info),
-                                                    NULL,
-                                                    PICASA_WEB_ACCESS_PUBLIC);
-       g_signal_connect (dialog,
-                         "delete-event",
-                         G_CALLBACK (gtk_true),
-                         NULL);
-       g_signal_connect (dialog,
-                         "response",
-                         G_CALLBACK (new_album_dialog_response_cb),
-                         data);
-
-       gtk_window_set_title (GTK_WINDOW (dialog), _("New Album"));
-       gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (data->dialog));
-       gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
-       gtk_window_present (GTK_WINDOW (dialog));
-}
-
-
-static void
 edit_accounts_button_clicked_cb (GtkButton *button,
                                 gpointer   user_data)
 {
@@ -655,10 +569,6 @@ dlg_export_to_picasaweb (GthBrowser *browser,
                          "response",
                          G_CALLBACK (export_dialog_response_cb),
                          data);
-       g_signal_connect (GET_WIDGET ("add_album_button"),
-                         "clicked",
-                         G_CALLBACK (add_album_button_clicked_cb),
-                         data);
        g_signal_connect (GET_WIDGET ("edit_accounts_button"),
                          "clicked",
                          G_CALLBACK (edit_accounts_button_clicked_cb),
diff --git a/extensions/picasaweb/picasa-web-service.c b/extensions/picasaweb/picasa-web-service.c
index 93959b9..a7f247d 100644
--- a/extensions/picasaweb/picasa-web-service.c
+++ b/extensions/picasaweb/picasa-web-service.c
@@ -738,107 +738,6 @@ picasa_web_service_list_albums_finish (PicasaWebService  *service,
 }
 
 
-/* -- picasa_web_service_create_album -- */
-
-
-static void
-create_album_ready_cb (SoupSession *session,
-                      SoupMessage *msg,
-                      gpointer     user_data)
-{
-       PicasaWebService   *self = user_data;
-       GSimpleAsyncResult *result;
-       SoupBuffer         *body;
-       DomDocument        *doc;
-       GError             *error = NULL;
-
-       result = _web_service_get_result (WEB_SERVICE (self));
-
-       if (msg->status_code != 201) {
-               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);
-       doc = dom_document_new ();
-       if (dom_document_load (doc, body->data, body->length, &error)) {
-               PicasaWebAlbum *album;
-
-               album = picasa_web_album_new ();
-               dom_domizable_load_from_element (DOM_DOMIZABLE (album), DOM_ELEMENT (doc)->first_child);
-               g_simple_async_result_set_op_res_gpointer (result, album, (GDestroyNotify) g_object_unref);
-       }
-       else {
-               g_simple_async_result_set_from_error (result, error);
-               g_error_free (error);
-       }
-       g_simple_async_result_complete_in_idle (result);
-
-       g_object_unref (doc);
-       soup_buffer_free (body);
-}
-
-
-void
-picasa_web_service_create_album (PicasaWebService     *self,
-                                PicasaWebAlbum       *album,
-                                GCancellable         *cancellable,
-                                GAsyncReadyCallback   callback,
-                                gpointer              user_data)
-{
-       OAuthAccount *account;
-       DomDocument  *doc;
-       DomElement   *entry;
-       char         *buffer;
-       gsize         len;
-       char         *url;
-       SoupMessage  *msg;
-
-       account = web_service_get_current_account (WEB_SERVICE (self));
-       g_return_if_fail (account != NULL);
-
-       gth_task_progress (GTH_TASK (self), _("Creating the new album"), NULL, TRUE, 0.0);
-
-       doc = dom_document_new ();
-       entry = dom_domizable_create_element (DOM_DOMIZABLE (album), doc);
-       dom_element_append_child (DOM_ELEMENT (doc), entry);
-       buffer = dom_document_dump (doc, &len);
-
-       url = g_strconcat ("https://picasaweb.google.com/data/feed/api/user/";, account->id, NULL);
-       msg = soup_message_new ("POST", url);
-       soup_message_set_request (msg, ATOM_ENTRY_MIME_TYPE, SOUP_MEMORY_TAKE, buffer, len);
-       _picasa_web_service_add_headers (self, msg);
-       _web_service_send_message (WEB_SERVICE (self),
-                                  msg,
-                                  cancellable,
-                                  callback,
-                                  user_data,
-                                  picasa_web_service_create_album,
-                                  create_album_ready_cb,
-                                  self);
-
-       g_free (url);
-       g_object_unref (doc);
-}
-
-
-PicasaWebAlbum *
-picasa_web_service_create_album_finish (PicasaWebService  *service,
-                                       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)));
-}
-
-
 /* -- picasa_web_service_post_photos -- */
 
 
diff --git a/extensions/picasaweb/picasa-web-service.h b/extensions/picasaweb/picasa-web-service.h
index a2c59ea..44d7c61 100644
--- a/extensions/picasaweb/picasa-web-service.h
+++ b/extensions/picasaweb/picasa-web-service.h
@@ -62,14 +62,6 @@ void                 picasa_web_service_list_albums         (PicasaWebService
 GList *              picasa_web_service_list_albums_finish  (PicasaWebService     *self,
                                                             GAsyncResult         *result,
                                                             GError              **error);
-void                 picasa_web_service_create_album        (PicasaWebService     *self,
-                                                            PicasaWebAlbum       *album,
-                                                            GCancellable         *cancellable,
-                                                            GAsyncReadyCallback   callback,
-                                                            gpointer              user_data);
-PicasaWebAlbum *     picasa_web_service_create_album_finish (PicasaWebService     *self,
-                                                            GAsyncResult         *result,
-                                                            GError              **error);
 void                 picasa_web_service_post_photos         (PicasaWebService     *self,
                                                             PicasaWebAlbum       *album,
                                                             GList                *file_list, /* GFile list */


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