Blame SOURCES/0001-Remove-Facebook-Flickr-and-Google-support.patch

a2e38e
From ec6ed17f9e55b73e7bf42cf9e119d6c2504e58ba Mon Sep 17 00:00:00 2001
a2e38e
From: Debarshi Ray <debarshir@gnome.org>
a2e38e
Date: Fri, 23 Apr 2021 02:54:59 +0200
a2e38e
Subject: [PATCH] Remove Facebook, Flickr and Google support
a2e38e
a2e38e
In theory, support for Facebook, Flickr and Google is still desired.
a2e38e
However, right now Facebook and Google are completely broken, and the
a2e38e
Grilo code used for Flickr support has code quality issues.
a2e38e
a2e38e
https://bugzilla.redhat.com/show_bug.cgi?id=1913641
a2e38e
---
a2e38e
 meson.build                     |   3 -
a2e38e
 src/meson.build                 |   7 -
a2e38e
 src/photos-application.c        |  24 --
a2e38e
 src/photos-facebook-item.c      | 339 ---------------------
a2e38e
 src/photos-facebook-item.h      |  36 ---
a2e38e
 src/photos-flickr-item.c        | 407 -------------------------
a2e38e
 src/photos-flickr-item.h        |  35 ---
a2e38e
 src/photos-google-item.c        | 349 ---------------------
a2e38e
 src/photos-google-item.h        |  36 ---
a2e38e
 src/photos-share-point-google.c | 516 --------------------------------
a2e38e
 src/photos-share-point-google.h |  35 ---
a2e38e
 src/photos-utils.c              |   8 -
a2e38e
 12 files changed, 1795 deletions(-)
a2e38e
 delete mode 100644 src/photos-facebook-item.c
a2e38e
 delete mode 100644 src/photos-facebook-item.h
a2e38e
 delete mode 100644 src/photos-flickr-item.c
a2e38e
 delete mode 100644 src/photos-flickr-item.h
a2e38e
 delete mode 100644 src/photos-google-item.c
a2e38e
 delete mode 100644 src/photos-google-item.h
a2e38e
 delete mode 100644 src/photos-share-point-google.c
a2e38e
 delete mode 100644 src/photos-share-point-google.h
a2e38e
a2e38e
diff --git a/meson.build b/meson.build
a2e38e
index ee1ca0dd3080..0d8ca768da1d 100644
a2e38e
--- a/meson.build
a2e38e
+++ b/meson.build
a2e38e
@@ -166,13 +166,10 @@ goa_dep = dependency('goa-1.0', version: '>= 3.8.0')
a2e38e
 config_h.set('GOA_API_IS_SUBJECT_TO_CHANGE', true)
a2e38e
 
a2e38e
 gobject_dep = dependency('gobject-2.0')
a2e38e
-grilo_dep = dependency('grilo-0.3', version: '>= 0.3.5')
a2e38e
 gsettings_desktop_schemas_dep = dependency('gsettings-desktop-schemas')
a2e38e
 gtk_dep = dependency('gtk+-3.0', version: '>= 3.22.16')
a2e38e
 gtk_unix_print_dep = dependency('gtk+-unix-print-3.0')
a2e38e
 libdazzle_dep = dependency('libdazzle-1.0', version: '>= 3.26.0')
a2e38e
-libgdata_dep = dependency('libgdata', version: '>= 0.17.13')
a2e38e
-libgfgraph_dep = dependency('libgfbgraph-0.2', version: '>= 0.2.1')
a2e38e
 libhandy_dep = dependency ('libhandy-1', version: '>= 1.1.90')
a2e38e
 libjpeg_dep = dependency('libjpeg')
a2e38e
 libpng_dep = dependency('libpng16')
