| Tracker Miner Library Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | Signals | ||||
struct TrackerIndexingTree; TrackerIndexingTreeClass; TrackerIndexingTree * tracker_indexing_tree_new (void); TrackerIndexingTree * tracker_indexing_tree_new_with_root (GFile *root); void tracker_indexing_tree_add (TrackerIndexingTree *tree,GFile *directory,TrackerDirectoryFlags flags); void tracker_indexing_tree_remove (TrackerIndexingTree *tree,GFile *directory); void tracker_indexing_tree_add_filter (TrackerIndexingTree *tree,TrackerFilterType filter,const gchar *glob_string); void tracker_indexing_tree_clear_filters (TrackerIndexingTree *tree,TrackerFilterType type); gboolean tracker_indexing_tree_file_matches_filter (TrackerIndexingTree *tree,TrackerFilterType type,GFile *file); gboolean tracker_indexing_tree_file_is_indexable (TrackerIndexingTree *tree,GFile *file,GFileType file_type); gboolean tracker_indexing_tree_parent_is_indexable (TrackerIndexingTree *tree,GFile *parent,GList *children); gboolean tracker_indexing_tree_get_filter_hidden (TrackerIndexingTree *tree); void tracker_indexing_tree_set_filter_hidden (TrackerIndexingTree *tree,gboolean filter_hidden); TrackerFilterPolicy tracker_indexing_tree_get_default_policy (TrackerIndexingTree *tree,TrackerFilterType filter); void tracker_indexing_tree_set_default_policy (TrackerIndexingTree *tree,TrackerFilterType filter,TrackerFilterPolicy policy); GFile * tracker_indexing_tree_get_root (TrackerIndexingTree *tree,GFile *file,TrackerDirectoryFlags *directory_flags); GFile * tracker_indexing_tree_get_master_root (TrackerIndexingTree *tree); gboolean tracker_indexing_tree_file_is_root (TrackerIndexingTree *tree,GFile *file); GList * tracker_indexing_tree_list_roots (TrackerIndexingTree *tree);
TrackerIndexingTree handles the tree of directories configured to be indexed by the TrackerMinerFS.
struct TrackerIndexingTree;
Base object used to configure indexing within TrackerMinerFS items.
typedef struct {
GObjectClass parent_class;
void (* directory_added) (TrackerIndexingTree *indexing_tree,
GFile *directory);
void (* directory_removed) (TrackerIndexingTree *indexing_tree,
GFile *directory);
void (* directory_updated) (TrackerIndexingTree *indexing_tree,
GFile *directory);
/* <Private> */
gpointer padding[10];
} TrackerIndexingTreeClass;
Class for the TrackerIndexingTree.
TrackerIndexingTree * tracker_indexing_tree_new (void);
Returns a newly created TrackerIndexingTree
Returns : |
a newly allocated TrackerIndexingTree |
Since 0.14.0
TrackerIndexingTree * tracker_indexing_tree_new_with_root
(GFile *root);
If root is NULL, the default value is 'file:///'. Using NULL
here is the equivalent to calling tracker_indexing_tree_new() which
takes no root argument.
|
The top level URL |
Returns : |
a newly allocated TrackerIndexingTree |
Since 1.2.2
void tracker_indexing_tree_add (TrackerIndexingTree *tree,GFile *directory,TrackerDirectoryFlags flags);
Adds a directory to the indexing tree with the given configuration flags.
|
a TrackerIndexingTree |
|
GFile pointing to a directory |
|
Configuration flags for the directory |
void tracker_indexing_tree_remove (TrackerIndexingTree *tree,GFile *directory);
Removes directory from the indexing tree, note that
only directories previously added with tracker_indexing_tree_add()
can be effectively removed.
|
a TrackerIndexingTree |
|
GFile pointing to a directory |
void tracker_indexing_tree_add_filter (TrackerIndexingTree *tree,TrackerFilterType filter,const gchar *glob_string);
Adds a new filter for basenames.
|
a TrackerIndexingTree |
|
filter type |
|
glob-style string for the filter |
void tracker_indexing_tree_clear_filters (TrackerIndexingTree *tree,TrackerFilterType type);
Clears all filters of a given type.
|
a TrackerIndexingTree |
|
filter type to clear |
gboolean tracker_indexing_tree_file_matches_filter (TrackerIndexingTree *tree,TrackerFilterType type,GFile *file);
Returns TRUE if file matches any filter of the given filter type.
|
a TrackerIndexingTree |
|
filter type |
|
a GFile |
Returns : |
TRUE if file is filtered |
gboolean tracker_indexing_tree_file_is_indexable (TrackerIndexingTree *tree,GFile *file,GFileType file_type);
returns TRUE if file should be indexed according to the
parameters given through tracker_indexing_tree_add() and
tracker_indexing_tree_add_filter().
If file_type is G_FILE_TYPE_UNKNOWN, file type will be queried to the
file system.
|
a TrackerIndexingTree |
|
a GFile |
|
a GFileType |
Returns : |
TRUE if file should be indexed. |
gboolean tracker_indexing_tree_parent_is_indexable (TrackerIndexingTree *tree,GFile *parent,GList *children);
returns TRUE if parent should be indexed based on its contents.
|
a TrackerIndexingTree |
|
parent directory |
|
children within parent. [element-type GFile]
|
Returns : |
TRUE if parent should be indexed. |
gboolean tracker_indexing_tree_get_filter_hidden
(TrackerIndexingTree *tree);
void tracker_indexing_tree_set_filter_hidden (TrackerIndexingTree *tree,gboolean filter_hidden);
TrackerFilterPolicy tracker_indexing_tree_get_default_policy (TrackerIndexingTree *tree,TrackerFilterType filter);
void tracker_indexing_tree_set_default_policy (TrackerIndexingTree *tree,TrackerFilterType filter,TrackerFilterPolicy policy);
GFile * tracker_indexing_tree_get_root (TrackerIndexingTree *tree,GFile *file,TrackerDirectoryFlags *directory_flags);
Returns the GFile that was previously added through tracker_indexing_tree_add()
and would equal or contain file, or NULL if none applies.
If the return value is non-NULL, directory_flags would contain the
TrackerDirectoryFlags applying to file.
|
a TrackerIndexingTree |
|
a GFile |
|
return location for the applying TrackerDirectoryFlags. [out] |
Returns : |
the effective parent in tree, or NULL. [transfer none]
|
GFile * tracker_indexing_tree_get_master_root
(TrackerIndexingTree *tree);
Returns the GFile that represents the master root location for all
indexing locations. For example, if
file:///etc is an indexed path and so was
file:///home/user, the master root is
file:///. Only one scheme per tree can be
used, so you can not mix http and
file roots in tree.
The return value should NEVER be NULL. In
cases where no root is given, we fallback to
file:///.
Roots explained:
master root = top most level root node, e.g. file:///
config root = a root node from GSettings, e.g. file:///home/martyn/Documents
root = ANY root, normally config root, but it can also apply to roots added for devices, which technically are not a config root or a master root.
|
a TrackerIndexingTree |
Returns : |
the effective root for all locations, or
NULL on error. The root is owned by tree and should not be freed.
It can be referenced using g_object_ref(). [transfer none]
|
Since 1.2.
gboolean tracker_indexing_tree_file_is_root (TrackerIndexingTree *tree,GFile *file);
GList * tracker_indexing_tree_list_roots (TrackerIndexingTree *tree);
Returns the list of indexing roots in tree
|
a TrackerIndexingTree |
Returns : |
The list
of roots, the list itself must be freed with g_list_free(),
the list elements are owned by tree and should not be
freed. [transfer container][element-type GFile]
|
"filter-hidden" property "filter-hidden" gboolean : Read / Write
Whether hidden resources are filtered.
Default value: FALSE
"directory-added" signalvoid user_function (TrackerIndexingTree *trackerindexingtree,
GFile *arg1,
gpointer user_data) : Run Last
"directory-removed" signalvoid user_function (TrackerIndexingTree *trackerindexingtree,
GFile *arg1,
gpointer user_data) : Run Last
"directory-updated" signalvoid user_function (TrackerIndexingTree *trackerindexingtree,
GFile *arg1,
gpointer user_data) : Run Last