Commit bf5be2ec authored by Carlos Garnacho's avatar Carlos Garnacho

libtracker-miner: Pass GFileInfo onto crawler check func

We already have a GFileInfo for the inspected file from the crawler,
push this forward so it can be used on file checks.
parent 0c60dffd
......@@ -262,6 +262,7 @@ static gboolean
invoke_check (TrackerCrawler *crawler,
TrackerCrawlerCheckFlags flags,
GFile *file,
GFileInfo *file_info,
GList *children)
{
TrackerCrawlerPrivate *priv;
......@@ -271,7 +272,8 @@ invoke_check (TrackerCrawler *crawler,
if (!priv->check_func)
return TRUE;
return priv->check_func (crawler, flags, file, children,
return priv->check_func (crawler, flags,
file, file_info, children,
priv->check_func_data);
}
......@@ -280,9 +282,12 @@ check_file (TrackerCrawler *crawler,
DirectoryRootInfo *info,
GFile *file)
{
GFileInfo *file_info;
gboolean use = FALSE;
use = invoke_check (crawler, TRACKER_CRAWLER_CHECK_FILE, file, NULL);
file_info = g_object_get_qdata (G_OBJECT (file), file_info_quark);
use = invoke_check (crawler, TRACKER_CRAWLER_CHECK_FILE,
file, file_info, NULL);
info->files_found++;
......@@ -298,9 +303,12 @@ check_directory (TrackerCrawler *crawler,
DirectoryRootInfo *info,
GFile *file)
{
GFileInfo *file_info;
gboolean use = FALSE;
use = invoke_check (crawler, TRACKER_CRAWLER_CHECK_DIRECTORY, file, NULL);
file_info = g_object_get_qdata (G_OBJECT (file), file_info_quark);
use = invoke_check (crawler, TRACKER_CRAWLER_CHECK_DIRECTORY,
file, file_info, NULL);
info->directories_found++;
......@@ -599,6 +607,7 @@ data_provider_data_process (DataProviderData *dpd)
TrackerCrawler *crawler;
GSList *l;
GList *children = NULL;
GFileInfo *file_info;
gboolean use;
crawler = dpd->crawler;
......@@ -610,7 +619,9 @@ data_provider_data_process (DataProviderData *dpd)
children = g_list_prepend (children, child_data->child);
}
use = invoke_check (crawler, TRACKER_CRAWLER_CHECK_CONTENT, dpd->dir_file, children);
file_info = g_object_get_qdata (G_OBJECT (dpd->dir_file), file_info_quark);
use = invoke_check (crawler, TRACKER_CRAWLER_CHECK_CONTENT,
dpd->dir_file, file_info, children);
g_list_free (children);
if (!use) {
......
......@@ -54,6 +54,7 @@ typedef enum {
typedef gboolean (*TrackerCrawlerCheckFunc) (TrackerCrawler *crawler,
TrackerCrawlerCheckFlags flags,
GFile *file,
GFileInfo *file_info,
const GList *children,
gpointer user_data);
......
......@@ -1377,6 +1377,7 @@ static gboolean
crawler_check_func (TrackerCrawler *crawler,
TrackerCrawlerCheckFlags flags,
GFile *file,
GFileInfo *file_info,
const GList *children,
gpointer user_data)
{
......
......@@ -78,6 +78,7 @@ static gboolean
check_func (TrackerCrawler *crawler,
TrackerCrawlerCheckFlags flags,
GFile *file,
GFileInfo *file_info,
const GList *children,
gpointer user_data)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment