[gnome-photos/wip/rishi/collection: 41/46] query, source-manager: Support specifically querying for local content



commit 13eefa6bca7a5b4d8523060cd0f23109e87b363d
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 6 00:36:01 2018 +0100

    query, source-manager: Support specifically querying for local content
    
    https://gitlab.gnome.org/GNOME/gnome-photos/issues/29

 src/photos-query.h          | 5 +++--
 src/photos-source-manager.c | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-query.h b/src/photos-query.h
index e59c03df..72decf3a 100644
--- a/src/photos-query.h
+++ b/src/photos-query.h
@@ -67,8 +67,9 @@ typedef enum
   PHOTOS_QUERY_FLAGS_COLLECTIONS    = 1 << 1,
   PHOTOS_QUERY_FLAGS_FAVORITES      = 1 << 2,
   PHOTOS_QUERY_FLAGS_IMPORT         = 1 << 3,
-  PHOTOS_QUERY_FLAGS_OVERVIEW       = 1 << 4,
-  PHOTOS_QUERY_FLAGS_SEARCH         = 1 << 5
+  PHOTOS_QUERY_FLAGS_LOCAL          = 1 << 4,
+  PHOTOS_QUERY_FLAGS_OVERVIEW       = 1 << 5,
+  PHOTOS_QUERY_FLAGS_SEARCH         = 1 << 6
 } PhotosQueryFlags;
 
 extern const gchar *PHOTOS_QUERY_COLLECTIONS_IDENTIFIER;
diff --git a/src/photos-source-manager.c b/src/photos-source-manager.c
index 92871f02..9fe5c690 100644
--- a/src/photos-source-manager.c
+++ b/src/photos-source-manager.c
@@ -89,6 +89,10 @@ photos_source_manager_get_filter (PhotosBaseManager *mngr, gint flags)
       if (mount == NULL)
         source = NULL;
     }
+  else if (flags & PHOTOS_QUERY_FLAGS_LOCAL)
+    {
+      source = photos_base_manager_get_object_by_id (mngr, PHOTOS_SOURCE_STOCK_LOCAL);
+    }
   else if (flags & PHOTOS_QUERY_FLAGS_SEARCH)
     {
       source = photos_base_manager_get_active_object (mngr);


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