[gnome-photos/wip/flickr: 6/7] source: Assert that get_filter should never be called for "all"



commit 8f9cd5672209f650adc5336d604a0a89c346bf1f
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Jul 1 15:16:23 2013 +0200

    source: Assert that get_filter should never be called for "all"
    
    PhotosSourceManager should handle "all" by calling get_filter on every
    other object and then ORing them up.

 src/photos-source.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-source.c b/src/photos-source.c
index b93f246..5112a21 100644
--- a/src/photos-source.c
+++ b/src/photos-source.c
@@ -78,12 +78,11 @@ photos_source_get_filter (PhotosFilterable *iface)
   PhotosSource *self = PHOTOS_SOURCE (iface);
   PhotosSourcePrivate *priv = self->priv;
 
+  g_assert_cmpstr (priv->id, !=, PHOTOS_SOURCE_STOCK_ALL);
+
   if (g_strcmp0 (priv->id, PHOTOS_SOURCE_STOCK_LOCAL) == 0)
     return photos_query_builder_filter_local ();
 
-  if (g_strcmp0 (priv->id, PHOTOS_SOURCE_STOCK_ALL) == 0)
-    return photos_query_builder_filter_local (); /* TODO: Add non local query */
-
   return photos_source_build_filter_resource (self);
 }
 


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