[gnome-photos] 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] source: Assert that built-in Sources have been handled elsewhere
- Date: Mon, 22 Jan 2018 15:33:51 +0000 (UTC)
commit cf6e42101f5f3f93b87951ef0d64406d797a5c69
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]