Commit 59677e40 authored by Marek Chalupa's avatar Marek Chalupa Committed by Debarshi Ray

source-manager: Track GoaObjects that implement GoaPhotos

Bump minimum GOA version to 3.8.0 because we need the GoaPhotos
interface.

Fixes: https://bugzilla.gnome.org/697675
parent 92d422a4
......@@ -26,6 +26,7 @@ GLIB_GSETTINGS
EXEMPI_MIN_VERSION=1.99.5
GLIB_MIN_VERSION=2.35.1
GOA_MIN_VERSION=3.8.0
GTK_MIN_VERSION=3.9.4
LIBEXIF_MIN_VERSION=0.6.14
LIBRSVG_MIN_VERSION=2.26.0
......@@ -88,7 +89,7 @@ PKG_CHECK_MODULES(GIO, [gio-2.0])
PKG_CHECK_MODULES(GNOME_DESKTOP, [gnome-desktop-3.0])
AC_DEFINE([GNOME_DESKTOP_USE_UNSTABLE_API], [], [We are aware that GNOME_DESKTOP's API can change])
PKG_CHECK_MODULES(GOA, [goa-1.0])
PKG_CHECK_MODULES(GOA, [goa-1.0 >= $GOA_MIN_VERSION])
AC_DEFINE([GOA_API_IS_SUBJECT_TO_CHANGE], [], [We are aware that GOA's API can change])
PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= $GTK_MIN_VERSION])
......
......@@ -48,6 +48,9 @@ photos_source_manager_client_account_added (GoaClient *client, GoaObject *object
PhotosSourceManager *self = PHOTOS_SOURCE_MANAGER (user_data);
PhotosSource *source;
if (goa_object_peek_photos (object) == NULL)
return;
source = photos_source_new_from_goa_object (object);
photos_base_manager_add_object (PHOTOS_BASE_MANAGER (self), G_OBJECT (source));
g_object_unref (source);
......@@ -71,8 +74,11 @@ static void
photos_source_manager_client_account_changed (GoaClient *client, GoaObject *object, gpointer user_data)
{
PhotosSourceManager *self = PHOTOS_SOURCE_MANAGER (user_data);
photos_source_manager_client_account_removed (client, object, user_data);
photos_source_manager_client_account_added (client, object, user_data);
if (goa_object_peek_photos (object) == NULL)
photos_source_manager_client_account_removed (client, object, user_data);
else
photos_source_manager_client_account_added (client, object, user_data);
}
......@@ -86,15 +92,18 @@ photos_source_manager_refresh_accounts (PhotosSourceManager *self)
accounts = goa_client_get_accounts (priv->client);
for (l = accounts; l != NULL; l = l->next)
{
GoaObject *object = GOA_OBJECT (l->data);
PhotosSource *source;
if (goa_object_peek_account (GOA_OBJECT (l->data)) == NULL)
if (goa_object_peek_account (object) == NULL)
continue;
if (goa_object_peek_photos (object) == NULL)
continue;
/* TODO: uncomment when we start supporting online providers */
/* source = photos_source_new_from_goa_object (GOA_OBJECT (l->data)); */
/* photos_base_manager_add_object (PHOTOS_BASE_MANAGER (self), G_OBJECT (source)); */
/* g_object_unref (source); */
source = photos_source_new_from_goa_object (GOA_OBJECT (l->data));
photos_base_manager_add_object (PHOTOS_BASE_MANAGER (self), G_OBJECT (source));
g_object_unref (source);
}
g_list_free_full (accounts, g_object_unref);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment