[tracker] tracker-extract: Insert nmm:flash as a Resource



commit 8110036df7871e61a9e3ba9cd60690ce7ce651b7
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jan 2 19:28:24 2017 +0100

    tracker-extract: Insert nmm:flash as a Resource
    
    This is not an string, but a builtin class, so it must be dealt
    with as a resource.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776723

 src/libtracker-extract/tracker-xmp.c       |    6 +++++-
 src/tracker-extract/tracker-extract-gif.c  |    7 ++++++-
 src/tracker-extract/tracker-extract-jpeg.c |    6 +++++-
 src/tracker-extract/tracker-extract-pdf.c  |    6 +++++-
 src/tracker-extract/tracker-extract-png.c  |    7 ++++++-
 src/tracker-extract/tracker-extract-tiff.c |    7 ++++++-
 6 files changed, 33 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-xmp.c b/src/libtracker-extract/tracker-xmp.c
index 1c6915b..b716d39 100644
--- a/src/libtracker-extract/tracker-xmp.c
+++ b/src/libtracker-extract/tracker-xmp.c
@@ -995,7 +995,11 @@ tracker_xmp_apply_to_resource (TrackerResource *resource,
        }
 
        if (data->flash) {
-               tracker_resource_set_string (resource, "nmm:flash", data->flash);
+               TrackerResource *flash;
+
+               flash = tracker_resource_new (data->flash);
+               tracker_resource_set_relation (resource, "nmm:flash", flash);
+               g_object_unref (flash);
        }
 
        if (data->focal_length) {
diff --git a/src/tracker-extract/tracker-extract-gif.c b/src/tracker-extract/tracker-extract-gif.c
index 73a2461..b3dc2c3 100644
--- a/src/tracker-extract/tracker-extract-gif.c
+++ b/src/tracker-extract/tracker-extract-gif.c
@@ -319,7 +319,12 @@ read_metadata (GifFileType          *gifFile,
        }
 
        if (xd->flash) {
-               tracker_resource_set_string (metadata, "nmm:flash", xd->flash); }
+               TrackerResource *flash;
+
+               flash = tracker_resource_new (xd->flash);
+               tracker_resource_set_relation (metadata, "nmm:flash", flash);
+               g_object_unref (flash);
+       }
 
        if (xd->focal_length) {
                tracker_resource_set_string (metadata, "nmm:focalLength", xd->focal_length);
diff --git a/src/tracker-extract/tracker-extract-jpeg.c b/src/tracker-extract/tracker-extract-jpeg.c
index bddb376..c4aab0e 100644
--- a/src/tracker-extract/tracker-extract-jpeg.c
+++ b/src/tracker-extract/tracker-extract-jpeg.c
@@ -421,7 +421,11 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
        }
 
        if (md.flash) {
-               tracker_resource_set_string (metadata, "nmm:flash", md.flash);
+               TrackerResource *flash;
+
+               flash = tracker_resource_new (md.flash);
+               tracker_resource_set_relation (metadata, "nmm:flash", flash);
+               g_object_unref (flash);
        }
 
        if (md.focal_length) {
diff --git a/src/tracker-extract/tracker-extract-pdf.c b/src/tracker-extract/tracker-extract-pdf.c
index b6b4274..4755df6 100644
--- a/src/tracker-extract/tracker-extract-pdf.c
+++ b/src/tracker-extract/tracker-extract-pdf.c
@@ -485,7 +485,11 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
                }
 
                if (xd->flash) {
-                       tracker_resource_set_string (metadata, "nmm:flash", xd->flash);
+                       TrackerResource *flash;
+
+                       flash = tracker_resource_new (xd->flash);
+                       tracker_resource_set_relation (metadata, "nmm:flash", flash);
+                       g_object_unref (flash);
                }
 
                if (xd->focal_length) {
diff --git a/src/tracker-extract/tracker-extract-png.c b/src/tracker-extract/tracker-extract-png.c
index 95ae299..eb0f5c7 100644
--- a/src/tracker-extract/tracker-extract-png.c
+++ b/src/tracker-extract/tracker-extract-png.c
@@ -434,7 +434,12 @@ read_metadata (TrackerResource      *metadata,
        }
 
        if (md.flash) {
-               tracker_resource_set_string (metadata, "nmm:flash", md.flash); }
+               TrackerResource *flash;
+
+               flash = tracker_resource_new (md.flash);
+               tracker_resource_set_relation (metadata, "nmm:flash", flash);
+               g_object_unref (flash);
+       }
 
        if (md.focal_length) {
                tracker_resource_set_string (metadata, "nmm:focalLength", md.focal_length);
diff --git a/src/tracker-extract/tracker-extract-tiff.c b/src/tracker-extract/tracker-extract-tiff.c
index 5acfe17..c41a724 100644
--- a/src/tracker-extract/tracker-extract-tiff.c
+++ b/src/tracker-extract/tracker-extract-tiff.c
@@ -546,7 +546,12 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
        }
 
        if (md.flash) {
-               tracker_resource_set_string (metadata, "nmm:flash", md.flash); }
+               TrackerResource *flash;
+
+               flash = tracker_resource_new (md.flash);
+               tracker_resource_set_relation (metadata, "nmm:flash", flash);
+               g_object_unref (flash);
+       }
 
        if (md.focal_length) {
                tracker_resource_set_string (metadata, "nmm:focalLength", md.focal_length);


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