Commit 3b94940d authored by Martyn Russell's avatar Martyn Russell

tracker-miner-fs: Move tracker-miner-applications-meego to tracker-miner-meego

parent 66e466b0
......@@ -59,15 +59,15 @@ tracker_miner_fs_LDADD = \
if HAVE_MAEMO
tracker_miner_fs_SOURCES += \
tracker-miner-userguides.c \
tracker-mienr-userguides.h
tracker-miner-userguides.h
tracker_miner_fs_CFLAGS = $(LIBXML2_CFLAGS)
tracker_miner_fs_LDADD += $(LIBXML2_LIBS)
endif
if HAVE_MEEGOTOUCH
tracker_miner_fs_SOURCES += \
tracker-miner-applications-meego.cpp \
tracker-miner-applications-meego.h
tracker-miner-meego.cpp \
tracker-miner-meego.h
endif
marshal_sources = \
......
......@@ -27,7 +27,7 @@
#include "tracker-miner-locale.h"
#ifdef HAVE_MEEGOTOUCH
#include "tracker-miner-applications-meego.h"
#include "tracker-miner-meego.h"
#endif
#define GROUP_DESKTOP_ENTRY "Desktop Entry"
......@@ -195,8 +195,8 @@ miner_finished_cb (TrackerMinerFS *fs,
gpointer user_data)
{
/* Update locale file if necessary */
if (tracker_miner_applications_locale_changed ()) {
tracker_miner_applications_locale_set_current ();
if (tracker_miner_locale_changed ()) {
tracker_miner_locale_set_current ();
}
}
......@@ -1004,7 +1004,7 @@ tracker_miner_applications_detect_locale_changed (TrackerMiner *miner)
{
gboolean changed;
changed = tracker_miner_applications_locale_changed ();
changed = tracker_miner_locale_changed ();
if (changed) {
g_message ("Locale change detected, so resetting miner to "
"remove all previously created items...");
......
......@@ -27,10 +27,13 @@
#include "tracker-miner-applications-meego.h"
#endif
#define TRACKER_MINER_APPLICATIONS_LOCALE_FILE "miner-applications-locale.txt"
/* NOTE: This applies to more miners than just the application miner,
* it's kept this way to avoid breaking things.
*/
#define TRACKER_MINER_LOCALE_FILE "miner-applications-locale.txt"
static gchar *
miner_applications_locale_get_filename (void)
miner_locale_get_filename (void)
{
gchar *data_dir;
gchar *filename;
......@@ -39,7 +42,7 @@ miner_applications_locale_get_filename (void)
data_dir = g_build_filename (g_get_user_cache_dir (),
"tracker",
NULL);
filename = g_build_filename (data_dir, TRACKER_MINER_APPLICATIONS_LOCALE_FILE, NULL);
filename = g_build_filename (data_dir, TRACKER_MINER_LOCALE_FILE, NULL);
g_free (data_dir);
......@@ -47,11 +50,11 @@ miner_applications_locale_get_filename (void)
}
static gchar *
miner_applications_locale_get_previous (void)
miner_locale_get_previous (void)
{
gchar *locale_file, *locale = NULL;
locale_file = miner_applications_locale_get_filename ();
locale_file = miner_locale_get_filename ();
if (G_LIKELY (g_file_test (locale_file, G_FILE_TEST_EXISTS))) {
gchar *contents;
......@@ -79,14 +82,14 @@ miner_applications_locale_get_previous (void)
}
static gchar *
miner_applications_locale_get_current (void)
miner_locale_get_current (void)
{
gchar *current_locale;
#ifdef HAVE_MEEGOTOUCH
/* If we have meegotouch enabled, take the correct locale as the one from
* meegotouch. */
current_locale = tracker_miner_applications_meego_get_locale ();
current_locale = tracker_miner_meego_get_locale ();
#else
/* Get current tracker LANG locale */
current_locale = tracker_locale_get (TRACKER_LOCALE_LANGUAGE);
......@@ -96,16 +99,16 @@ miner_applications_locale_get_current (void)
}
void
tracker_miner_applications_locale_set_current (void)
tracker_miner_locale_set_current (void)
{
GError *error = NULL;
gchar *locale_file, *locale = NULL;
locale_file = miner_applications_locale_get_filename ();
locale_file = miner_locale_get_filename ();
g_message (" Creating locale file '%s'", locale_file);
locale = miner_applications_locale_get_current ();
locale = miner_locale_get_current ();
if (locale == NULL) {
locale = g_strdup ("");
......@@ -122,16 +125,16 @@ tracker_miner_applications_locale_set_current (void)
}
gboolean
tracker_miner_applications_locale_changed (void)
tracker_miner_locale_changed (void)
{
gchar *previous_locale;
gchar *current_locale;
gboolean changed;
current_locale = miner_applications_locale_get_current ();
current_locale = miner_locale_get_current ();
/* Get previous locale */
previous_locale = miner_applications_locale_get_previous ();
previous_locale = miner_locale_get_previous ();
/* Note that having both to NULL is actually valid, they would default
* to the unicode collation without locale-specific stuff. */
......
......@@ -17,14 +17,14 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __TRACKER_MINER_FS_APPLICATIONS_LOCALE_H__
#define __TRACKER_MINER_FS_APPLICATIONS_LOCALE_H__
#ifndef __TRACKER_MINER_FS_LOCALE_H__
#define __TRACKER_MINER_FS_LOCALE_H__
G_BEGIN_DECLS
void tracker_miner_applications_locale_set_current (void);
gboolean tracker_miner_applications_locale_changed (void);
void tracker_miner_locale_set_current (void);
gboolean tracker_miner_locale_changed (void);
G_END_DECLS
#endif /* __TRACKER_MINER_FS_APPLICATIONS_LOCALE_H__ */
#endif /* __TRACKER_MINER_FS_LOCALE_H__ */
......@@ -24,10 +24,12 @@
#include <glib-object.h>
#include "tracker-miner-applications-meego.h"
#include "tracker-miner-meego.h"
static QCoreApplication *app = NULL;
/*
* MeeGo application functions...
*/
void
tracker_miner_applications_meego_init (void)
{
......@@ -79,8 +81,11 @@ tracker_miner_applications_meego_translate (const gchar *catalogue,
return ret;
}
/*
* MeeGo general functions...
*/
gchar *
tracker_miner_applications_meego_get_locale (void)
tracker_miner_meego_get_locale (void)
{
/* Get the system default locale */
MLocale locale;
......
......@@ -17,19 +17,21 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __TRACKER_MINER_FS_APPLICATIONS_MEEGO_H__
#define __TRACKER_MINER_FS_APPLICATIONS_MEEGO_H__
#ifndef __TRACKER_MINER_FS_MEEGO_H__
#define __TRACKER_MINER_FS_MEEGO_H__
G_BEGIN_DECLS
/* MeeGo general functions */
gchar *tracker_miner_meego_get_locale (void);
/* MeeGo application functions */
gchar *tracker_miner_applications_meego_translate (const gchar *catalogue,
const gchar *id);
gchar *tracker_miner_applications_meego_get_locale (void);
void tracker_miner_applications_meego_init (void);
void tracker_miner_applications_meego_shutdown (void);
G_END_DECLS
#endif /* __TRACKER_MINER_FS_APPLICATIONS_MEEGO_H__ */
#endif /* __TRACKER_MINER_FS_MEEGO_H__ */
......@@ -169,8 +169,8 @@ miner_finished_cb (TrackerMinerFS *fs,
gpointer user_data)
{
/* Update locale file if necessary */
if (tracker_miner_applications_locale_changed ()) {
tracker_miner_applications_locale_set_current ();
if (tracker_miner_locale_changed ()) {
tracker_miner_locale_set_current ();
}
}
......@@ -692,7 +692,7 @@ tracker_miner_userguides_detect_locale_changed (TrackerMiner *miner)
{
gboolean changed;
changed = tracker_miner_applications_locale_changed ();
changed = tracker_miner_locale_changed ();
if (changed) {
g_message ("Locale change detected, so resetting miner to "
"remove all previously created items...");
......
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