[tracker] libtracker-common: New tracker_file_is_hidden() file utility
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-common: New tracker_file_is_hidden() file utility
- Date: Wed, 1 Dec 2010 10:23:54 +0000 (UTC)
commit f5bd249eee48fcf29a9cffc0c1325c82d076e788
Author: Aleksander Morgado <aleksander lanedo com>
Date: Wed Dec 1 11:23:25 2010 +0100
libtracker-common: New tracker_file_is_hidden() file utility
src/libtracker-common/tracker-file-utils.c | 19 +++++++++++++++++++
src/libtracker-common/tracker-file-utils.h | 1 +
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-common/tracker-file-utils.c b/src/libtracker-common/tracker-file-utils.c
index 959be4c..f29279a 100644
--- a/src/libtracker-common/tracker-file-utils.c
+++ b/src/libtracker-common/tracker-file-utils.c
@@ -783,3 +783,22 @@ tracker_file_is_locked (GFile *file)
return retval;
}
+
+gboolean
+tracker_file_is_hidden (GFile *file)
+{
+ GFileInfo *file_info;
+ gboolean is_hidden = FALSE;
+
+ file_info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN,
+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+ NULL, NULL);
+ if (file_info) {
+ /* Check if GIO says the file is hidden */
+ is_hidden = g_file_info_get_is_hidden (file_info);
+ g_object_unref (file_info);
+ }
+
+ return is_hidden;
+}
diff --git a/src/libtracker-common/tracker-file-utils.h b/src/libtracker-common/tracker-file-utils.h
index d47f373..dd9e0fa 100644
--- a/src/libtracker-common/tracker-file-utils.h
+++ b/src/libtracker-common/tracker-file-utils.h
@@ -43,6 +43,7 @@ gchar * tracker_file_get_mime_type (GFile *file);
gboolean tracker_file_lock (GFile *file);
gboolean tracker_file_unlock (GFile *file);
gboolean tracker_file_is_locked (GFile *file);
+gboolean tracker_file_is_hidden (GFile *file);
/* Path utils */
gboolean tracker_path_is_in_path (const gchar *path,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]