[tracker/miner-userguide: 10/15] tracker-miner-fs: Move tracker-miner-applications-meego to tracker-miner-meego
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-userguide: 10/15] tracker-miner-fs: Move tracker-miner-applications-meego to tracker-miner-meego
- Date: Fri, 25 Nov 2011 10:21:13 +0000 (UTC)
commit f0a1639503f074567f3a21e23d527f8519852f8c
Author: Martyn Russell <martyn lanedo com>
Date: Thu Nov 24 10:29:27 2011 +0000
tracker-miner-fs: Move tracker-miner-applications-meego to tracker-miner-meego
src/miners/fs/Makefile.am | 6 ++--
src/miners/fs/tracker-miner-applications.c | 8 +++---
src/miners/fs/tracker-miner-locale.c | 29 +++++++++++---------
src/miners/fs/tracker-miner-locale.h | 10 +++---
...lications-meego.cpp => tracker-miner-meego.cpp} | 11 +++++--
...-applications-meego.h => tracker-miner-meego.h} | 12 +++++---
src/miners/fs/tracker-miner-userguides.c | 6 ++--
7 files changed, 46 insertions(+), 36 deletions(-)
---
diff --git a/src/miners/fs/Makefile.am b/src/miners/fs/Makefile.am
index dcb2ec8..964a4ce 100644
--- a/src/miners/fs/Makefile.am
+++ b/src/miners/fs/Makefile.am
@@ -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 = \
diff --git a/src/miners/fs/tracker-miner-applications.c b/src/miners/fs/tracker-miner-applications.c
index 4c76f09..b7cd0fd 100644
--- a/src/miners/fs/tracker-miner-applications.c
+++ b/src/miners/fs/tracker-miner-applications.c
@@ -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 ();
}
}
@@ -1009,7 +1009,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...");
diff --git a/src/miners/fs/tracker-miner-locale.c b/src/miners/fs/tracker-miner-locale.c
index a2df862..95d54b5 100644
--- a/src/miners/fs/tracker-miner-locale.c
+++ b/src/miners/fs/tracker-miner-locale.c
@@ -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. */
diff --git a/src/miners/fs/tracker-miner-locale.h b/src/miners/fs/tracker-miner-locale.h
index 2cf64a5..6aa909d 100644
--- a/src/miners/fs/tracker-miner-locale.h
+++ b/src/miners/fs/tracker-miner-locale.h
@@ -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__ */
diff --git a/src/miners/fs/tracker-miner-applications-meego.cpp b/src/miners/fs/tracker-miner-meego.cpp
similarity index 94%
rename from src/miners/fs/tracker-miner-applications-meego.cpp
rename to src/miners/fs/tracker-miner-meego.cpp
index 09c1fa6..548f424 100644
--- a/src/miners/fs/tracker-miner-applications-meego.cpp
+++ b/src/miners/fs/tracker-miner-meego.cpp
@@ -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;
diff --git a/src/miners/fs/tracker-miner-applications-meego.h b/src/miners/fs/tracker-miner-meego.h
similarity index 82%
rename from src/miners/fs/tracker-miner-applications-meego.h
rename to src/miners/fs/tracker-miner-meego.h
index b4fdab9..a678c96 100644
--- a/src/miners/fs/tracker-miner-applications-meego.h
+++ b/src/miners/fs/tracker-miner-meego.h
@@ -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__ */
diff --git a/src/miners/fs/tracker-miner-userguides.c b/src/miners/fs/tracker-miner-userguides.c
index fdace99..999f3ad 100644
--- a/src/miners/fs/tracker-miner-userguides.c
+++ b/src/miners/fs/tracker-miner-userguides.c
@@ -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...");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]