[gnome-photos/wip/flickr: 4/7] item-manager: Create a FlickrItem when we get one
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/flickr: 4/7] item-manager: Create a FlickrItem when we get one
- Date: Mon, 1 Jul 2013 13:26:15 +0000 (UTC)
commit 3c566c7f78571805cfcfb1571715ec70037546d5
Author: Marek Chalupa <mchalupa redhat com>
Date: Mon Jul 1 11:44:02 2013 +0200
item-manager: Create a FlickrItem when we get one
Fixes: https://bugzilla.gnome.org/697675
src/photos-item-manager.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index b20943a..84e00f0 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -30,6 +30,7 @@
#include "photos-collection-manager.h"
#include "photos-item-manager.h"
#include "photos-local-item.h"
+#include "photos-flickr-item.h"
#include "photos-query.h"
#include "photos-single-item-job.h"
#include "photos-tracker-change-event.h"
@@ -265,5 +266,20 @@ photos_item_manager_add_item (PhotosItemManager *self, TrackerSparqlCursor *curs
PhotosBaseItem *
photos_item_manager_create_item (PhotosItemManager *self, TrackerSparqlCursor *cursor)
{
- return photos_local_item_new (cursor);
+ PhotosBaseItem *ret_val = NULL;
+ gchar *identifier = NULL;
+
+ identifier = g_strdup (tracker_sparql_cursor_get_string (cursor, PHOTOS_QUERY_COLUMNS_IDENTIFIER, NULL));
+
+ if (identifier != NULL)
+ {
+ if (g_str_has_prefix (identifier, "flickr:"))
+ ret_val = photos_flickr_item_new (cursor);
+ }
+
+ if (ret_val == NULL)
+ ret_val = photos_local_item_new (cursor);
+
+ g_free (identifier);
+ return ret_val;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]