Top | ![]() |
![]() |
![]() |
![]() |
GQuark | tracker_miner_manager_error_quark () |
TrackerMinerManager * | tracker_miner_manager_new () |
TrackerMinerManager * | tracker_miner_manager_new_full () |
GSList * | tracker_miner_manager_get_running () |
GSList * | tracker_miner_manager_get_available () |
gboolean | tracker_miner_manager_pause () |
gboolean | tracker_miner_manager_pause_for_process () |
gboolean | tracker_miner_manager_resume () |
gboolean | tracker_miner_manager_is_active () |
gboolean | tracker_miner_manager_is_paused () |
gboolean | tracker_miner_manager_get_status () |
const gchar * | tracker_miner_manager_get_display_name () |
const gchar * | tracker_miner_manager_get_description () |
gboolean | tracker_miner_manager_reindex_by_mimetype () |
gboolean | tracker_miner_manager_index_file () |
void | tracker_miner_manager_index_file_async () |
gboolean | tracker_miner_manager_index_file_finish () |
gboolean | tracker_miner_manager_index_file_for_process () |
void | tracker_miner_manager_index_file_for_process_async () |
gboolean | tracker_miner_manager_index_file_for_process_finish () |
TrackerMinerManager keeps track of available miners, their current progress/status, and also allows basic external control on them, such as pausing or resuming data processing.
TrackerMinerManager *
tracker_miner_manager_new (void
);
Creates a new TrackerMinerManager instance.
Note: Auto-starting miners when querying status will be enabled.
Since: 0.8
TrackerMinerManager * tracker_miner_manager_new_full (gboolean auto_start
,GError **error
);
Creates a new TrackerMinerManager.
auto_start |
Flag to disable auto-starting the miners when querying status |
|
error |
a GError to report errors. |
Since: 0.10.5
GSList *
tracker_miner_manager_get_running (TrackerMinerManager *manager
);
Returns a list of references for all active miners. Active miners are miners which are running within a process.
a GSList which
must be freed with g_slist_free()
and all contained data with g_free()
.
Otherwise NULL
is returned if there are no miners.
[transfer full][element-type utf8][nullable]
Since: 0.8
GSList *
tracker_miner_manager_get_available (TrackerMinerManager *manager
);
Returns a list of references for all available miners. Available miners are miners which may or may not be running in a process at the current time.
a GSList which
must be freed with g_slist_free()
and all contained data with g_free()
.
Otherwise NULL
is returned if there are no miners.
[transfer full][element-type utf8][nullable]
Since: 0.8
gboolean tracker_miner_manager_pause (TrackerMinerManager *manager
,const gchar *miner
,const gchar *reason
,guint32 *cookie
);
Asks miner
to pause. a miner could be paused by
several reasons, and its activity won't be resumed
until all pause requests have been resumed.
manager |
||
miner |
miner reference |
|
reason |
reason to pause |
|
cookie |
return location for the pause cookie ID. |
[out][allow-none] |
Since: 0.8
gboolean tracker_miner_manager_pause_for_process (TrackerMinerManager *manager
,const gchar *miner
,const gchar *reason
,guint32 *cookie
);
This function operates exactly the same way as
tracker_miner_manager_pause()
with the exception that if the calling
process dies, the pause is resumed. This API is useful for cases
where the calling process has a risk of crashing without resuming
the pause.
NOTE: If you call g_object_unref()
on the manager
before you
intend to resume the pause and it finalizes, it will automatically
resume.
manager |
||
miner |
miner reference |
|
reason |
reason to pause |
|
cookie |
return location for the pause cookie ID. |
[out][allow-none] |
Since: 0.10.15
gboolean tracker_miner_manager_resume (TrackerMinerManager *manager
,const gchar *miner
,guint32 cookie
);
Tells miner
to resume activity. The miner won't actually resume
operations until all pause requests have been resumed.
Since: 0.8
gboolean tracker_miner_manager_is_active (TrackerMinerManager *manager
,const gchar *miner
);
Returns the miner's current activity.
Since: 0.8
gboolean tracker_miner_manager_is_paused (TrackerMinerManager *manager
,const gchar *miner
,GStrv *applications
,GStrv *reasons
);
This function either returns FALSE
if the miner is not paused,
or returns TRUE
and fills in applications
and reasons
with
the pause reasons and the applications that asked for it. Both
arrays will have the same lengh, and will be sorted so the
application/pause reason pairs have the same index.
manager |
||
miner |
miner reference |
|
applications |
return location for application names. |
[out callee-allocates][allow-none][transfer full] |
reasons |
return location for pause reasons. |
[out callee-allocates][allow-none][transfer full] |
Since: 0.8
gboolean tracker_miner_manager_get_status (TrackerMinerManager *manager
,const gchar *miner
,gchar **status
,gdouble *progress
,gint *remaining_time
);
Returns the current status, progress and remaining time for miner
.
remaining_time
will be 0 if not possible to compute it yet,
and less than zero if it is not applicable.
manager |
||
miner |
miner reference |
|
status |
return location for status. |
[out][allow-none] |
progress |
return location for progress. |
[out][allow-none] |
remaining_time |
return location for remaining time. |
[out][allow-none] |
Since: 0.12
const gchar * tracker_miner_manager_get_display_name (TrackerMinerManager *manager
,const gchar *miner
);
Returns a translated display name for miner
.
Since: 0.8
const gchar * tracker_miner_manager_get_description (TrackerMinerManager *manager
,const gchar *miner
);
Returns the description for the given miner
.
Since: 0.8
gboolean tracker_miner_manager_reindex_by_mimetype (TrackerMinerManager *manager
,const GStrv mimetypes
,GError **error
);
Tells the filesystem miner to reindex any file with a mimetype in
the mimetypes
list.
On failure error
will be set.
manager |
||
mimetypes |
an array of mimetypes (E.G. "text/plain"). All items with a mimetype in that list will be reindexed. |
[in] |
error |
return location for errors. |
[out callee-allocates][transfer full][allow-none] |
Since: 0.10
gboolean tracker_miner_manager_index_file (TrackerMinerManager *manager
,GFile *file
,GCancellable *cancellable
,GError **error
);
Tells the filesystem miner to start indexing the file
.
On failure error
will be set.
manager |
||
file |
a URL valid in GIO of a file to give to the miner for processing |
|
cancellable |
a GCancellable, or |
[allow-none] |
error |
return location for errors. |
[out callee-allocates][transfer full][allow-none] |
Since: 2.0
void tracker_miner_manager_index_file_async (TrackerMinerManager *manager
,GFile *file
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Tells the filesystem miner to start indexing the file
. Once the message has been sent,
callback
will be called. You can then call tracker_miner_manager_index_file_finish()
to get the result.
manager |
||
file |
a URL valid in GIO of a file to give to the miner for processing |
|
cancellable |
a GCancellable, or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to the callback function |
Since: 0.16
gboolean tracker_miner_manager_index_file_finish (TrackerMinerManager *manager
,GAsyncResult *result
,GError **error
);
Finishes a request to index a file. See tracker_miner_manager_index_file_async()
On failure error
will be set.
manager |
||
result |
a GAsyncResult |
|
error |
return location for errors. |
[out callee-allocates][transfer full][allow-none] |
Since: 0.16
gboolean tracker_miner_manager_index_file_for_process (TrackerMinerManager *manager
,GFile *file
,GCancellable *cancellable
,GError **error
);
This function operates exactly the same way as
tracker_miner_manager_index_file()
with the exception that if the
calling process dies, the indexing is cancelled. This API is useful
for cases where the calling process wants to tie the indexing
operation closely to its own lifetime.
On failure error
will be set.
manager |
||
file |
a URL valid in GIO of a file to give to the miner for processing |
|
cancellable |
a GCancellable, or |
[allow-none] |
error |
return location for errors. |
[out callee-allocates][transfer full][allow-none] |
Since: 1.10
void tracker_miner_manager_index_file_for_process_async (TrackerMinerManager *manager
,GFile *file
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
This function operates exactly the same way as
tracker_miner_manager_index_file()
with the exception that if the
calling process dies, the indexing is cancelled. This API is useful
for cases where the calling process wants to tie the indexing
operation closely to its own lifetime.
When the operation is finished, callback
will be called. You can
then call tracker_miner_manager_index_file_for_process_finish()
to
get the result of the operation.
manager |
||
file |
a URL valid in GIO of a file to give to the miner for processing |
|
cancellable |
a GCancellable, or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to the callback function |
Since: 1.10
gboolean tracker_miner_manager_index_file_for_process_finish (TrackerMinerManager *manager
,GAsyncResult *result
,GError **error
);
Finishes a request to index a file. See tracker_miner_manager_index_file_for_process_async()
On failure error
will be set.
manager |
||
result |
a GAsyncResult |
|
error |
return location for errors. |
[out callee-allocates][transfer full][allow-none] |
Since: 1.10
#define TRACKER_MINER_MANAGER_ERROR tracker_miner_manager_error_quark ()
Enumeration values used in errors returned by the TrackerMinerManager API.
Since: 0.8
struct TrackerMinerManager { GObject parent_instance; };
Object to query and control miners.
typedef struct { GObjectClass parent_class; void (* miner_progress) (TrackerMinerManager *manager, const gchar *miner_name, const gchar *status, gdouble progress); void (* miner_paused) (TrackerMinerManager *manager, const gchar *miner_name); void (* miner_resumed) (TrackerMinerManager *manager, const gchar *miner_name); void (* miner_activated) (TrackerMinerManager *manager, const gchar *miner_name); void (* miner_deactivated) (TrackerMinerManager *manager, const gchar *miner_name); } TrackerMinerManagerClass;
The progress signal for all miners including name, status and progress as a percentage between 0 and 1. |
||
The paused signal for all miners known about. |
||
The resumed signal for all miners known about. |
||
The activated signal for all miners which indicates the miner is available on d-bus. |
||
The deactivate for all miners which indicates the miner is no longer available on d-bus. |