[tracker] libtracker-miner: Add tracker_file_system_get_file_type()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-miner: Add tracker_file_system_get_file_type()
- Date: Sun, 27 Apr 2014 15:16:18 +0000 (UTC)
commit 2c0c3879a7b3db791cfb0a5921f0c574ebcdcb0b
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Mar 22 23:16:06 2014 +0100
libtracker-miner: Add tracker_file_system_get_file_type()
This function is useful to find out the GFileType as stored in the
TrackerFileSystem, as that's stored there from crawling time.
src/libtracker-miner/tracker-file-system.c | 22 ++++++++++++++++++++++
src/libtracker-miner/tracker-file-system.h | 2 ++
2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-system.c b/src/libtracker-miner/tracker-file-system.c
index 7d52cf6..9b029d2 100644
--- a/src/libtracker-miner/tracker-file-system.c
+++ b/src/libtracker-miner/tracker-file-system.c
@@ -901,3 +901,25 @@ tracker_file_system_forget_files (TrackerFileSystem *file_system,
g_list_foreach (data.list, (GFunc) forget_file, NULL);
g_list_free (data.list);
}
+
+GFileType
+tracker_file_system_get_file_type (TrackerFileSystem *file_system,
+ GFile *file)
+{
+ GFileType file_type = G_FILE_TYPE_UNKNOWN;
+ GNode *node;
+
+ g_return_val_if_fail (TRACKER_IS_FILE_SYSTEM (file_system), file_type);
+ g_return_val_if_fail (G_IS_FILE (file), file_type);
+
+ node = file_system_get_node (file_system, file);
+
+ if (node) {
+ FileNodeData *node_data;
+
+ node_data = node->data;
+ file_type = node_data->file_type;
+ }
+
+ return file_type;
+}
diff --git a/src/libtracker-miner/tracker-file-system.h b/src/libtracker-miner/tracker-file-system.h
index d06949c..978cf9c 100644
--- a/src/libtracker-miner/tracker-file-system.h
+++ b/src/libtracker-miner/tracker-file-system.h
@@ -75,6 +75,8 @@ void tracker_file_system_forget_files (TrackerFileSystem *file_system
GFile *root,
GFileType file_type);
+GFileType tracker_file_system_get_file_type (TrackerFileSystem *file_system,
+ GFile *file);
/* properties */
void tracker_file_system_register_property (GQuark prop,
GDestroyNotify destroy_notify);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]