a2e38e
diff --git a/src/meson.build b/src/meson.build
a2e38e
index 154f7d528814..becaa9cb480f 100644
a2e38e
--- a/src/meson.build
a2e38e
+++ b/src/meson.build
a2e38e
@@ -130,15 +130,12 @@ sources = common_sources + files(
a2e38e
   'photos-embed.c',
a2e38e
   'photos-empty-results-box.c',
a2e38e
   'photos-error-box.c',
a2e38e
-  'photos-facebook-item.c',
a2e38e
   'photos-fetch-collection-state-job.c',
a2e38e
   'photos-fetch-collections-job.c',
a2e38e
   'photos-fetch-ids-job.c',
a2e38e
   'photos-fetch-metas-job.c',
a2e38e
   'photos-filterable.c',
a2e38e
-  'photos-flickr-item.c',
a2e38e
   'photos-gesture-zoom.c',
a2e38e
-  'photos-google-item.c',
a2e38e
   'photos-image-view.c',
a2e38e
   'photos-image-view-helper.c',
a2e38e
   'photos-import-dialog.c',
a2e38e
@@ -188,7 +185,6 @@ sources = common_sources + files(
a2e38e
   'photos-share-notification.c',
a2e38e
   'photos-share-point.c',
a2e38e
   'photos-share-point-email.c',
a2e38e
-  'photos-share-point-google.c',
a2e38e
   'photos-share-point-manager.c',
a2e38e
   'photos-share-point-online.c',
a2e38e
   'photos-single-item-job.c',
a2e38e
@@ -387,13 +383,10 @@ deps = common_deps + [
a2e38e
   geocode_glib_dep,
a2e38e
   gexiv_dep,
a2e38e
   goa_dep,
a2e38e
-  grilo_dep,
a2e38e
   gsettings_desktop_schemas_dep,
a2e38e
   gtk_dep,
a2e38e
   gtk_unix_print_dep,
a2e38e
   libgd_dep,
a2e38e
-  libgdata_dep,
a2e38e
-  libgfgraph_dep,
a2e38e
   libhandy_dep,
a2e38e
   m_dep,
a2e38e
   tracker_sparql_dep,
a2e38e
diff --git a/src/photos-application.c b/src/photos-application.c
a2e38e
index 9017fd3ef621..83ec1ad65916 100644
a2e38e
--- a/src/photos-application.c
a2e38e
+++ b/src/photos-application.c
a2e38e
@@ -35,7 +35,6 @@
a2e38e
 #include <gio/gio.h>
a2e38e
 #include <glib.h>
a2e38e
 #include <glib/gi18n.h>
a2e38e
-#include <grilo.h>
a2e38e
 #include <handy.h>
a2e38e
 #include <tracker-sparql.h>
a2e38e
 
a2e38e
@@ -2586,11 +2585,9 @@ static void
a2e38e
 photos_application_startup (GApplication *application)
a2e38e
 {
a2e38e
   PhotosApplication *self = PHOTOS_APPLICATION (application);
a2e38e
-  GrlRegistry *registry;
a2e38e
   GtkIconTheme *icon_theme;
a2e38e
   GtkSettings *settings;
a2e38e
   GVariant *state;
a2e38e
-  gboolean grl_plugins_loaded;
a2e38e
   const gchar *delete_accels[3] = {"Delete", "KP_Delete", NULL};
a2e38e
   const gchar *edit_accels[2] = {"<Primary>e", NULL};
a2e38e
   const gchar *fullscreen_accels[2] = {"F11", NULL};
a2e38e
@@ -2613,27 +2610,6 @@ photos_application_startup (GApplication *application)
a2e38e
 
a2e38e
   photos_gegl_init ();
a2e38e
 
a2e38e
-  grl_init (NULL, NULL);
a2e38e
-  registry = grl_registry_get_default ();
a2e38e
-
a2e38e
-  {
a2e38e
-    g_autoptr (GError) error = NULL;
a2e38e
-
a2e38e
-    grl_plugins_loaded = grl_registry_load_all_plugins (registry, FALSE, &error);
a2e38e
-    if (error != NULL)
a2e38e
-      g_warning ("Unable to load Grilo plugins: %s", error->message);
a2e38e
-  }
a2e38e
-
a2e38e
-  if (grl_plugins_loaded)
a2e38e
-    {
a2e38e
-      {
a2e38e
-        g_autoptr (GError) error = NULL;
a2e38e
-
a2e38e
-        if (!grl_registry_activate_plugin_by_id (registry, "grl-flickr", &error))
a2e38e
-          g_warning ("Unable to activate Grilo's Flickr plugin: %s", error->message);
a2e38e
-      }
a2e38e
-    }
a2e38e
-
a2e38e
   self->create_window_cancellable = g_cancellable_new ();
a2e38e
   self->refresh_miner_ids = g_hash_table_new (g_direct_hash, g_direct_equal);
a2e38e
 
a2e38e
diff --git a/src/photos-facebook-item.c b/src/photos-facebook-item.c
a2e38e
deleted file mode 100644
a2e38e
index 9053550a0409..000000000000
a2e38e
--- a/src/photos-facebook-item.c
a2e38e
+++ /dev/null
a2e38e
@@ -1,339 +0,0 @@
a2e38e
-/*
a2e38e
- * Photos - access, organize and share your photos on GNOME
a2e38e
- * Copyright © 2013 Álvaro Peña
a2e38e
- * Copyright © 2014 – 2019 Red Hat, Inc.
a2e38e
- *
a2e38e
- * This program is free software: you can redistribute it and/or modify
a2e38e
- * it under the terms of the GNU General Public License as published by
a2e38e
- * the Free Software Foundation, either version 3 of the License, or
a2e38e
- * (at your option) any later version.
a2e38e
- *
a2e38e
- * This program is distributed in the hope that it will be useful,
a2e38e
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
a2e38e
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a2e38e
- * GNU General Public License for more details.
a2e38e
- *
a2e38e
- * You should have received a copy of the GNU General Public License
a2e38e
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
a2e38e
- */
a2e38e
-
a2e38e
-/* Based on code from:
a2e38e
- *   + Documents
a2e38e
- */
a2e38e
-
a2e38e
-
a2e38e
-#include "config.h"
a2e38e
-
a2e38e
-#include <gfbgraph/gfbgraph.h>
a2e38e
-#include <gfbgraph/gfbgraph-goa-authorizer.h>
a2e38e
-#include <gio/gio.h>
a2e38e
-#include <glib.h>
a2e38e
-#include <glib/gi18n.h>
a2e38e
-#include <goa/goa.h>
a2e38e
-
a2e38e
-#include "photos-base-manager.h"
a2e38e
-#include "photos-debug.h"
a2e38e
-#include "photos-error.h"
a2e38e
-#include "photos-facebook-item.h"
a2e38e
-#include "photos-search-context.h"
a2e38e
-#include "photos-source.h"
a2e38e
-#include "photos-utils.h"
a2e38e
-
a2e38e
-
a2e38e
-struct _PhotosFacebookItem
a2e38e
-{
a2e38e
-  PhotosBaseItem parent_instance;
a2e38e
-  PhotosBaseManager *src_mngr;
a2e38e
-};
a2e38e
-
a2e38e
-
a2e38e
-G_DEFINE_TYPE_WITH_CODE (PhotosFacebookItem, photos_facebook_item, PHOTOS_TYPE_BASE_ITEM,
a2e38e
-                         photos_utils_ensure_extension_points ();
a2e38e
-                         g_io_extension_point_implement (PHOTOS_BASE_ITEM_EXTENSION_POINT_NAME,
a2e38e
-                                                         g_define_type_id,
a2e38e
-                                                         "facebook",
a2e38e
-                                                         0));
a2e38e
-
a2e38e
-
a2e38e
-static gchar *
a2e38e
-photos_facebook_item_create_filename_fallback (PhotosBaseItem *item)
a2e38e
-{
a2e38e
-  const gchar *const facebook_prefix = "facebook:";
a2e38e
-  const gchar *identifier;
a2e38e
-  const gchar *mime_type;
a2e38e
-  g_autofree gchar *extension = NULL;
a2e38e
-  gchar *ret_val;
a2e38e
-  gsize prefix_len;
a2e38e
-
a2e38e
-  prefix_len = strlen (facebook_prefix);
a2e38e
-  identifier = photos_base_item_get_identifier (item) + prefix_len;
a2e38e
-  mime_type = photos_base_item_get_mime_type (item);
a2e38e
-  extension = photos_utils_get_extension_from_mime_type (mime_type);
a2e38e
-  if (extension == NULL)
a2e38e
-    extension = g_strdup ("tmp");
a2e38e
-
a2e38e
-  ret_val = g_strdup_printf ("%s.%s", identifier, extension);
a2e38e
-
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static gchar *
a2e38e
-photos_facebook_item_create_name_fallback (PhotosBaseItem *item)
a2e38e
-{
a2e38e
-  PhotosFacebookItem *self = PHOTOS_FACEBOOK_ITEM (item);
a2e38e
-  g_autoptr (GDateTime) date_modified = NULL;
a2e38e
-  const gchar *provider_name;
a2e38e
-  g_autofree gchar *date_modified_str = NULL;
a2e38e
-  gchar *ret_val;
a2e38e
-  gint64 mtime;
a2e38e
-
a2e38e
-  provider_name = photos_utils_get_provider_name (self->src_mngr, item);
a2e38e
-
a2e38e
-  mtime = photos_base_item_get_mtime (item);
a2e38e
-  date_modified = g_date_time_new_from_unix_local (mtime);
a2e38e
-  date_modified_str = g_date_time_format (date_modified, "%x");
a2e38e
-
a2e38e
-  /* Translators: this is the fallback title in the form
a2e38e
-   * "Facebook — 2nd January 2013".
a2e38e
-   */
a2e38e
-  ret_val = g_strdup_printf (_("%s — %s"), provider_name, date_modified_str);
a2e38e
-
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static GFBGraphPhoto *
a2e38e
-photos_facebook_get_gfbgraph_photo (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
a2e38e
-{
a2e38e
-  PhotosFacebookItem *self = PHOTOS_FACEBOOK_ITEM (item);
a2e38e
-  GFBGraphGoaAuthorizer *authorizer = NULL; /* TODO: use g_autoptr */
a2e38e
-  GFBGraphPhoto *photo = NULL;
a2e38e
-  GoaObject *object;
a2e38e
-  PhotosSource *source;
a2e38e
-  const gchar *const facebook_prefix = "facebook:";
a2e38e
-  const gchar *identifier;
a2e38e
-  const gchar *resource_urn;
a2e38e
-  gsize prefix_len;
a2e38e
-
a2e38e
-  resource_urn = photos_base_item_get_resource_urn (item);
a2e38e
-  source = PHOTOS_SOURCE (photos_base_manager_get_object_by_id (self->src_mngr, resource_urn));
a2e38e
-  object = photos_source_get_goa_object (source);
a2e38e
-  authorizer = gfbgraph_goa_authorizer_new (object);
a2e38e
-
a2e38e
-  if (!gfbgraph_authorizer_refresh_authorization (GFBGRAPH_AUTHORIZER (authorizer), cancellable, error))
a2e38e
-    goto out;
a2e38e
-
a2e38e
-  prefix_len = strlen (facebook_prefix);
a2e38e
-  identifier = photos_base_item_get_identifier (item) + prefix_len;
a2e38e
-  photo = gfbgraph_photo_new_from_id (GFBGRAPH_AUTHORIZER (authorizer), identifier, error);
a2e38e
-
a2e38e
- out:
a2e38e
-  g_clear_object (&authorizer);
a2e38e
-  return photo;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static gboolean
a2e38e
-photos_facebook_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
a2e38e
-{
a2e38e
-  g_autoptr (GFile) local_file = NULL;
a2e38e
-  g_autoptr (GFile) remote_file = NULL;
a2e38e
-  GFBGraphPhoto *photo = NULL; /* TODO: use g_autoptr */
a2e38e
-  const GFBGraphPhotoImage *thumbnail_image;
a2e38e
-  gboolean ret_val = FALSE;
a2e38e
-  const gchar *uri;
a2e38e
-  g_autofree gchar *local_dir = NULL;
a2e38e
-  g_autofree gchar *local_path = NULL;
a2e38e
-  gint64 height;
a2e38e
-  gint64 width;
a2e38e
-  guint size;
a2e38e
-
a2e38e
-  photo = photos_facebook_get_gfbgraph_photo (item, cancellable, error);
a2e38e
-  if (photo == NULL)
a2e38e
-    goto out;
a2e38e
-
a2e38e
-  size = (guint) photos_utils_get_icon_size ();
a2e38e
-  thumbnail_image = gfbgraph_photo_get_image_near_width (photo, size);
a2e38e
-  if (thumbnail_image == NULL)
a2e38e
-    {
a2e38e
-      g_set_error (error, PHOTOS_ERROR, 0, "Failed to find an image for the thumbnail");
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
-  remote_file = g_file_new_for_uri (thumbnail_image->source);
a2e38e
-
a2e38e
-  local_path = photos_base_item_create_thumbnail_path (item);
a2e38e
-  local_file = g_file_new_for_path (local_path);
a2e38e
-  local_dir = g_path_get_dirname (local_path);
a2e38e
-  g_mkdir_with_parents (local_dir, 0700);
a2e38e
-
a2e38e
-  uri = photos_base_item_get_uri (item);
a2e38e
-
a2e38e
-  height = photos_base_item_get_height (item);
a2e38e
-  width = photos_base_item_get_width (item);
a2e38e
-
a2e38e
-  photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Facebook to %s", thumbnail_image->source, local_path);
a2e38e
-  if (!photos_utils_file_copy_as_thumbnail (remote_file,
a2e38e
-                                            local_file,
a2e38e
-                                            uri,
a2e38e
-                                            height,
a2e38e
-                                            width,
a2e38e
-                                            cancellable,
a2e38e
-                                            error))
a2e38e
-    goto out;
a2e38e
-
a2e38e
-  ret_val = TRUE;
a2e38e
-
a2e38e
- out:
a2e38e
-  g_clear_object (&photo);
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static GFile *
a2e38e
-photos_facebook_item_download (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
a2e38e
-{
a2e38e
-  GFile *ret_val = NULL;
a2e38e
-  g_autoptr (GFile) local_file = NULL;
a2e38e
-  g_autoptr (GFile) remote_file = NULL;
a2e38e
-  GFBGraphPhoto *photo = NULL; /* TODO: use g_autoptr */
a2e38e
-  const GFBGraphPhotoImage *higher_image;
a2e38e
-  const gchar *cache_dir;
a2e38e
-  const gchar *local_filename;
a2e38e
-  g_autofree gchar *local_dir = NULL;
a2e38e
-  g_autofree gchar *local_path = NULL;
a2e38e
-
a2e38e
-  cache_dir = g_get_user_cache_dir ();
a2e38e
-  local_dir = g_build_filename (cache_dir, PACKAGE_TARNAME, "facebook", NULL);
a2e38e
-  g_mkdir_with_parents (local_dir, 0700);
a2e38e
-
a2e38e
-  local_filename = photos_base_item_get_filename (item);
a2e38e
-  local_path = g_build_filename (local_dir, local_filename, NULL);
a2e38e
-  local_file = g_file_new_for_path (local_path);
a2e38e
-  if (g_file_test (local_path, G_FILE_TEST_EXISTS))
a2e38e
-    goto end;
a2e38e
-
a2e38e
-  photo = photos_facebook_get_gfbgraph_photo (item, cancellable, error);
a2e38e
-  if (photo == NULL)
a2e38e
-    goto out;
a2e38e
-
a2e38e
-  higher_image = gfbgraph_photo_get_image_hires (photo);
a2e38e
-  if (higher_image == NULL)
a2e38e
-    {
a2e38e
-      g_set_error (error, PHOTOS_ERROR, 0, "Failed to find a high resolution image");
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
-  remote_file = g_file_new_for_uri (higher_image->source);
a2e38e
-
a2e38e
-  photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Facebook to %s", higher_image->source, local_path);
a2e38e
-  if (!g_file_copy (remote_file,
a2e38e
-                    local_file,
a2e38e
-                    G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
a2e38e
-                    cancellable,
a2e38e
-                    NULL,
a2e38e
-                    NULL,
a2e38e
-                    error))
a2e38e
-    {
a2e38e
-      g_file_delete (local_file, NULL, NULL);
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
- end:
a2e38e
-  ret_val = g_object_ref (local_file);
a2e38e
-
a2e38e
- out:
a2e38e
-  g_clear_object (&photo);
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static GtkWidget *
a2e38e
-photos_facebook_item_get_source_widget (PhotosBaseItem *item)
a2e38e
-{
a2e38e
-  PhotosFacebookItem *self = PHOTOS_FACEBOOK_ITEM (item);
a2e38e
-  GtkWidget *source_widget;
a2e38e
-  const gchar *name;
a2e38e
-
a2e38e
-  name = photos_utils_get_provider_name (self->src_mngr, item);
a2e38e
-  source_widget = gtk_link_button_new_with_label ("https://www.facebook.com/", name);
a2e38e
-  gtk_widget_set_halign (source_widget, GTK_ALIGN_START);
a2e38e
-
a2e38e
-  return source_widget;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-/* TODO */
a2e38e
-static void
a2e38e
-photos_facebook_item_open (PhotosBaseItem *item, GtkWindow *parent, guint32 timestamp)
a2e38e
-{
a2e38e
-  const gchar *facebook_uri;
a2e38e
-
a2e38e
-  facebook_uri = photos_base_item_get_uri (item);
a2e38e
-
a2e38e
-  {
a2e38e
-    g_autoptr (GError) error = NULL;
a2e38e
-
a2e38e
-    gtk_show_uri_on_window (parent, facebook_uri, timestamp, &error);
a2e38e
-    if (error != NULL)
a2e38e
-      g_warning ("Unable to show URI %s: %s", facebook_uri, error->message);
a2e38e
-  }
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_facebook_item_constructed (GObject *object)
a2e38e
-{
a2e38e
-  PhotosFacebookItem *self = PHOTOS_FACEBOOK_ITEM (object);
a2e38e
-  const gchar *name;
a2e38e
-
a2e38e
-  G_OBJECT_CLASS (photos_facebook_item_parent_class)->constructed (object);
a2e38e
-
a2e38e
-  name = photos_utils_get_provider_name (self->src_mngr, PHOTOS_BASE_ITEM (self));
a2e38e
-  photos_base_item_set_default_app_name (PHOTOS_BASE_ITEM (self), name);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_facebook_item_dispose (GObject *object)
a2e38e
-{
a2e38e
-  PhotosFacebookItem *self = PHOTOS_FACEBOOK_ITEM (object);
a2e38e
-
a2e38e
-  g_clear_object (&self->src_mngr);
a2e38e
-
a2e38e
-  G_OBJECT_CLASS (photos_facebook_item_parent_class)->dispose (object);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_facebook_item_init (PhotosFacebookItem *self)
a2e38e
-{
a2e38e
-  GApplication *app;
a2e38e
-  PhotosSearchContextState *state;
a2e38e
-
a2e38e
-  app = g_application_get_default ();
a2e38e
-  state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
a2e38e
-
a2e38e
-  self->src_mngr = g_object_ref (state->src_mngr);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_facebook_item_class_init (PhotosFacebookItemClass *class)
a2e38e
-{
a2e38e
-  GObjectClass *object_class = G_OBJECT_CLASS (class);
a2e38e
-  PhotosBaseItemClass *base_item_class = PHOTOS_BASE_ITEM_CLASS (class);
a2e38e
-
a2e38e
-  base_item_class->miner_name = "org.gnome.OnlineMiners.Facebook";
a2e38e
-  base_item_class->miner_object_path = "/org/gnome/OnlineMiners/Facebook";
a2e38e
-
a2e38e
-  object_class->constructed = photos_facebook_item_constructed;
a2e38e
-  object_class->dispose = photos_facebook_item_dispose;
a2e38e
-  base_item_class->create_filename_fallback = photos_facebook_item_create_filename_fallback;
a2e38e
-  base_item_class->create_name_fallback = photos_facebook_item_create_name_fallback;
a2e38e
-  base_item_class->create_thumbnail = photos_facebook_item_create_thumbnail;
a2e38e
-  base_item_class->download = photos_facebook_item_download;
a2e38e
-  base_item_class->get_source_widget = photos_facebook_item_get_source_widget;
a2e38e
-  base_item_class->open = photos_facebook_item_open;
a2e38e
-}
a2e38e
diff --git a/src/photos-facebook-item.h b/src/photos-facebook-item.h
a2e38e
deleted file mode 100644
a2e38e
index 7d4a4924769b..000000000000
a2e38e
--- a/src/photos-facebook-item.h
a2e38e
+++ /dev/null
a2e38e
@@ -1,36 +0,0 @@
a2e38e
-/*
a2e38e
- * Photos - access, organize and share your photos on GNOME
a2e38e
- * Copyright © 2013 Álvaro Peña
a2e38e
- * Copyright © 2016 – 2019 Red Hat, Inc.
a2e38e
- *
a2e38e
- * This program is free software: you can redistribute it and/or modify
a2e38e
- * it under the terms of the GNU General Public License as published by
a2e38e
- * the Free Software Foundation, either version 3 of the License, or
a2e38e
- * (at your option) any later version.
a2e38e
- *
a2e38e
- * This program is distributed in the hope that it will be useful,
a2e38e
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
a2e38e
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a2e38e
- * GNU General Public License for more details.
a2e38e
- *
a2e38e
- * You should have received a copy of the GNU General Public License
a2e38e
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
a2e38e
- */
a2e38e
-
a2e38e
-/* Based on code from:
a2e38e
- *   + Documents
a2e38e
- */
a2e38e
-
a2e38e
-#ifndef PHOTOS_FACEBOOK_ITEM_H
a2e38e
-#define PHOTOS_FACEBOOK_ITEM_H
a2e38e
-
a2e38e
-#include "photos-base-item.h"
a2e38e
-
a2e38e
-G_BEGIN_DECLS
a2e38e
-
a2e38e
-#define PHOTOS_TYPE_FACEBOOK_ITEM (photos_facebook_item_get_type ())
a2e38e
-G_DECLARE_FINAL_TYPE (PhotosFacebookItem, photos_facebook_item, PHOTOS, FACEBOOK_ITEM, PhotosBaseItem);
a2e38e
-
a2e38e
-G_END_DECLS
a2e38e
-
a2e38e
-#endif /* PHOTOS_FACEBOOK_ITEM_H */
a2e38e
diff --git a/src/photos-flickr-item.c b/src/photos-flickr-item.c
a2e38e
deleted file mode 100644
a2e38e
index b9f81d7c04c5..000000000000
a2e38e
--- a/src/photos-flickr-item.c
a2e38e
+++ /dev/null
a2e38e
@@ -1,407 +0,0 @@
a2e38e
-/*
a2e38e
- * Photos - access, organize and share your photos on GNOME
a2e38e
- * Copyright © 2013 – 2019 Red Hat, Inc.
a2e38e
- *
a2e38e
- * This program is free software: you can redistribute it and/or modify
a2e38e
- * it under the terms of the GNU General Public License as published by
a2e38e
- * the Free Software Foundation, either version 3 of the License, or
a2e38e
- * (at your option) any later version.
a2e38e
- *
a2e38e
- * This program is distributed in the hope that it will be useful,
a2e38e
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
a2e38e
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a2e38e
- * GNU General Public License for more details.
a2e38e
- *
a2e38e
- * You should have received a copy of the GNU General Public License
a2e38e
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
a2e38e
- */
a2e38e
-
a2e38e
-/* Based on code from:
a2e38e
- *   + Documents
a2e38e
- */
a2e38e
-
a2e38e
-
a2e38e
-#include "config.h"
a2e38e
-
a2e38e
-#include <string.h>
a2e38e
-
a2e38e
-#include <gio/gio.h>
a2e38e
-#include <glib.h>
a2e38e
-#include <glib/gi18n.h>
a2e38e
-#include <goa/goa.h>
a2e38e
-#include <grilo.h>
a2e38e
-
a2e38e
-#include "photos-base-manager.h"
a2e38e
-#include "photos-debug.h"
a2e38e
-#include "photos-error.h"
a2e38e
-#include "photos-flickr-item.h"
a2e38e
-#include "photos-search-context.h"
a2e38e
-#include "photos-source.h"
a2e38e
-#include "photos-utils.h"
a2e38e
-
a2e38e
-
a2e38e
-struct _PhotosFlickrItem
a2e38e
-{
a2e38e
-  PhotosBaseItem parent_instance;
a2e38e
-  PhotosBaseManager *src_mngr;
a2e38e
-};
a2e38e
-
a2e38e
-
a2e38e
-G_DEFINE_TYPE_WITH_CODE (PhotosFlickrItem, photos_flickr_item, PHOTOS_TYPE_BASE_ITEM,
a2e38e
-                         photos_utils_ensure_extension_points ();
a2e38e
-                         g_io_extension_point_implement (PHOTOS_BASE_ITEM_EXTENSION_POINT_NAME,
a2e38e
-                                                         g_define_type_id,
a2e38e
-                                                         "flickr",
a2e38e
-                                                         0));
a2e38e
-
a2e38e
-
a2e38e
-typedef struct _PhotosFlickrItemSyncData PhotosFlickrItemSyncData;
a2e38e
-
a2e38e
-struct _PhotosFlickrItemSyncData
a2e38e
-{
a2e38e
-  GError **error;
a2e38e
-  GMainLoop *loop;
a2e38e
-  gboolean op_res;
a2e38e
-};
a2e38e
-
a2e38e
-
a2e38e
-static gchar *
a2e38e
-photos_flickr_item_create_filename_fallback (PhotosBaseItem *item)
a2e38e
-{
a2e38e
-  g_autoptr (GFile) file = NULL;
a2e38e
-  const gchar *uri;
a2e38e
-  gchar *ret_val;
a2e38e
-
a2e38e
-  uri = photos_base_item_get_uri (item);
a2e38e
-  file = g_file_new_for_uri (uri);
a2e38e
-  ret_val = g_file_get_basename (file);
a2e38e
-
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static gchar *
a2e38e
-photos_flickr_item_create_name_fallback (PhotosBaseItem *item)
a2e38e
-{
a2e38e
-  PhotosFlickrItem *self = PHOTOS_FLICKR_ITEM (item);
a2e38e
-  g_autoptr (GDateTime) date_modified = NULL;
a2e38e
-  const gchar *provider_name;
a2e38e
-  g_autofree gchar *date_modified_str = NULL;
a2e38e
-  gchar *ret_val;
a2e38e
-  gint64 mtime;
a2e38e
-
a2e38e
-  provider_name = photos_utils_get_provider_name (self->src_mngr, item);
a2e38e
-
a2e38e
-  mtime = photos_base_item_get_mtime (item);
a2e38e
-  date_modified = g_date_time_new_from_unix_local (mtime);
a2e38e
-  date_modified_str = g_date_time_format (date_modified, "%x");
a2e38e
-
a2e38e
-  /* Translators: this is the fallback title in the form
a2e38e
-   * "Facebook — 2nd January 2013".
a2e38e
-   */
a2e38e
-  ret_val = g_strdup_printf (_("%s — %s"), provider_name, date_modified_str);
a2e38e
-
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static GrlOperationOptions *
a2e38e
-photos_flickr_item_get_grl_options (GrlSource *source)
a2e38e
-{
a2e38e
-  GrlCaps *caps;
a2e38e
-  GrlOperationOptions *options;
a2e38e
-
a2e38e
-  caps = grl_source_get_caps (source, GRL_OP_RESOLVE);
a2e38e
-  options = grl_operation_options_new (caps);
a2e38e
-  return options;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_flickr_item_source_resolve (GrlSource *source,
a2e38e
-                                   guint operation_id,
a2e38e
-                                   GrlMedia *media,
a2e38e
-                                   gpointer user_data,
a2e38e
-                                   const GError *error)
a2e38e
-{
a2e38e
-  PhotosFlickrItemSyncData *data = (PhotosFlickrItemSyncData *) user_data;
a2e38e
-
a2e38e
-  if (error != NULL)
a2e38e
-    {
a2e38e
-      if (data->error != NULL)
a2e38e
-        *(data->error) = g_error_copy (error);
a2e38e
-      data->op_res = FALSE;
a2e38e
-    }
a2e38e
-  else
a2e38e
-    data->op_res = TRUE;
a2e38e
-
a2e38e
-  g_main_loop_quit (data->loop);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static gboolean
a2e38e
-photos_flickr_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
a2e38e
-{
a2e38e
-  PhotosFlickrItemSyncData data;
a2e38e
-  g_autoptr (GFile) local_file = NULL;
a2e38e
-  g_autoptr (GFile) remote_file = NULL;
a2e38e
-  g_autoptr (GList) keys = NULL;
a2e38e
-  g_autoptr (GMainContext) context = NULL;
a2e38e
-  g_autoptr (GrlMedia) media = NULL;
a2e38e
-  g_autoptr (GrlOperationOptions) options = NULL;
a2e38e
-  GrlRegistry *registry;
a2e38e
-  GrlSource *source;
a2e38e
-  gboolean ret_val = FALSE;
a2e38e
-  const gchar *const flickr_prefix = "flickr:";
a2e38e
-  const gchar *const resource_prefix = "gd:goa-account:";
a2e38e
-  const gchar *flickr_id;
a2e38e
-  const gchar *goa_id;
a2e38e
-  const gchar *identifier;
a2e38e
-  const gchar *resource_urn;
a2e38e
-  const gchar *thumbnail_uri;
a2e38e
-  const gchar *uri;
a2e38e
-  g_autofree gchar *grilo_id = NULL;
a2e38e
-  g_autofree gchar *local_dir = NULL;
a2e38e
-  g_autofree gchar *local_path = NULL;
a2e38e
-  gint64 height;
a2e38e
-  gint64 width;
a2e38e
-  gsize prefix_len;
a2e38e
-
a2e38e
-  data.error = error;
a2e38e
-  data.loop = NULL;
a2e38e
-
a2e38e
-  prefix_len = strlen (flickr_prefix);
a2e38e
-  identifier = photos_base_item_get_identifier (item);
a2e38e
-  if (strlen (identifier) <= prefix_len || !g_str_has_prefix (identifier, flickr_prefix))
a2e38e
-    {
a2e38e
-      g_set_error (error,
a2e38e
-                   PHOTOS_ERROR,
a2e38e
-                   0,
a2e38e
-                   "Invalid nao:identifier for Flickr item %s",
a2e38e
-                   identifier);
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-  flickr_id = identifier + prefix_len;
a2e38e
-
a2e38e
-  prefix_len = strlen (resource_prefix);
a2e38e
-  resource_urn = photos_base_item_get_resource_urn (item);
a2e38e
-  if (strlen (resource_urn) <= prefix_len || !g_str_has_prefix (resource_urn, resource_prefix))
a2e38e
-    {
a2e38e
-      g_set_error (error,
a2e38e
-                   PHOTOS_ERROR,
a2e38e
-                   0,
a2e38e
-                   "Invalid nie:dataSource for Flickr item %s",
a2e38e
-                   resource_urn);
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-  goa_id = resource_urn + prefix_len;
a2e38e
-
a2e38e
-  grilo_id = g_strdup_printf ("grl-flickr-%s", goa_id);
a2e38e
-  registry = grl_registry_get_default ();
a2e38e
-  source = grl_registry_lookup_source (registry, grilo_id);
a2e38e
-  if (source == NULL)
a2e38e
-    {
a2e38e
-      g_set_error (error,
a2e38e
-                   PHOTOS_ERROR,
a2e38e
-                   0,
a2e38e
-                   "Failed to find a GrlSource for %s",
a2e38e
-                   grilo_id);
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
-  media = grl_media_new ();
a2e38e
-  grl_media_set_id (media, flickr_id);
a2e38e
-
a2e38e
-  keys = grl_metadata_key_list_new (GRL_METADATA_KEY_THUMBNAIL, GRL_METADATA_KEY_INVALID);
a2e38e
-  options = photos_flickr_item_get_grl_options (source);
a2e38e
-
a2e38e
-  context = g_main_context_new ();
a2e38e
-  g_main_context_push_thread_default (context);
a2e38e
-  data.loop = g_main_loop_new (context, FALSE);
a2e38e
-
a2e38e
-  grl_source_resolve (source, media, keys, options, photos_flickr_item_source_resolve, &data);
a2e38e
-  g_main_loop_run (data.loop);
a2e38e
-  g_main_context_pop_thread_default (context);
a2e38e
-
a2e38e
-  if (!data.op_res)
a2e38e
-    goto out;
a2e38e
-
a2e38e
-  thumbnail_uri = grl_media_get_thumbnail (media);
a2e38e
-  remote_file = g_file_new_for_uri (thumbnail_uri);
a2e38e
-
a2e38e
-  local_path = photos_base_item_create_thumbnail_path (item);
a2e38e
-  local_file = g_file_new_for_path (local_path);
a2e38e
-  local_dir = g_path_get_dirname (local_path);
a2e38e
-  g_mkdir_with_parents (local_dir, 0700);
a2e38e
-
a2e38e
-  uri = photos_base_item_get_uri (item);
a2e38e
-
a2e38e
-  height = photos_base_item_get_height (item);
a2e38e
-  width = photos_base_item_get_width (item);
a2e38e
-
a2e38e
-  photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Flickr to %s", thumbnail_uri, local_path);
a2e38e
-  if (!photos_utils_file_copy_as_thumbnail (remote_file,
a2e38e
-                                            local_file,
a2e38e
-                                            uri,
a2e38e
-                                            height,
a2e38e
-                                            width,
a2e38e
-                                            cancellable,
a2e38e
-                                            error))
a2e38e
-    goto out;
a2e38e
-
a2e38e
-  ret_val = TRUE;
a2e38e
-
a2e38e
- out:
a2e38e
-  if (data.loop != NULL)
a2e38e
-    g_main_loop_unref (data.loop);
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static GFile *
a2e38e
-photos_flickr_item_download (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
a2e38e
-{
a2e38e
-  GFile *ret_val = NULL;
a2e38e
-  g_autoptr (GFile) local_file = NULL;
a2e38e
-  g_autoptr (GFile) remote_file = NULL;
a2e38e
-  const gchar *cache_dir;
a2e38e
-  const gchar *local_filename;
a2e38e
-  const gchar *uri;
a2e38e
-  g_autofree gchar *local_dir = NULL;
a2e38e
-  g_autofree gchar *local_path = NULL;
a2e38e
-
a2e38e
-  uri = photos_base_item_get_uri (item);
a2e38e
-  remote_file = g_file_new_for_uri (uri);
a2e38e
-  cache_dir = g_get_user_cache_dir ();
a2e38e
-
a2e38e
-  local_dir = g_build_filename (cache_dir, PACKAGE_TARNAME, "flickr", NULL);
a2e38e
-  g_mkdir_with_parents (local_dir, 0700);
a2e38e
-
a2e38e
-  local_filename = photos_base_item_get_filename (item);
a2e38e
-  local_path = g_build_filename (local_dir, local_filename, NULL);
a2e38e
-  local_file = g_file_new_for_path (local_path);
a2e38e
-
a2e38e
-  if (!g_file_test (local_path, G_FILE_TEST_EXISTS))
a2e38e
-    {
a2e38e
-      photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Flickr to %s", uri, local_path);
a2e38e
-      if (!g_file_copy (remote_file,
a2e38e
-                        local_file,
a2e38e
-                        G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
a2e38e
-                        cancellable,
a2e38e
-                        NULL,
a2e38e
-                        NULL,
a2e38e
-                        error))
a2e38e
-        {
a2e38e
-          g_file_delete (local_file, NULL, NULL);
a2e38e
-          goto out;
a2e38e
-        }
a2e38e
-    }
a2e38e
-
a2e38e
-  ret_val = g_object_ref (local_file);
a2e38e
-
a2e38e
- out:
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static GtkWidget *
a2e38e
-photos_flickr_item_get_source_widget (PhotosBaseItem *item)
a2e38e
-{
a2e38e
-  PhotosFlickrItem *self = PHOTOS_FLICKR_ITEM (item);
a2e38e
-  GtkWidget *source_widget;
a2e38e
-  const gchar *name;
a2e38e
-
a2e38e
-  name = photos_utils_get_provider_name (self->src_mngr, item);
a2e38e
-  source_widget = gtk_link_button_new_with_label ("https://www.flickr.com/", name);
a2e38e
-  gtk_widget_set_halign (source_widget, GTK_ALIGN_START);
a2e38e
-
a2e38e
-  return source_widget;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_flickr_item_open (PhotosBaseItem *item, GtkWindow *parent, guint32 timestamp)
a2e38e
-{
a2e38e
-  PhotosFlickrItem *self = PHOTOS_FLICKR_ITEM (item);
a2e38e
-  GoaAccount *account;
a2e38e
-  GoaObject *object;
a2e38e
-  PhotosSource *source;
a2e38e
-  const gchar *identifier;
a2e38e
-  const gchar *identity;
a2e38e
-  const gchar *resource_urn;
a2e38e
-  g_autofree gchar *flickr_uri = NULL;
a2e38e
-
a2e38e
-  identifier = photos_base_item_get_identifier (item) + strlen ("flickr:");
a2e38e
-
a2e38e
-  resource_urn = photos_base_item_get_resource_urn (item);
a2e38e
-  source = PHOTOS_SOURCE (photos_base_manager_get_object_by_id (self->src_mngr, resource_urn));
a2e38e
-  object = photos_source_get_goa_object (source);
a2e38e
-  account = goa_object_peek_account (object);
a2e38e
-  identity = goa_account_get_identity (account);
a2e38e
-
a2e38e
-  flickr_uri = g_strdup_printf ("https://www.flickr.com/photos/%s/%s", identity, identifier);
a2e38e
-
a2e38e
-  {
a2e38e
-    g_autoptr (GError) error = NULL;
a2e38e
-
a2e38e
-    if (!gtk_show_uri_on_window (parent, flickr_uri, timestamp, &error))
a2e38e
-      g_warning ("Unable to show URI %s: %s", flickr_uri, error->message);
a2e38e
-  }
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_flickr_item_constructed (GObject *object)
a2e38e
-{
a2e38e
-  PhotosFlickrItem *self = PHOTOS_FLICKR_ITEM (object);
a2e38e
-  const gchar *name;
a2e38e
-
a2e38e
-  G_OBJECT_CLASS (photos_flickr_item_parent_class)->constructed (object);
a2e38e
-
a2e38e
-  name = photos_utils_get_provider_name (self->src_mngr, PHOTOS_BASE_ITEM (self));
a2e38e
-  photos_base_item_set_default_app_name (PHOTOS_BASE_ITEM (self), name);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_flickr_item_dispose (GObject *object)
a2e38e
-{
a2e38e
-  PhotosFlickrItem *self = PHOTOS_FLICKR_ITEM (object);
a2e38e
-
a2e38e
-  g_clear_object (&self->src_mngr);
a2e38e
-
a2e38e
-  G_OBJECT_CLASS (photos_flickr_item_parent_class)->dispose (object);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_flickr_item_init (PhotosFlickrItem *self)
a2e38e
-{
a2e38e
-  GApplication *app;
a2e38e
-  PhotosSearchContextState *state;
a2e38e
-
a2e38e
-  app = g_application_get_default ();
a2e38e
-  state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
a2e38e
-
a2e38e
-  self->src_mngr = g_object_ref (state->src_mngr);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_flickr_item_class_init (PhotosFlickrItemClass *class)
a2e38e
-{
a2e38e
-  GObjectClass *object_class = G_OBJECT_CLASS (class);
a2e38e
-  PhotosBaseItemClass *base_item_class = PHOTOS_BASE_ITEM_CLASS (class);
a2e38e
-
a2e38e
-  base_item_class->miner_name = "org.gnome.OnlineMiners.Flickr";
a2e38e
-  base_item_class->miner_object_path = "/org/gnome/OnlineMiners/Flickr";
a2e38e
-
a2e38e
-  object_class->constructed = photos_flickr_item_constructed;
a2e38e
-  object_class->dispose = photos_flickr_item_dispose;
a2e38e
-  base_item_class->create_filename_fallback = photos_flickr_item_create_filename_fallback;
a2e38e
-  base_item_class->create_name_fallback = photos_flickr_item_create_name_fallback;
a2e38e
-  base_item_class->create_thumbnail = photos_flickr_item_create_thumbnail;
a2e38e
-  base_item_class->download = photos_flickr_item_download;
a2e38e
-  base_item_class->get_source_widget = photos_flickr_item_get_source_widget;
a2e38e
-  base_item_class->open = photos_flickr_item_open;
a2e38e
-}
a2e38e
diff --git a/src/photos-flickr-item.h b/src/photos-flickr-item.h
a2e38e
deleted file mode 100644
a2e38e
index cd130844bce2..000000000000
a2e38e
--- a/src/photos-flickr-item.h
a2e38e
+++ /dev/null
a2e38e
@@ -1,35 +0,0 @@
a2e38e
-/*
a2e38e
- * Photos - access, organize and share your photos on GNOME
a2e38e
- * Copyright © 2012 – 2019 Red Hat, Inc.
a2e38e
- *
a2e38e
- * This program is free software: you can redistribute it and/or modify
a2e38e
- * it under the terms of the GNU General Public License as published by
a2e38e
- * the Free Software Foundation, either version 3 of the License, or
a2e38e
- * (at your option) any later version.
a2e38e
- *
a2e38e
- * This program is distributed in the hope that it will be useful,
a2e38e
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
a2e38e
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a2e38e
- * GNU General Public License for more details.
a2e38e
- *
a2e38e
- * You should have received a copy of the GNU General Public License
a2e38e
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
a2e38e
- */
a2e38e
-
a2e38e
-/* Based on code from:
a2e38e
- *   + Documents
a2e38e
- */
a2e38e
-
a2e38e
-#ifndef PHOTOS_FLICKR_ITEM_H
a2e38e
-#define PHOTOS_FLICKR_ITEM_H
a2e38e
-
a2e38e
-#include "photos-base-item.h"
a2e38e
-
a2e38e
-G_BEGIN_DECLS
a2e38e
-
a2e38e
-#define PHOTOS_TYPE_FLICKR_ITEM (photos_flickr_item_get_type ())
a2e38e
-G_DECLARE_FINAL_TYPE (PhotosFlickrItem, photos_flickr_item, PHOTOS, FLICKR_ITEM, PhotosBaseItem);
a2e38e
-
a2e38e
-G_END_DECLS
a2e38e
-
a2e38e
-#endif /* PHOTOS_LOCAL_ITEM_H */
a2e38e
diff --git a/src/photos-google-item.c b/src/photos-google-item.c
a2e38e
deleted file mode 100644
a2e38e
index 5737f958b7a5..000000000000
a2e38e
--- a/src/photos-google-item.c
a2e38e
+++ /dev/null
a2e38e
@@ -1,349 +0,0 @@
a2e38e
-/*
a2e38e
- * Photos - access, organize and share your photos on GNOME
a2e38e
- * Copyright © 2014 – 2019 Red Hat, Inc.
a2e38e
- * Copyright © 2014 Saurav Agarwalla
a2e38e
- *
a2e38e
- * This program is free software: you can redistribute it and/or modify
a2e38e
- * it under the terms of the GNU General Public License as published by
a2e38e
- * the Free Software Foundation, either version 3 of the License, or
a2e38e
- * (at your option) any later version.
a2e38e
- *
a2e38e
- * This program is distributed in the hope that it will be useful,
a2e38e
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
a2e38e
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a2e38e
- * GNU General Public License for more details.
a2e38e
- *
a2e38e
- * You should have received a copy of the GNU General Public License
a2e38e
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
a2e38e
- */
a2e38e
-
a2e38e
-/* Based on code from:
a2e38e
- *   + Documents
a2e38e
- */
a2e38e
-
a2e38e
-
a2e38e
-#include "config.h"
a2e38e
-
a2e38e
-#include <gdata/gdata.h>
a2e38e
-#include <gio/gio.h>
a2e38e
-#include <glib.h>
a2e38e
-#include <glib/gi18n.h>
a2e38e
-
a2e38e
-#include "photos-base-manager.h"
a2e38e
-#include "photos-debug.h"
a2e38e
-#include "photos-error.h"
a2e38e
-#include "photos-google-item.h"
a2e38e
-#include "photos-search-context.h"
a2e38e
-#include "photos-source.h"
a2e38e
-#include "photos-utils.h"
a2e38e
-
a2e38e
-
a2e38e
-struct _PhotosGoogleItem
a2e38e
-{
a2e38e
-  PhotosBaseItem parent_instance;
a2e38e
-  PhotosBaseManager *src_mngr;
a2e38e
-};
a2e38e
-
a2e38e
-
a2e38e
-G_DEFINE_TYPE_WITH_CODE (PhotosGoogleItem, photos_google_item, PHOTOS_TYPE_BASE_ITEM,
a2e38e
-                         photos_utils_ensure_extension_points ();
a2e38e
-                         g_io_extension_point_implement (PHOTOS_BASE_ITEM_EXTENSION_POINT_NAME,
a2e38e
-                                                         g_define_type_id,
a2e38e
-                                                         "google",
a2e38e
-                                                         0));
a2e38e
-
a2e38e
-
a2e38e
-static gchar *
a2e38e
-photos_google_item_create_filename_fallback (PhotosBaseItem *item)
a2e38e
-{
a2e38e
-  const gchar *identifier;
a2e38e
-  const gchar *mime_type;
a2e38e
-  gchar *ret_val;
a2e38e
-  g_autofree gchar *extension = NULL;
a2e38e
-  g_autofree gchar *identifier_hash = NULL;
a2e38e
-
a2e38e
-  identifier = photos_base_item_get_identifier (item);
a2e38e
-  identifier_hash = g_compute_checksum_for_string (G_CHECKSUM_SHA1, identifier, -1);
a2e38e
-
a2e38e
-  mime_type = photos_base_item_get_mime_type (item);
a2e38e
-  extension = photos_utils_get_extension_from_mime_type (mime_type);
a2e38e
-  if (extension == NULL)
a2e38e
-    extension = g_strdup ("tmp");
a2e38e
-
a2e38e
-  ret_val = g_strdup_printf ("%s.%s", identifier_hash, extension);
a2e38e
-
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static gchar *
a2e38e
-photos_google_item_create_name_fallback (PhotosBaseItem *item)
a2e38e
-{
a2e38e
-  PhotosGoogleItem *self = PHOTOS_GOOGLE_ITEM (item);
a2e38e
-  g_autoptr (GDateTime) date_modified = NULL;
a2e38e
-  const gchar *provider_name;
a2e38e
-  gchar *ret_val;
a2e38e
-  g_autofree gchar *date_modified_str = NULL;
a2e38e
-  gint64 mtime;
a2e38e
-
a2e38e
-  provider_name = photos_utils_get_provider_name (self->src_mngr, item);
a2e38e
-
a2e38e
-  mtime = photos_base_item_get_mtime (item);
a2e38e
-  date_modified = g_date_time_new_from_unix_local (mtime);
a2e38e
-  date_modified_str = g_date_time_format (date_modified, "%x");
a2e38e
-
a2e38e
-  /* Translators: this is the fallback title in the form
a2e38e
-   * "Facebook — 2nd January 2013".
a2e38e
-   */
a2e38e
-  ret_val = g_strdup_printf (_("%s — %s"), provider_name, date_modified_str);
a2e38e
-
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static GDataEntry *
a2e38e
-photos_google_get_picasaweb_file (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
a2e38e
-{
a2e38e
-  PhotosGoogleItem *self = PHOTOS_GOOGLE_ITEM (item);
a2e38e
-  PhotosSource *source;
a2e38e
-  GDataAuthorizationDomain *authorization_domain;
a2e38e
-  GDataEntry *entry;
a2e38e
-  g_autoptr (GDataGoaAuthorizer) authorizer = NULL;
a2e38e
-  g_autoptr (GDataPicasaWebQuery) query = NULL;
a2e38e
-  g_autoptr (GDataPicasaWebService) service = NULL;
a2e38e
-  const gchar *identifier;
a2e38e
-  const gchar *resource_urn;
a2e38e
-
a2e38e
-  resource_urn = photos_base_item_get_resource_urn (item);
a2e38e
-  source = PHOTOS_SOURCE (photos_base_manager_get_object_by_id (self->src_mngr, resource_urn));
a2e38e
-  authorizer = gdata_goa_authorizer_new (photos_source_get_goa_object (source));
a2e38e
-  identifier = photos_base_item_get_identifier (item) + strlen ("google:picasaweb:");
a2e38e
-  service = gdata_picasaweb_service_new (GDATA_AUTHORIZER (authorizer));
a2e38e
-  authorization_domain = gdata_picasaweb_service_get_primary_authorization_domain ();
a2e38e
-
a2e38e
-  query = gdata_picasaweb_query_new (NULL);
a2e38e
-  gdata_picasaweb_query_set_image_size (query, "d");
a2e38e
-
a2e38e
-  entry = gdata_service_query_single_entry (GDATA_SERVICE (service),
a2e38e
-                                            authorization_domain,
a2e38e
-                                            identifier,
a2e38e
-                                            GDATA_QUERY (query),
a2e38e
-                                            GDATA_TYPE_PICASAWEB_FILE,
a2e38e
-                                            cancellable,
a2e38e
-                                            error);
a2e38e
-
a2e38e
-  return entry;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static gboolean
a2e38e
-photos_google_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
a2e38e
-{
a2e38e
-  g_autoptr (GFile) local_file = NULL;
a2e38e
-  g_autoptr (GFile) remote_file = NULL;
a2e38e
-  GList *l;
a2e38e
-  GList *thumbnails;
a2e38e
-  g_autoptr (GDataEntry) entry = NULL;
a2e38e
-  GDataMediaThumbnail *thumbnail = NULL;
a2e38e
-  gboolean ret_val = FALSE;
a2e38e
-  const gchar *thumbnail_uri;
a2e38e
-  const gchar *uri;
a2e38e
-  g_autofree gchar *local_dir = NULL;
a2e38e
-  g_autofree gchar *local_path = NULL;
a2e38e
-  gint64 height;
a2e38e
-  gint64 width;
a2e38e
-  guint max_width = 0;
a2e38e
-  guint current_width;
a2e38e
-
a2e38e
-  entry = photos_google_get_picasaweb_file (item, cancellable, error);
a2e38e
-  if (entry == NULL)
a2e38e
-    goto out;
a2e38e
-
a2e38e
-  thumbnails = gdata_picasaweb_file_get_thumbnails (GDATA_PICASAWEB_FILE (entry));
a2e38e
-  if (thumbnails == NULL)
a2e38e
-    {
a2e38e
-      g_set_error (error, PHOTOS_ERROR, 0, "Failed to find an image for the thumbnail");
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
-  for (l = thumbnails; l != NULL; l = l->next)
a2e38e
-    {
a2e38e
-      current_width = gdata_media_thumbnail_get_width (GDATA_MEDIA_THUMBNAIL (l->data));
a2e38e
-      if (current_width > max_width)
a2e38e
-        {
a2e38e
-          max_width = current_width;
a2e38e
-          thumbnail = GDATA_MEDIA_THUMBNAIL (l->data);
a2e38e
-        }
a2e38e
-    }
a2e38e
-
a2e38e
-  thumbnail_uri = gdata_media_thumbnail_get_uri (thumbnail);
a2e38e
-  remote_file = g_file_new_for_uri (thumbnail_uri);
a2e38e
-
a2e38e
-  local_path = photos_base_item_create_thumbnail_path (item);
a2e38e
-  local_file = g_file_new_for_path (local_path);
a2e38e
-  local_dir = g_path_get_dirname (local_path);
a2e38e
-  g_mkdir_with_parents (local_dir, 0700);
a2e38e
-
a2e38e
-  uri = photos_base_item_get_uri (item);
a2e38e
-
a2e38e
-  height = photos_base_item_get_height (item);
a2e38e
-  width = photos_base_item_get_width (item);
a2e38e
-
a2e38e
-  photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Google to %s", thumbnail_uri, local_path);
a2e38e
-  if (!photos_utils_file_copy_as_thumbnail (remote_file,
a2e38e
-                                            local_file,
a2e38e
-                                            uri,
a2e38e
-                                            height,
a2e38e
-                                            width,
a2e38e
-                                            cancellable,
a2e38e
-                                            error))
a2e38e
-    goto out;
a2e38e
-
a2e38e
-  ret_val = TRUE;
a2e38e
-
a2e38e
- out:
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static GFile *
a2e38e
-photos_google_item_download (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
a2e38e
-{
a2e38e
-  GFile *ret_val = NULL;
a2e38e
-  g_autoptr (GFile) local_file = NULL;
a2e38e
-  g_autoptr (GFile) remote_file = NULL;
a2e38e
-  g_autoptr (GDataEntry) entry = NULL;
a2e38e
-  const gchar *cache_dir;
a2e38e
-  const gchar *local_filename;
a2e38e
-  const gchar *uri;
a2e38e
-  g_autofree gchar *local_dir = NULL;
a2e38e
-  g_autofree gchar *local_path = NULL;
a2e38e
-
a2e38e
-  cache_dir = g_get_user_cache_dir ();
a2e38e
-  local_dir = g_build_filename (cache_dir, PACKAGE_TARNAME, "google", NULL);
a2e38e
-  g_mkdir_with_parents (local_dir, 0700);
a2e38e
-
a2e38e
-  local_filename = photos_base_item_get_filename (item);
a2e38e
-  local_path = g_build_filename (local_dir, local_filename, NULL);
a2e38e
-  local_file = g_file_new_for_path (local_path);
a2e38e
-  if (g_file_test (local_path, G_FILE_TEST_EXISTS))
a2e38e
-    goto end;
a2e38e
-
a2e38e
-  entry = photos_google_get_picasaweb_file (item, cancellable, error);
a2e38e
-  if (entry == NULL)
a2e38e
-    goto out;
a2e38e
-
a2e38e
-  uri = gdata_entry_get_content_uri (entry);
a2e38e
-  remote_file = g_file_new_for_uri (uri);
a2e38e
-
a2e38e
-  photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Google to %s", uri, local_path);
a2e38e
-  if (!g_file_copy (remote_file,
a2e38e
-                    local_file,
a2e38e
-                    G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
a2e38e
-                    cancellable,
a2e38e
-                    NULL,
a2e38e
-                    NULL,
a2e38e
-                    error))
a2e38e
-    {
a2e38e
-      g_file_delete (local_file, NULL, NULL);
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
- end:
a2e38e
-  ret_val = g_object_ref (local_file);
a2e38e
-
a2e38e
- out:
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static GtkWidget *
a2e38e
-photos_google_item_get_source_widget (PhotosBaseItem *item)
a2e38e
-{
a2e38e
-  PhotosGoogleItem *self = PHOTOS_GOOGLE_ITEM (item);
a2e38e
-  GtkWidget *source_widget;
a2e38e
-  const gchar *name;
a2e38e
-
a2e38e
-  name = photos_utils_get_provider_name (self->src_mngr, item);
a2e38e
-  source_widget = gtk_link_button_new_with_label ("https://photos.google.com/", name);
a2e38e
-  gtk_widget_set_halign (source_widget, GTK_ALIGN_START);
a2e38e
-
a2e38e
-  return source_widget;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-/* NOTE: For private photos, opening the URI in a browser results in a
a2e38e
- * 'Sorry, that page was not found.' if the user is not logged in with the respective account
a2e38e
- */
a2e38e
-static void
a2e38e
-photos_google_item_open (PhotosBaseItem *item, GtkWindow *parent, guint32 timestamp)
a2e38e
-{
a2e38e
-  const gchar *google_uri;
a2e38e
-
a2e38e
-  google_uri = photos_base_item_get_uri (item);
a2e38e
-
a2e38e
-  {
a2e38e
-    g_autoptr (GError) error = NULL;
a2e38e
-
a2e38e
-    gtk_show_uri_on_window (parent, google_uri, timestamp, &error);
a2e38e
-    if (error != NULL)
a2e38e
-      g_warning ("Unable to show URI %s: %s", google_uri, error->message);
a2e38e
-  }
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_google_item_constructed (GObject *object)
a2e38e
-{
a2e38e
-  PhotosGoogleItem *self = PHOTOS_GOOGLE_ITEM (object);
a2e38e
-  const gchar *name;
a2e38e
-
a2e38e
-  G_OBJECT_CLASS (photos_google_item_parent_class)->constructed (object);
a2e38e
-
a2e38e
-  name = photos_utils_get_provider_name (self->src_mngr, PHOTOS_BASE_ITEM (self));
a2e38e
-  photos_base_item_set_default_app_name (PHOTOS_BASE_ITEM (self), name);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_google_item_dispose (GObject *object)
a2e38e
-{
a2e38e
-  PhotosGoogleItem *self = PHOTOS_GOOGLE_ITEM (object);
a2e38e
-
a2e38e
-  g_clear_object (&self->src_mngr);
a2e38e
-
a2e38e
-  G_OBJECT_CLASS (photos_google_item_parent_class)->dispose (object);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_google_item_init (PhotosGoogleItem *self)
a2e38e
-{
a2e38e
-  GApplication *app;
a2e38e
-  PhotosSearchContextState *state;
a2e38e
-
a2e38e
-  app = g_application_get_default ();
a2e38e
-  state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
a2e38e
-
a2e38e
-  self->src_mngr = g_object_ref (state->src_mngr);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_google_item_class_init (PhotosGoogleItemClass *class)
a2e38e
-{
a2e38e
-  GObjectClass *object_class = G_OBJECT_CLASS (class);
a2e38e
-  PhotosBaseItemClass *base_item_class = PHOTOS_BASE_ITEM_CLASS (class);
a2e38e
-
a2e38e
-  base_item_class->miner_name = "org.gnome.OnlineMiners.GData";
a2e38e
-  base_item_class->miner_object_path = "/org/gnome/OnlineMiners/GData";
a2e38e
-
a2e38e
-  object_class->constructed = photos_google_item_constructed;
a2e38e
-  object_class->dispose = photos_google_item_dispose;
a2e38e
-  base_item_class->create_filename_fallback = photos_google_item_create_filename_fallback;
a2e38e
-  base_item_class->create_name_fallback = photos_google_item_create_name_fallback;
a2e38e
-  base_item_class->create_thumbnail = photos_google_item_create_thumbnail;
a2e38e
-  base_item_class->download = photos_google_item_download;
a2e38e
-  base_item_class->get_source_widget = photos_google_item_get_source_widget;
a2e38e
-  base_item_class->open = photos_google_item_open;
a2e38e
-}
a2e38e
diff --git a/src/photos-google-item.h b/src/photos-google-item.h
a2e38e
deleted file mode 100644
a2e38e
index 644098e3c095..000000000000
a2e38e
--- a/src/photos-google-item.h
a2e38e
+++ /dev/null
a2e38e
@@ -1,36 +0,0 @@
a2e38e
-/*
a2e38e
- * Photos - access, organize and share your photos on GNOME
a2e38e
- * Copyright © 2016 – 2019 Red Hat, Inc.
a2e38e
- * Copyright © 2014 Saurav Agarwalla
a2e38e
- *
a2e38e
- * This program is free software: you can redistribute it and/or modify
a2e38e
- * it under the terms of the GNU General Public License as published by
a2e38e
- * the Free Software Foundation, either version 3 of the License, or
a2e38e
- * (at your option) any later version.
a2e38e
- *
a2e38e
- * This program is distributed in the hope that it will be useful,
a2e38e
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
a2e38e
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a2e38e
- * GNU General Public License for more details.
a2e38e
- *
a2e38e
- * You should have received a copy of the GNU General Public License
a2e38e
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
a2e38e
- */
a2e38e
-
a2e38e
-/* Based on code from:
a2e38e
- *   + Documents
a2e38e
- */
a2e38e
-
a2e38e
-#ifndef PHOTOS_GOOGLE_ITEM_H
a2e38e
-#define PHOTOS_GOOGLE_ITEM_H
a2e38e
-
a2e38e
-#include "photos-base-item.h"
a2e38e
-
a2e38e
-G_BEGIN_DECLS
a2e38e
-
a2e38e
-#define PHOTOS_TYPE_GOOGLE_ITEM (photos_google_item_get_type ())
a2e38e
-G_DECLARE_FINAL_TYPE (PhotosGoogleItem, photos_google_item, PHOTOS, GOOGLE_ITEM, PhotosBaseItem);
a2e38e
-
a2e38e
-G_END_DECLS
a2e38e
-
a2e38e
-#endif /* PHOTOS_GOOGLE_ITEM_H */
a2e38e
diff --git a/src/photos-share-point-google.c b/src/photos-share-point-google.c
a2e38e
deleted file mode 100644
a2e38e
index 6cc6d55d882e..000000000000
a2e38e
--- a/src/photos-share-point-google.c
a2e38e
+++ /dev/null
a2e38e
@@ -1,516 +0,0 @@
a2e38e
-/*
a2e38e
- * Photos - access, organize and share your photos on GNOME
a2e38e
- * Copyright © 2016 – 2020 Red Hat, Inc.
a2e38e
- * Copyright © 2016 Umang Jain
a2e38e
- *
a2e38e
- * This program is free software: you can redistribute it and/or modify
a2e38e
- * it under the terms of the GNU General Public License as published by
a2e38e
- * the Free Software Foundation, either version 3 of the License, or
a2e38e
- * (at your option) any later version.
a2e38e
- *
a2e38e
- * This program is distributed in the hope that it will be useful,
a2e38e
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
a2e38e
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a2e38e
- * GNU General Public License for more details.
a2e38e
- *
a2e38e
- * You should have received a copy of the GNU General Public License
a2e38e
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
a2e38e
- */
a2e38e
-
a2e38e
-
a2e38e
-#include "config.h"
a2e38e
-
a2e38e
-#include <gio/gio.h>
a2e38e
-#include <gdata/gdata.h>
a2e38e
-#include <glib/gi18n.h>
a2e38e
-
a2e38e
-#include "photos-application.h"
a2e38e
-#include "photos-base-item.h"
a2e38e
-#include "photos-error.h"
a2e38e
-#include "photos-filterable.h"
a2e38e
-#include "photos-item-manager.h"
a2e38e
-#include "photos-search-context.h"
a2e38e
-#include "photos-share-point-google.h"
a2e38e
-#include "photos-source.h"
a2e38e
-#include "photos-utils.h"
a2e38e
-
a2e38e
-
a2e38e
-struct _PhotosSharePointGoogle
a2e38e
-{
a2e38e
-  PhotosSharePointOnline parent_instance;
a2e38e
-  GDataGoaAuthorizer *authorizer;
a2e38e
-  GDataPicasaWebService *service;
a2e38e
-  PhotosBaseManager *item_mngr;
a2e38e
-};
a2e38e
-
a2e38e
-
a2e38e
-G_DEFINE_TYPE_WITH_CODE (PhotosSharePointGoogle, photos_share_point_google, PHOTOS_TYPE_SHARE_POINT_ONLINE,
a2e38e
-                         photos_utils_ensure_extension_points ();
a2e38e
-                         g_io_extension_point_implement (PHOTOS_SHARE_POINT_ONLINE_EXTENSION_POINT_NAME,
a2e38e
-                                                         g_define_type_id,
a2e38e
-                                                         "google",
a2e38e
-                                                         0));
a2e38e
-
a2e38e
-
a2e38e
-typedef struct _PhotosSharePointGoogleShareData PhotosSharePointGoogleShareData;
a2e38e
-
a2e38e
-struct _PhotosSharePointGoogleShareData
a2e38e
-{
a2e38e
-  GDataPicasaWebFile *file_entry;
a2e38e
-  GDataUploadStream *stream;
a2e38e
-  PhotosBaseItem *item;
a2e38e
-  gchar *item_id_after_changes;
a2e38e
-  guint pending_async_calls;
a2e38e
-};
a2e38e
-
a2e38e
-
a2e38e
-static PhotosSharePointGoogleShareData *
a2e38e
-photos_share_point_google_share_data_new (PhotosBaseItem *item)
a2e38e
-{
a2e38e
-  PhotosSharePointGoogleShareData *data;
a2e38e
-
a2e38e
-  data = g_slice_new0 (PhotosSharePointGoogleShareData);
a2e38e
-  data->item = g_object_ref (item);
a2e38e
-
a2e38e
-  return data;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_share_data_free (PhotosSharePointGoogleShareData *data)
a2e38e
-{
a2e38e
-  g_clear_object (&data->file_entry);
a2e38e
-  g_clear_object (&data->stream);
a2e38e
-  g_clear_object (&data->item);
a2e38e
-  g_free (data->item_id_after_changes);
a2e38e
-  g_slice_free (PhotosSharePointGoogleShareData, data);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static gboolean
a2e38e
-photos_share_point_google_needs_notification (PhotosSharePoint *share_point)
a2e38e
-{
a2e38e
-  return TRUE;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static gchar *
a2e38e
-photos_share_point_google_parse_error (PhotosSharePoint *self, GError *error)
a2e38e
-{
a2e38e
-  gchar *msg;
a2e38e
-
a2e38e
-  if (g_error_matches (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED))
a2e38e
-    msg = g_strdup (_("Failed to upload photo: Service not authorized"));
a2e38e
-  else
a2e38e
-    msg = g_strdup (_("Failed to upload photo"));
a2e38e
-
a2e38e
-  return msg;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_share_insert_shared_content (GObject *source_object, GAsyncResult *res, gpointer user_data)
a2e38e
-{
a2e38e
-  GError *error;
a2e38e
-  g_autoptr (GTask) task = G_TASK (user_data);
a2e38e
-  GomMiner *miner = GOM_MINER (source_object);
a2e38e
-
a2e38e
-  error = NULL;
a2e38e
-  if (!gom_miner_call_insert_shared_content_finish (miner, res, &error))
a2e38e
-    {
a2e38e
-      g_task_return_error (task, error);
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
-  g_task_return_boolean (task, TRUE);
a2e38e
-
a2e38e
- out:
a2e38e
-  return;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_share_metadata_add_shared_second (PhotosSharePointGoogle *self, GTask *task)
a2e38e
-{
a2e38e
-  GApplication *app;
a2e38e
-  GCancellable *cancellable;
a2e38e
-  GoaAccount *account;
a2e38e
-  GoaObject *object;
a2e38e
-  GomMiner *miner;
a2e38e
-  PhotosSource *source;
a2e38e
-  PhotosSharePointGoogleShareData *data;
a2e38e
-  const gchar *account_id;
a2e38e
-  const gchar *file_entry_id;
a2e38e
-
a2e38e
-  cancellable = g_task_get_cancellable (task);
a2e38e
-  data = (PhotosSharePointGoogleShareData *) g_task_get_task_data (task);
a2e38e
-
a2e38e
-  app = g_application_get_default ();
a2e38e
-  miner = photos_application_get_miner (PHOTOS_APPLICATION (app), "google");
a2e38e
-  if (miner == NULL)
a2e38e
-    {
a2e38e
-      g_task_return_new_error (task, PHOTOS_ERROR, 0, "Unable to find the google miner");
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
-  source = photos_share_point_online_get_source (PHOTOS_SHARE_POINT_ONLINE (self));
a2e38e
-  object = photos_source_get_goa_object (source);
a2e38e
-  account = goa_object_peek_account (object);
a2e38e
-  account_id = goa_account_get_id (account);
a2e38e
-
a2e38e
-  file_entry_id = gdata_entry_get_id (GDATA_ENTRY (data->file_entry));
a2e38e
-
a2e38e
-  gom_miner_call_insert_shared_content (miner,
a2e38e
-                                        account_id,
a2e38e
-                                        file_entry_id,
a2e38e
-                                        "photos",
a2e38e
-                                        data->item_id_after_changes,
a2e38e
-                                        cancellable,
a2e38e
-                                        photos_share_point_google_share_insert_shared_content,
a2e38e
-                                        g_object_ref (task));
a2e38e
-
a2e38e
- out:
a2e38e
-  g_object_unref (task);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_share_metadata_add_shared (GObject *source_object, GAsyncResult *res, gpointer user_data)
a2e38e
-{
a2e38e
-  PhotosSharePointGoogle *self;
a2e38e
-  g_autoptr (GTask) task = G_TASK (user_data);
a2e38e
-  PhotosBaseItem *item = PHOTOS_BASE_ITEM (source_object);
a2e38e
-  PhotosSharePointGoogleShareData *data;
a2e38e
-
a2e38e
-  self = PHOTOS_SHARE_POINT_GOOGLE (g_task_get_source_object (task));
a2e38e
-  data = (PhotosSharePointGoogleShareData *) g_task_get_task_data (task);
a2e38e
-
a2e38e
-  {
a2e38e
-    g_autoptr (GError) error = NULL;
a2e38e
-
a2e38e
-    if (!photos_base_item_metadata_add_shared_finish (item, res, &error))
a2e38e
-      {
a2e38e
-        if (g_task_get_completed (task))
a2e38e
-          g_warning ("Unable to add shared metadata: %s", error->message);
a2e38e
-        else
a2e38e
-          g_task_return_error (task, g_steal_pointer (&error));
a2e38e
-
a2e38e
-        goto out;
a2e38e
-      }
a2e38e
-  }
a2e38e
-
a2e38e
-  data->pending_async_calls--;
a2e38e
-  if (data->pending_async_calls == 0)
a2e38e
-    photos_share_point_google_share_metadata_add_shared_second (self, g_object_ref (task));
a2e38e
-
a2e38e
- out:
a2e38e
-  return;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_share_wait_for_changes (GObject *source_object, GAsyncResult *res, gpointer user_data)
a2e38e
-{
a2e38e
-  PhotosSharePointGoogle *self;
a2e38e
-  g_autoptr (GTask) task = G_TASK (user_data);
a2e38e
-  PhotosItemManager *item_mngr = PHOTOS_ITEM_MANAGER (source_object);
a2e38e
-  PhotosSharePointGoogleShareData *data;
a2e38e
-  g_autofree gchar *item_id_after_changes = NULL;
a2e38e
-
a2e38e
-  self = PHOTOS_SHARE_POINT_GOOGLE (g_task_get_source_object (task));
a2e38e
-  data = (PhotosSharePointGoogleShareData *) g_task_get_task_data (task);
a2e38e
-
a2e38e
-  {
a2e38e
-    g_autoptr (GError) error = NULL;
a2e38e
-
a2e38e
-    item_id_after_changes = photos_item_manager_wait_for_changes_finish (item_mngr, res, &error);
a2e38e
-    if (error != NULL)
a2e38e
-      {
a2e38e
-        if (g_task_get_completed (task))
a2e38e
-          g_warning ("Unable to detect changes: %s", error->message);
a2e38e
-        else
a2e38e
-          g_task_return_error (task, g_steal_pointer (&error));
a2e38e
-
a2e38e
-        goto out;
a2e38e
-      }
a2e38e
-  }
a2e38e
-
a2e38e
-  g_assert_null (data->item_id_after_changes);
a2e38e
-  data->item_id_after_changes = g_steal_pointer (&item_id_after_changes);
a2e38e
-
a2e38e
-  data->pending_async_calls--;
a2e38e
-  if (data->pending_async_calls == 0)
a2e38e
-    photos_share_point_google_share_metadata_add_shared_second (self, g_object_ref (task));
a2e38e
-
a2e38e
- out:
a2e38e
-  return;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_share_save_to_stream (GObject *source_object, GAsyncResult *res, gpointer user_data)
a2e38e
-{
a2e38e
-  PhotosSharePointGoogle *self;
a2e38e
-  GCancellable *cancellable;
a2e38e
-  GError *error;
a2e38e
-  g_autoptr (GTask) task = G_TASK (user_data);
a2e38e
-  g_autoptr (GDataPicasaWebFile) file_entry = NULL;
a2e38e
-  GoaAccount *account;
a2e38e
-  GoaObject *object;
a2e38e
-  PhotosBaseItem *item = PHOTOS_BASE_ITEM (source_object);
a2e38e
-  PhotosSource *source;
a2e38e
-  PhotosSharePointGoogleShareData *data;
a2e38e
-  const gchar *account_identity;
a2e38e
-  const gchar *file_entry_id;
a2e38e
-  const gchar *provider_type;
a2e38e
-  g_autofree gchar *shared_identifier = NULL;
a2e38e
-
a2e38e
-  self = PHOTOS_SHARE_POINT_GOOGLE (g_task_get_source_object (task));
a2e38e
-  cancellable = g_task_get_cancellable (task);
a2e38e
-  data = (PhotosSharePointGoogleShareData *) g_task_get_task_data (task);
a2e38e
-
a2e38e
-  error = NULL;
a2e38e
-  if (!photos_base_item_save_to_stream_finish (item, res, &error))
a2e38e
-    {
a2e38e
-      g_task_return_error (task, error);
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
-  error = NULL;
a2e38e
-  file_entry = gdata_picasaweb_service_finish_file_upload (GDATA_PICASAWEB_SERVICE (self->service),
a2e38e
-                                                           data->stream,
a2e38e
-                                                           &error);
a2e38e
-  if (error != NULL)
a2e38e
-    {
a2e38e
-      g_task_return_error (task, error);
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
-  g_assert_null (data->file_entry);
a2e38e
-  data->file_entry = g_object_ref (file_entry);
a2e38e
-
a2e38e
-  g_assert_true (PHOTOS_IS_ITEM_MANAGER (self->item_mngr));
a2e38e
-
a2e38e
-  /* Tracker might detect the atomic update done by GExiv2 as a 'delete'
a2e38e
-   * followed by 'create'. If that happens the URN will change. We
a2e38e
-   * have to deal with that by waiting for TrackerChangeMonitor to
a2e38e
-   * emit changes-pending for the BaseItem that we are interested in,
a2e38e
-   * and using the new URN, if any.
a2e38e
-   *
a2e38e
-   * See https://bugzilla.gnome.org/show_bug.cgi?id=771042
a2e38e
-   */
a2e38e
-  photos_item_manager_wait_for_changes_async (PHOTOS_ITEM_MANAGER (self->item_mngr),
a2e38e
-                                              data->item,
a2e38e
-                                              cancellable,
a2e38e
-                                              photos_share_point_google_share_wait_for_changes,
a2e38e
-                                              g_object_ref (task));
a2e38e
-  data->pending_async_calls++;
a2e38e
-
a2e38e
-  source = photos_share_point_online_get_source (PHOTOS_SHARE_POINT_ONLINE (self));
a2e38e
-  object = photos_source_get_goa_object (source);
a2e38e
-  account = goa_object_peek_account (object);
a2e38e
-  account_identity = goa_account_get_identity (account);
a2e38e
-  provider_type = goa_account_get_provider_type (account);
a2e38e
-
a2e38e
-  file_entry_id = gdata_entry_get_id (GDATA_ENTRY (file_entry));
a2e38e
-  shared_identifier = g_strconcat ("google:picasaweb:", file_entry_id, NULL);
a2e38e
-
a2e38e
-  photos_base_item_metadata_add_shared_async (data->item,
a2e38e
-                                              provider_type,
a2e38e
-                                              account_identity,
a2e38e
-                                              shared_identifier,
a2e38e
-                                              cancellable,
a2e38e
-                                              photos_share_point_google_share_metadata_add_shared,
a2e38e
-                                              g_object_ref (task));
a2e38e
-  data->pending_async_calls++;
a2e38e
-
a2e38e
- out:
a2e38e
-  return;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_share_refresh_authorization (GObject *source_object,
a2e38e
-                                                       GAsyncResult *res,
a2e38e
-                                                       gpointer user_data)
a2e38e
-{
a2e38e
-  PhotosSharePointGoogle *self;
a2e38e
-  GCancellable *cancellable;
a2e38e
-  GError *error;
a2e38e
-  g_autoptr (GTask) task = G_TASK (user_data);
a2e38e
-  GDataAuthorizer *authorizer = GDATA_AUTHORIZER (source_object);
a2e38e
-  g_autoptr (GDataPicasaWebFile) file_entry = NULL;
a2e38e
-  g_autoptr (GDataUploadStream) stream = NULL;
a2e38e
-  PhotosSharePointGoogleShareData *data;
a2e38e
-  const gchar *filename;
a2e38e
-  const gchar *mime_type;
a2e38e
-  const gchar *name;
a2e38e
-
a2e38e
-  self = PHOTOS_SHARE_POINT_GOOGLE (g_task_get_source_object (task));
a2e38e
-  cancellable = g_task_get_cancellable (task);
a2e38e
-  data = (PhotosSharePointGoogleShareData *) g_task_get_task_data (task);
a2e38e
-
a2e38e
-  error = NULL;
a2e38e
-  if (!gdata_authorizer_refresh_authorization_finish (authorizer, res, &error))
a2e38e
-    {
a2e38e
-      g_task_return_error (task, error);
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
-  file_entry = gdata_picasaweb_file_new (NULL);
a2e38e
-  name = photos_base_item_get_name_with_fallback (data->item);
a2e38e
-  gdata_entry_set_title (GDATA_ENTRY (file_entry), name);
a2e38e
-
a2e38e
-  filename = photos_base_item_get_filename (data->item);
a2e38e
-  mime_type = photos_base_item_get_mime_type (data->item);
a2e38e
-
a2e38e
-  error = NULL;
a2e38e
-  stream = gdata_picasaweb_service_upload_file (self->service,
a2e38e
-                                                NULL,
a2e38e
-                                                file_entry,
a2e38e
-                                                filename,
a2e38e
-                                                mime_type,
a2e38e
-                                                cancellable,
a2e38e
-                                                &error);
a2e38e
-  if (error != NULL)
a2e38e
-    {
a2e38e
-      g_task_return_error (task, error);
a2e38e
-      goto out;
a2e38e
-    }
a2e38e
-
a2e38e
-  g_assert_null (data->stream);
a2e38e
-  data->stream = g_object_ref (stream);
a2e38e
-
a2e38e
-  photos_base_item_save_to_stream_async (data->item,
a2e38e
-                                         G_OUTPUT_STREAM (stream),
a2e38e
-                                         1.0,
a2e38e
-                                         cancellable,
a2e38e
-                                         photos_share_point_google_share_save_to_stream,
a2e38e
-                                         g_object_ref (task));
a2e38e
-
a2e38e
- out:
a2e38e
-  return;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_share_async (PhotosSharePoint *share_point,
a2e38e
-                                       PhotosBaseItem *item,
a2e38e
-                                       GCancellable *cancellable,
a2e38e
-                                       GAsyncReadyCallback callback,
a2e38e
-                                       gpointer user_data)
a2e38e
-{
a2e38e
-  PhotosSharePointGoogle *self = PHOTOS_SHARE_POINT_GOOGLE (share_point);
a2e38e
-  g_autoptr (GTask) task = NULL;
a2e38e
-  PhotosSharePointGoogleShareData *data;
a2e38e
-
a2e38e
-  data = photos_share_point_google_share_data_new (item);
a2e38e
-
a2e38e
-  task = g_task_new (self, cancellable, callback, user_data);
a2e38e
-  g_task_set_source_tag (task, photos_share_point_google_share_async);
a2e38e
-  g_task_set_task_data (task, data, (GDestroyNotify) photos_share_point_google_share_data_free);
a2e38e
-
a2e38e
-  gdata_authorizer_refresh_authorization_async (GDATA_AUTHORIZER (self->authorizer),
a2e38e
-                                                cancellable,
a2e38e
-                                                photos_share_point_google_share_refresh_authorization,
a2e38e
-                                                g_object_ref (task));
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static gboolean
a2e38e
-photos_share_point_google_share_finish (PhotosSharePoint *share_point,
a2e38e
-                                        GAsyncResult *res,
a2e38e
-                                        gchar **out_uri,
a2e38e
-                                        GError **error)
a2e38e
-{
a2e38e
-  PhotosSharePointGoogle *self = PHOTOS_SHARE_POINT_GOOGLE (share_point);
a2e38e
-  GTask *task;
a2e38e
-  gboolean ret_val = FALSE;
a2e38e
-
a2e38e
-  g_return_val_if_fail (g_task_is_valid (res, self), FALSE);
a2e38e
-  task = G_TASK (res);
a2e38e
-
a2e38e
-  g_return_val_if_fail (g_task_get_source_tag (task) == photos_share_point_google_share_async, FALSE);
a2e38e
-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
a2e38e
-
a2e38e
-  if (!g_task_propagate_boolean (task, error))
a2e38e
-    goto out;
a2e38e
-
a2e38e
-  ret_val = TRUE;
a2e38e
-
a2e38e
-  if (out_uri != NULL)
a2e38e
-    *out_uri = g_strdup ("https://photos.google.com/");
a2e38e
-
a2e38e
- out:
a2e38e
-  return ret_val;
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_constructed (GObject *object)
a2e38e
-{
a2e38e
-  PhotosSharePointGoogle *self = PHOTOS_SHARE_POINT_GOOGLE (object);
a2e38e
-  PhotosSource *source;
a2e38e
-  GoaObject *goa_object;
a2e38e
-
a2e38e
-  G_OBJECT_CLASS (photos_share_point_google_parent_class)->constructed (object);
a2e38e
-
a2e38e
-  source = photos_share_point_online_get_source (PHOTOS_SHARE_POINT_ONLINE (self));
a2e38e
-  goa_object = photos_source_get_goa_object (source);
a2e38e
-  self->authorizer = gdata_goa_authorizer_new (goa_object);
a2e38e
-  self->service = gdata_picasaweb_service_new (GDATA_AUTHORIZER (self->authorizer));
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_dispose (GObject *object)
a2e38e
-{
a2e38e
-  PhotosSharePointGoogle *self = PHOTOS_SHARE_POINT_GOOGLE (object);
a2e38e
-
a2e38e
-  g_clear_object (&self->authorizer);
a2e38e
-  g_clear_object (&self->service);
a2e38e
-
a2e38e
-  G_OBJECT_CLASS (photos_share_point_google_parent_class)->dispose (object);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_finalize (GObject *object)
a2e38e
-{
a2e38e
-  PhotosSharePointGoogle *self = PHOTOS_SHARE_POINT_GOOGLE (object);
a2e38e
-
a2e38e
-  if (self->item_mngr != NULL)
a2e38e
-    g_object_remove_weak_pointer (G_OBJECT (self->item_mngr), (gpointer *) &self->item_mngr);
a2e38e
-
a2e38e
-  G_OBJECT_CLASS (photos_share_point_google_parent_class)->finalize (object);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_init (PhotosSharePointGoogle *self)
a2e38e
-{
a2e38e
-  GApplication *app;
a2e38e
-  PhotosSearchContextState *state;
a2e38e
-
a2e38e
-  app = g_application_get_default ();
a2e38e
-  state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
a2e38e
-
a2e38e
-  self->item_mngr = state->item_mngr;
a2e38e
-  g_object_add_weak_pointer (G_OBJECT (self->item_mngr), (gpointer *) &self->item_mngr);
a2e38e
-}
a2e38e
-
a2e38e
-
a2e38e
-static void
a2e38e
-photos_share_point_google_class_init (PhotosSharePointGoogleClass *class)
a2e38e
-{
a2e38e
-  GObjectClass *object_class = G_OBJECT_CLASS (class);
a2e38e
-  PhotosSharePointClass *share_point_class = PHOTOS_SHARE_POINT_CLASS (class);
a2e38e
-
a2e38e
-  object_class->constructed = photos_share_point_google_constructed;
a2e38e
-  object_class->dispose = photos_share_point_google_dispose;
a2e38e
-  object_class->finalize = photos_share_point_google_finalize;
a2e38e
-  share_point_class->needs_notification = photos_share_point_google_needs_notification;
a2e38e
-  share_point_class->parse_error = photos_share_point_google_parse_error;
a2e38e
-  share_point_class->share_async = photos_share_point_google_share_async;
a2e38e
-  share_point_class->share_finish = photos_share_point_google_share_finish;
a2e38e
-}
a2e38e
diff --git a/src/photos-share-point-google.h b/src/photos-share-point-google.h
a2e38e
deleted file mode 100644
a2e38e
index f229f7ed05a6..000000000000
a2e38e
--- a/src/photos-share-point-google.h
a2e38e
+++ /dev/null
a2e38e
@@ -1,35 +0,0 @@
a2e38e
-/*
a2e38e
- * Photos - access, organize and share your photos on GNOME
a2e38e
- * Copyright © 2016 Umang Jain
a2e38e
- *
a2e38e
- * This program is free software: you can redistribute it and/or modify
a2e38e
- * it under the terms of the GNU General Public License as published by
a2e38e
- * the Free Software Foundation, either version 3 of the License, or
a2e38e
- * (at your option) any later version.
a2e38e
- *
a2e38e
- * This program is distributed in the hope that it will be useful,
a2e38e
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
a2e38e
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a2e38e
- * GNU General Public License for more details.
a2e38e
- *
a2e38e
- * You should have received a copy of the GNU General Public License
a2e38e
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
a2e38e
- */
a2e38e
-
a2e38e
-#ifndef PHOTOS_SHARE_POINT_GOOGLE_H
a2e38e
-#define PHOTOS_SHARE_POINT_GOOGLE_H
a2e38e
-
a2e38e
-#include "photos-share-point-online.h"
a2e38e
-
a2e38e
-G_BEGIN_DECLS
a2e38e
-
a2e38e
-#define PHOTOS_TYPE_SHARE_POINT_GOOGLE (photos_share_point_google_get_type ())
a2e38e
-G_DECLARE_FINAL_TYPE (PhotosSharePointGoogle,
a2e38e
-                      photos_share_point_google,
a2e38e
-                      PHOTOS,
a2e38e
-                      SHARE_POINT_GOOGLE,
a2e38e
-                      PhotosSharePointOnline);
a2e38e
-
a2e38e
-G_END_DECLS
a2e38e
-
a2e38e
-#endif /* PHOTOS_SHARE_POINT_GOOGLE_H */
a2e38e
diff --git a/src/photos-utils.c b/src/photos-utils.c
a2e38e
index 5cfddaa5f845..b9e3f4131985 100644
a2e38e
--- a/src/photos-utils.c
a2e38e
+++ b/src/photos-utils.c
a2e38e
@@ -37,10 +37,7 @@
a2e38e
 #include "photos-device-item.h"
a2e38e
 #include "photos-enums.h"
a2e38e
 #include "photos-error.h"
a2e38e
-#include "photos-facebook-item.h"
a2e38e
-#include "photos-flickr-item.h"
a2e38e
 #include "photos-gegl.h"
a2e38e
-#include "photos-google-item.h"
a2e38e
 #include "photos-local-item.h"
a2e38e
 #include "photos-media-server-item.h"
a2e38e
 #include "photos-offset-collection-view-controller.h"
a2e38e
@@ -52,7 +49,6 @@
a2e38e
 #include "photos-query.h"
a2e38e
 #include "photos-share-point.h"
a2e38e
 #include "photos-share-point-email.h"
a2e38e
-#include "photos-share-point-google.h"
a2e38e
 #include "photos-share-point-online.h"
a2e38e
 #include "photos-source.h"
a2e38e
 #include "photos-thumbnail-factory.h"
a2e38e
@@ -719,14 +715,10 @@ photos_utils_ensure_builtins (void)
a2e38e
   if (g_once_init_enter (&once_init_value))
a2e38e
     {
a2e38e
       g_type_ensure (PHOTOS_TYPE_DEVICE_ITEM);
a2e38e
-      g_type_ensure (PHOTOS_TYPE_FACEBOOK_ITEM);
a2e38e
-      g_type_ensure (PHOTOS_TYPE_FLICKR_ITEM);
a2e38e
-      g_type_ensure (PHOTOS_TYPE_GOOGLE_ITEM);
a2e38e
       g_type_ensure (PHOTOS_TYPE_LOCAL_ITEM);
a2e38e
       g_type_ensure (PHOTOS_TYPE_MEDIA_SERVER_ITEM);
a2e38e
 
a2e38e
       g_type_ensure (PHOTOS_TYPE_SHARE_POINT_EMAIL);
a2e38e
-      g_type_ensure (PHOTOS_TYPE_SHARE_POINT_GOOGLE);
a2e38e
 
a2e38e
       g_type_ensure (PHOTOS_TYPE_TOOL_COLORS);
a2e38e
       g_type_ensure (PHOTOS_TYPE_TOOL_CROP);
a2e38e
-- 
a2e38e
2.30.2
a2e38e