[tracker/refactor-extractor] squash
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/refactor-extractor] squash
- Date: Fri, 12 Feb 2010 12:06:36 +0000 (UTC)
commit 82f5b2299051816762c3116b5870915d0d705eaa
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Feb 12 13:06:15 2010 +0100
squash
.../tracker-extract-gstreamer-helix.c | 32 ++-----------------
src/tracker-extract/tracker-topanalyzer.cpp | 20 ++----------
2 files changed, 7 insertions(+), 45 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer-helix.c b/src/tracker-extract/tracker-extract-gstreamer-helix.c
index 9e17b37..3bd99d3 100644
--- a/src/tracker-extract/tracker-extract-gstreamer-helix.c
+++ b/src/tracker-extract/tracker-extract-gstreamer-helix.c
@@ -372,15 +372,9 @@ add_int64_info (TrackerSparqlBuilder *metadata,
const gchar *key,
gint64 info)
{
- gchar *value_str;
-
- value_str = g_strdup_printf ("%" G_GINT64_FORMAT, info);
-
tracker_sparql_builder_subject_iri (metadata, uri);
tracker_sparql_builder_predicate_iri (metadata, key);
- tracker_sparql_builder_object_unvalidated (metadata, value_str);
-
- g_free (value_str);
+ tracker_sparql_builder_object_int64 (metadata, info);
}
static void
@@ -389,15 +383,9 @@ add_uint_info (TrackerSparqlBuilder *metadata,
gchar *key,
guint info)
{
- gchar *value_str;
-
- value_str = g_strdup_printf ("%d", info);
-
tracker_sparql_builder_subject_iri (metadata, uri);
tracker_sparql_builder_predicate_iri (metadata, key);
- tracker_sparql_builder_object_unvalidated (metadata, value_str);
-
- g_free (value_str);
+ tracker_sparql_builder_object_int64 (metadata, info);
}
static void
@@ -437,15 +425,9 @@ add_uint_gst_tag (TrackerSparqlBuilder *metadata,
ret = gst_tag_list_get_uint (tag_list, tag, &n);
if (ret) {
- gchar *value_str;
-
- value_str = g_strdup_printf ("%" G_GUINT32_FORMAT, n);
-
tracker_sparql_builder_subject_iri (metadata, uri);
tracker_sparql_builder_predicate_iri (metadata, key);
- tracker_sparql_builder_object_unvalidated (metadata, value_str);
-
- g_free (value_str);
+ tracker_sparql_builder_object_int64 (metadata, n);
}
}
@@ -462,15 +444,9 @@ add_double_gst_tag (TrackerSparqlBuilder *metadata,
ret = gst_tag_list_get_double (tag_list, tag, &n);
if (ret) {
- gchar *value_str;
-
- value_str = g_strdup_printf ("%g", n);
-
tracker_sparql_builder_subject_iri (metadata, uri);
tracker_sparql_builder_predicate_iri (metadata, key);
- tracker_sparql_builder_object_unvalidated (metadata, value_str);
-
- g_free (value_str);
+ tracker_sparql_builder_object_double (metadata, n);
}
}
diff --git a/src/tracker-extract/tracker-topanalyzer.cpp b/src/tracker-extract/tracker-topanalyzer.cpp
index 3c56c1a..1bf129e 100644
--- a/src/tracker-extract/tracker-topanalyzer.cpp
+++ b/src/tracker-extract/tracker-topanalyzer.cpp
@@ -256,19 +256,15 @@ namespace Tracker {
int32_t value)
{
const gchar *predicate = predicateMapping (field);
- gchar *value_str;
if (!predicateNeeded (predicate)) {
return;
}
- value_str = g_strdup_printf ("%d", value);
-
tracker_sparql_builder_subject_iri (metadata, idx->path().c_str());
tracker_sparql_builder_predicate_iri (metadata, predicate);
- tracker_sparql_builder_object_unvalidated (metadata, value_str);
+ tracker_sparql_builder_object_int64 (metadata, value);
- g_free (value_str);
}
void Tracker::TripleCollector::addValue (const AnalysisResult* idx,
@@ -276,19 +272,14 @@ namespace Tracker {
uint32_t value )
{
const gchar *predicate = predicateMapping (field);
- gchar *value_str;
if (!predicateNeeded (predicate)) {
return;
}
- value_str = g_strdup_printf ("%" G_GUINT32_FORMAT, value);
-
tracker_sparql_builder_subject_iri (metadata, idx->path().c_str());
tracker_sparql_builder_predicate_iri (metadata, predicate);
- tracker_sparql_builder_object_unvalidated (metadata, value_str);
-
- g_free (value_str);
+ tracker_sparql_builder_object_int64 (metadata, value);
}
void Tracker::TripleCollector::addValue (const AnalysisResult* idx,
@@ -296,19 +287,14 @@ namespace Tracker {
double value )
{
const gchar *predicate = predicateMapping (field);
- gchar *value_str;
if (!predicateNeeded (predicate)) {
return;
}
- value_str = g_strdup_printf ("%g", value);
-
tracker_sparql_builder_subject_iri (metadata, idx->path().c_str());
tracker_sparql_builder_predicate_iri (metadata, predicate);
- tracker_sparql_builder_object_unvalidated (metadata, value_str);
-
- g_free (value_str);
+ tracker_sparql_builder_object_double (metadata, value);
}
void Tracker::TripleCollector::addTriplet (const std::string& subject,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]