[tracker/volume-mountpoints: 3/9] libtracker-miner: New tracker_miner_fs_query_urn() API method
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/volume-mountpoints: 3/9] libtracker-miner: New tracker_miner_fs_query_urn() API method
- Date: Fri, 16 Jul 2010 10:46:31 +0000 (UTC)
commit c70d5c8202663b435ad6d9edf7e820548d6f73df
Author: Aleksander Morgado <aleksander lanedo com>
Date: Thu Jul 15 10:21:31 2010 +0200
libtracker-miner: New tracker_miner_fs_query_urn() API method
.../libtracker-miner/libtracker-miner-sections.txt | 1 +
src/libtracker-miner/tracker-miner-fs.c | 32 ++++++++++++++++++++
src/libtracker-miner/tracker-miner-fs.h | 2 +
3 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/libtracker-miner/libtracker-miner-sections.txt b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
index 8b50b2f..e33626b 100644
--- a/docs/reference/libtracker-miner/libtracker-miner-sections.txt
+++ b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
@@ -77,6 +77,7 @@ tracker_miner_fs_get_throttle
tracker_miner_fs_force_recheck
tracker_miner_fs_get_parent_urn
tracker_miner_fs_get_urn
+tracker_miner_fs_query_urn
<SUBSECTION Standard>
TRACKER_MINER_FS
TRACKER_IS_MINER_FS
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 01bea25..642fe23 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -3549,6 +3549,7 @@ tracker_miner_fs_get_urn (TrackerMinerFS *fs,
g_return_val_if_fail (TRACKER_IS_MINER_FS (fs), NULL);
g_return_val_if_fail (G_IS_FILE (file), NULL);
+ /* Check if found in currently processed data */
data = process_data_find (fs, file, FALSE);
if (!data) {
@@ -3567,6 +3568,37 @@ tracker_miner_fs_get_urn (TrackerMinerFS *fs,
}
/**
+ * tracker_miner_fs_query_urn:
+ * @fs: a #TrackerMinerFS
+ * @file: a #GFile
+ *
+ * If the item exists in the store, this function retrieves
+ * the URN of the given #GFile
+
+ * If @file doesn't exist in the store yet, %NULL will be returned.
+ *
+ * Returns: A newly allocated string with the URN containing the data associated
+ * to @file, or %NULL.
+ *
+ * Since: 0.9
+ **/
+gchar *
+tracker_miner_fs_query_urn (TrackerMinerFS *fs,
+ GFile *file)
+{
+ gchar *iri = NULL;
+
+ g_return_val_if_fail (TRACKER_IS_MINER_FS (fs), NULL);
+ g_return_val_if_fail (G_IS_FILE (file), NULL);
+
+ /* We don't really need to check the return value here, just
+ * looking at the output iri is enough. */
+ item_query_exists (fs, file, &iri, NULL);
+
+ return iri;
+}
+
+/**
* tracker_miner_fs_get_parent_urn:
* @fs: a #TrackerMinerFS
* @file: a #GFile obtained in #TrackerMinerFS::process-file
diff --git a/src/libtracker-miner/tracker-miner-fs.h b/src/libtracker-miner/tracker-miner-fs.h
index 8860442..33095d6 100644
--- a/src/libtracker-miner/tracker-miner-fs.h
+++ b/src/libtracker-miner/tracker-miner-fs.h
@@ -114,6 +114,8 @@ G_CONST_RETURN gchar *tracker_miner_fs_get_urn (TrackerMinerFS *fs,
GFile *file);
G_CONST_RETURN gchar *tracker_miner_fs_get_parent_urn (TrackerMinerFS *fs,
GFile *file);
+gchar *tracker_miner_fs_query_urn (TrackerMinerFS *fs,
+ GFile *file);
void tracker_miner_fs_force_recheck (TrackerMinerFS *fs);
void tracker_miner_fs_set_initial_crawling (TrackerMinerFS *fs,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]