[gnome-photos] source-manager: Implement has_online_sources



commit 64fd0b1ef96127bf04c0c4f46da6af96c84ddd43
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Dec 31 15:24:39 2013 +0100

    source-manager: Implement has_online_sources

 src/photos-source-manager.c |   27 +++++++++++++++++++++++++++
 src/photos-source-manager.h |    2 ++
 2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-source-manager.c b/src/photos-source-manager.c
index bacc73d..99a72be 100644
--- a/src/photos-source-manager.c
+++ b/src/photos-source-manager.c
@@ -199,6 +199,33 @@ photos_source_manager_get_for_provider_type (PhotosSourceManager *self, const gc
 
 
 gboolean
+photos_source_manager_has_online_sources (PhotosSourceManager *self)
+{
+  GHashTable *sources;
+  GHashTableIter iter;
+  PhotosSource *source;
+  gboolean ret_val = FALSE;
+
+  sources = photos_base_manager_get_objects (PHOTOS_BASE_MANAGER (self));
+  g_hash_table_iter_init (&iter, sources);
+  while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &source))
+    {
+      GoaAccount *account;
+      GoaObject *object;
+
+      object = photos_source_get_goa_object (source);
+      if (object != NULL)
+        {
+          ret_val = TRUE;
+          break;
+        }
+    }
+
+  return ret_val;
+}
+
+
+gboolean
 photos_source_manager_has_provider_type (PhotosSourceManager *self, const gchar *provider_type)
 {
   GList *items;
diff --git a/src/photos-source-manager.h b/src/photos-source-manager.h
index 9dbdc1e..4dff9ac 100644
--- a/src/photos-source-manager.h
+++ b/src/photos-source-manager.h
@@ -73,6 +73,8 @@ PhotosBaseManager        *photos_source_manager_dup_singleton      (void);
 GList                    *photos_source_manager_get_for_provider_type (PhotosSourceManager *self,
                                                                        const gchar *provider_type);
 
+gboolean                  photos_source_manager_has_online_sources    (PhotosSourceManager *self);
+
 gboolean                  photos_source_manager_has_provider_type     (PhotosSourceManager *self,
                                                                        const gchar *provider_type);
 


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