[gnome-photos/wip/rishi/collection: 2/29] source: Assert that built-in Sources have been handled elsewhere
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/collection: 2/29] source: Assert that built-in Sources have been handled elsewhere
- Date: Sun, 21 Jan 2018 20:17:44 +0000 (UTC)
commit 39c8d58841b950d62afcf1937b82da645a5186de
Author: Debarshi Ray <debarshir gnome org>
Date: Sun Jan 21 20:38:34 2018 +0100
source: Assert that built-in Sources have been handled elsewhere
src/photos-source.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-source.c b/src/photos-source.c
index 42c2360c..24e0706c 100644
--- a/src/photos-source.c
+++ b/src/photos-source.c
@@ -62,14 +62,18 @@ EGG_DEFINE_COUNTER (instances, "PhotosSource", "Instances", "Number of PhotosSou
static gchar *
photos_source_build_filter_resource (PhotosSource *self)
{
- gchar *filter;
+ g_autofree gchar *filter = NULL;
+ gchar *ret_val = NULL;
- if (!self->builtin)
+ g_return_val_if_fail (!self->builtin, NULL);
+
+ if (self->object != NULL)
filter = g_strdup_printf ("(nie:dataSource (?urn) = '%s')", self->id);
else
- filter = g_strdup ("(false)");
+ g_return_val_if_reached (NULL);
- return filter;
+ ret_val = g_steal_pointer (&filter);
+ return ret_val;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]