Commit 0872daaa authored by Martyn Russell's avatar Martyn Russell

tracker-miner-fs: Added locale checking on directories

If not the current locale, we ignore the userguide directory, but only
when we HAVE_MEEGOTOUCH.
parent 343771ae
......@@ -24,7 +24,7 @@
#include "tracker-miner-locale.h"
#ifdef HAVE_MEEGOTOUCH
#include "tracker-miner-applications-meego.h"
#include "tracker-miner-meego.h"
#endif
/* NOTE: This applies to more miners than just the application miner,
......
......@@ -240,7 +240,7 @@ static gboolean
miner_userguides_check_directory (TrackerMinerFS *fs,
GFile *file)
{
gboolean retval = TRUE;
gboolean retval = FALSE;
gchar *basename;
/* We want to inspect all the passed dirs and their children except one:
......@@ -248,12 +248,42 @@ miner_userguides_check_directory (TrackerMinerFS *fs,
*/
basename = g_file_get_basename (file);
/* FIXME: Perhaps this is too broad? */
if (strcmp (basename, "images") == 0) {
if (strcmp (basename, "images") != 0) {
g_message (" Ignoring:'%s'", basename);
retval = FALSE;
retval = TRUE;
}
/* Without MeeGoTouch, we simply index ALL content. */
#ifdef HAVE_MEEGOTOUCH
GFile *parent;
gchar *parent_basename;
/* We want to ignore all locales which are not the current one:
* $prefix/userguide/contents/$locale/
*/
parent = g_file_get_parent (file);
if (parent) {
parent_basename = g_file_get_basename (parent);
} else {
parent_basename = NULL;
}
if (parent_basename && strcmp (parent_basename, "contents") == 0) {
gchar *locale;
locale = tracker_miner_meego_get_locale ();
if (locale && g_ascii_strcasecmp (locale, basename) == 0) {
g_message (" Ignoring:'%s' (doesn't match locale:'%s')",
basename, locale);
retval = TRUE;
}
g_free (locale);
}
g_free (parent_basename);
#endif /* HAVE_MEEGOTOUCH */
g_free (basename);
return retval;
......
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