[gnome-photos] camera-cache: Be more careful when sanitizing the camera strings



commit 576d6a57f9f227bfc0a99e16b93451b0b36b6c2a
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Aug 12 17:08:57 2013 +0200

    camera-cache: Be more careful when sanitizing the camera strings

 src/photos-camera-cache.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-camera-cache.c b/src/photos-camera-cache.c
index 931136a..1f96e77 100644
--- a/src/photos-camera-cache.c
+++ b/src/photos-camera-cache.c
@@ -65,8 +65,12 @@ photos_camera_cache_cursor_next (GObject *source_object, GAsyncResult *res, gpoi
   manufacturer = tracker_sparql_cursor_get_string (cursor, 0, NULL);
   model = tracker_sparql_cursor_get_string (cursor, 1, NULL);
 
-  if (g_str_has_prefix (model, manufacturer))
+  if (manufacturer == NULL && model == NULL)
+    camera = NULL;
+  else if (manufacturer == NULL || g_str_has_prefix (model, manufacturer))
     camera = g_strdup (model);
+  else if (model == NULL)
+    camera = g_strdup (manufacturer);
   else
     camera = g_strconcat (manufacturer, " ", model, NULL);
 


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