[tracker/new-app-miner: 1/3] tracker-miner-apps: Make this a separate process, moved out of tracker-miner-fs
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/new-app-miner: 1/3] tracker-miner-apps: Make this a separate process, moved out of tracker-miner-fs
- Date: Thu, 27 Mar 2014 17:14:22 +0000 (UTC)
commit e049f89225bc84ee79faf5a03079e9fd5e97b1ba
Author: Martyn Russell <martyn lanedo com>
Date: Thu Mar 27 17:04:10 2014 +0000
tracker-miner-apps: Make this a separate process, moved out of tracker-miner-fs
configure.ac | 38 +++-
data/Makefile.am | 6 +
data/miners/Makefile.am | 5 +-
data/tracker-miner-apps.desktop.in | 19 ++
src/libtracker-common/Makefile.am | 16 +-
src/libtracker-common/tracker-common.h | 5 +
.../tracker-miner-locale.c | 0
.../tracker-miner-locale.h | 0
.../tracker-miner-meego.cpp | 0
.../fs => libtracker-common}/tracker-miner-meego.h | 0
src/miners/Makefile.am | 4 +
src/miners/apps/Makefile.am | 28 +++
src/miners/apps/tracker-main.c | 254 ++++++++++++++++++++
.../{fs => apps}/tracker-miner-applications.c | 9 +-
.../{fs => apps}/tracker-miner-applications.h | 0
src/miners/fs/Makefile.am | 9 -
src/miners/fs/tracker-main.c | 58 +-----
src/miners/fs/tracker-miner-userguides.c | 11 +-
18 files changed, 374 insertions(+), 88 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4adac1a..5fc4e3e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -342,6 +342,13 @@ PKG_CHECK_MODULES(TRACKER_MINER_FS, [$TRACKER_MINER_FS_REQUIRED])
TRACKER_MINER_FS_LIBS="$TRACKER_MINER_FS_LIBS -lz -lm"
+# Check requirements for tracker-miner-apps
+TRACKER_MINER_APPS_REQUIRED="glib-2.0 >= $GLIB_REQUIRED"
+
+PKG_CHECK_MODULES(TRACKER_MINER_APPS, [$TRACKER_MINER_APPS_REQUIRED])
+
+#TRACKER_MINER_FS_LIBS="$TRACKER_MINER_FS_LIBS -lz -lm"
+
# Check requirements for tracker-miner-evolution
evolution_plugin_name=""
@@ -1122,6 +1129,9 @@ if test "x$enable_meegotouch" != "xno"; then
[have_meegotouch=yes],
[have_meegotouch=no])
+ LIBTRACKER_COMMON_CFLAGS="$LIBTRACKER_COMMON_CFLAGS $MEEGOTOUCH_CFLAGS"
+ LIBTRACKER_COMMON_LIBS="$LIBTRACKER_COMMON_LIBS $MEEGOTOUCH_LIBS"
+
LIBTRACKER_EXTRACT_CFLAGS="$LIBTRACKER_EXTRACT_CFLAGS $MEEGOTOUCH_CFLAGS"
LIBTRACKER_EXTRACT_LIBS="$LIBTRACKER_EXTRACT_LIBS $MEEGOTOUCH_LIBS"
@@ -1163,6 +1173,31 @@ fi
AM_CONDITIONAL(HAVE_TRACKER_MINER_FS, test "x$have_tracker_miner_fs" = "xyes")
##################################################################
+# Check for tracker-miner-apps
+##################################################################
+
+have_tracker_miner_apps="yes"
+
+AC_ARG_ENABLE(miner_apps,
+ AS_HELP_STRING([--enable-miner-apps],
+ [enable File System miner [[default=yes]]]),,
+ [enable_tracker_miner_apps=yes])
+
+enable_tracker_miner_apps=$enable_miner_apps
+
+if test "x$enable_tracker_miner_apps" = "xyes"; then
+ if test "x$have_tracker_miner_apps" != "xyes"; then
+ AC_MSG_ERROR([Couldn't find tracker-miner-apps dependencies ($TRACKER_MINER_APPS_REQUIRED).])
+ fi
+else
+ if test "x$enable_tracker_miner_apps" = "xno"; then
+ have_tracker_miner_apps="no (disabled)"
+ fi
+fi
+
+AM_CONDITIONAL(HAVE_TRACKER_MINER_APPS, test "x$have_tracker_miner_apps" = "xyes")
+
+##################################################################
# Check for tracker-miner-rss
##################################################################
@@ -2361,6 +2396,7 @@ AC_CONFIG_FILES([
src/Makefile
src/miners/Makefile
src/miners/fs/Makefile
+ src/miners/apps/Makefile
src/miners/rss/Makefile
src/tracker-store/Makefile
src/tracker-control/Makefile
@@ -2526,8 +2562,8 @@ Data Miners:
FS: $have_tracker_miner_fs (MeeGo support: $have_meegotouch)
Includes File Systems
- Includes Applications
Includes User Guides
+ Applications: $have_tracker_miner_apps
RSS: $have_tracker_miner_rss
Evolution: $have_tracker_miner_evolution
($tracker_miner_evolution_install_dir)
Thunderbird: $have_tracker_miner_thunderbird
($tracker_miner_thunderbird_install_dir)
diff --git a/data/Makefile.am b/data/Makefile.am
index b4b6c86..ad25aa1 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -20,6 +20,10 @@ tracker-miner-fs.desktop.in: tracker-miner-fs.desktop.in.in
@sed -e "s|@libexecdir[ ]|${libexecdir}|" \
-e "s|@VERSION[ ]|${VERSION}|" $< > $@
+tracker-miner-apps.desktop.in: tracker-miner-apps.desktop.in.in
+ @sed -e "s|@libexecdir[ ]|${libexecdir}|" \
+ -e "s|@VERSION[ ]|${VERSION}|" $< > $@
+
tracker-miner-rss.desktop.in: tracker-miner-rss.desktop.in.in
@$(SED) -e "s|@libexecdir[ ]|${libexecdir}|" \
-e "s|@VERSION[ ]|${VERSION}|" $< > $@
@@ -28,6 +32,7 @@ desktop_in_in_files = \
tracker-extract.desktop.in.in \
tracker-store.desktop.in.in \
tracker-miner-fs.desktop.in.in \
+ tracker-miner-apps.desktop.in.in \
tracker-miner-rss.desktop.in.in
# Second take those new .in files and translate them
@@ -35,6 +40,7 @@ desktop_in_files = \
tracker-extract.desktop.in \
tracker-store.desktop.in \
tracker-miner-fs.desktop.in \
+ tracker-miner-apps.desktop.in \
tracker-miner-rss.desktop.in
# Third we choose what we want installed based on config
diff --git a/data/miners/Makefile.am b/data/miners/Makefile.am
index e8af09f..2e96ebc 100644
--- a/data/miners/Makefile.am
+++ b/data/miners/Makefile.am
@@ -21,7 +21,6 @@ tracker_miners_DATA =
if HAVE_TRACKER_MINER_FS
tracker_miners_DATA += \
tracker-miner-extract.desktop \
- tracker-miner-applications.desktop \
tracker-miner-files.desktop
if HAVE_MAEMO
@@ -30,6 +29,10 @@ tracker_miners_DATA += tracker-miner-userguides.desktop
endif
endif
+if HAVE_TRACKER_MINER_APPS
+tracker_miners_DATA += tracker-miner-applications.desktop
+endif
+
if HAVE_TRACKER_MINER_EVOLUTION
tracker_miners_DATA += tracker-miner-evolution.desktop
endif
diff --git a/data/tracker-miner-apps.desktop.in b/data/tracker-miner-apps.desktop.in
new file mode 100644
index 0000000..1a89109
--- /dev/null
+++ b/data/tracker-miner-apps.desktop.in
@@ -0,0 +1,19 @@
+[Desktop Entry]
+_Name=Tracker Application Miner
+_Comment=Indexes information about applications installed
+Icon=
+Exec=/opt/gnome/libexec/tracker-miner-apps
+Terminal=false
+Type=Application
+Categories=Utility;
+X-Meego-Priority=Late
+X-GNOME-Autostart-enabled=true
+X-KDE-autostart-after=panel
+X-KDE-StartupNotify=false
+X-KDE-UniqueApplet=true
+NoDisplay=true
+OnlyShowIn=GNOME;KDE;XFCE;X-MEEGO-HS;X-MEEGO-NB;X-IVI;Unity;
+X-GNOME-Bugzilla-Bugzilla=GNOME
+X-GNOME-Bugzilla-Product=tracker
+X-GNOME-Bugzilla-Component=Miners
+X-GNOME-Bugzilla-Version=1.0.0
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index 2493b25..e342f3c 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -28,7 +28,8 @@ libtracker_common_la_SOURCES = \
tracker-type-utils.c \
tracker-utils.c \
tracker-crc32.c \
- tracker-locale.c
+ tracker-locale.c \
+ tracker-miner-locale.c
noinst_HEADERS = \
tracker-dbus.h \
@@ -47,7 +48,8 @@ noinst_HEADERS = \
tracker-type-utils.h \
tracker-utils.h \
tracker-crc32.h \
- tracker-locale.h
+ tracker-locale.h \
+ tracker-miner-locale.h
if HAVE_TRACKER_FTS
libtracker_common_la_SOURCES += tracker-language.c
@@ -55,8 +57,14 @@ noinst_HEADERS += tracker-language.h
endif
if HAVE_MEEGOTOUCH
-libtracker_common_la_SOURCES += tracker-locale-gconfdbus.c
-noinst_HEADERS += tracker-locale-gconfdbus.h
+libtracker_common_la_SOURCES +=
+ tracker-locale-gconfdbus.c \
+ tracker-locale-gconfdbus.h \
+ tracker-miner-meego.cpp \
+ tracker-miner-meego.h
+noinst_HEADERS += \
+ tracker-locale-gconfdbus.h \
+ tracker-miner-meego.h
endif
libtracker_common_la_LIBADD = \
diff --git a/src/libtracker-common/tracker-common.h b/src/libtracker-common/tracker-common.h
index 502f895..f072baa 100644
--- a/src/libtracker-common/tracker-common.h
+++ b/src/libtracker-common/tracker-common.h
@@ -43,8 +43,13 @@
#include "tracker-type-utils.h"
#include "tracker-utils.h"
#include "tracker-locale.h"
+#include "tracker-miner-locale.h"
#include "tracker-enum-types.h"
+#ifdef HAVE_MEEGOTOUCH
+#include "tracker-miner-meego.h"
+#endif /* HAVE_MEEGOTOUCH */
+
#undef __LIBTRACKER_COMMON_INSIDE__
#endif /* __LIBTRACKER_COMMON_H__ */
diff --git a/src/miners/fs/tracker-miner-locale.c b/src/libtracker-common/tracker-miner-locale.c
similarity index 100%
rename from src/miners/fs/tracker-miner-locale.c
rename to src/libtracker-common/tracker-miner-locale.c
diff --git a/src/miners/fs/tracker-miner-locale.h b/src/libtracker-common/tracker-miner-locale.h
similarity index 100%
rename from src/miners/fs/tracker-miner-locale.h
rename to src/libtracker-common/tracker-miner-locale.h
diff --git a/src/miners/fs/tracker-miner-meego.cpp b/src/libtracker-common/tracker-miner-meego.cpp
similarity index 100%
rename from src/miners/fs/tracker-miner-meego.cpp
rename to src/libtracker-common/tracker-miner-meego.cpp
diff --git a/src/miners/fs/tracker-miner-meego.h b/src/libtracker-common/tracker-miner-meego.h
similarity index 100%
rename from src/miners/fs/tracker-miner-meego.h
rename to src/libtracker-common/tracker-miner-meego.h
diff --git a/src/miners/Makefile.am b/src/miners/Makefile.am
index ad12447..164731b 100644
--- a/src/miners/Makefile.am
+++ b/src/miners/Makefile.am
@@ -4,6 +4,10 @@ if HAVE_TRACKER_MINER_FS
SUBDIRS += fs
endif
+if HAVE_TRACKER_MINER_APPS
+SUBDIRS += apps
+endif
+
if HAVE_TRACKER_MINER_RSS
SUBDIRS += rss
endif
diff --git a/src/miners/apps/Makefile.am b/src/miners/apps/Makefile.am
new file mode 100644
index 0000000..a17b118
--- /dev/null
+++ b/src/miners/apps/Makefile.am
@@ -0,0 +1,28 @@
+AM_CPPFLAGS = \
+ $(BUILD_CFLAGS) \
+ -I$(top_srcdir)/src \
+ -I$(top_builddir)/src \
+ -DSHAREDIR=\""$(datadir)"\" \
+ -DLOCALEDIR=\""$(localedir)"\" \
+ -DLIBEXEC_PATH=\""$(libexecdir)"\" \
+ $(TRACKER_MINER_APPS_CFLAGS)
+
+libexec_PROGRAMS = tracker-miner-apps
+
+tracker_miner_apps_SOURCES = \
+ tracker-main.c \
+ tracker-miner-applications.c \
+ tracker-miner-applications.h
+
+tracker_miner_apps_LDADD = \
+ $(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
+ $(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
+ $(top_builddir)/src/libtracker-common/libtracker-common.la \
+ $(BUILD_LIBS) \
+ $(TRACKER_MINER_APPS_LIBS)
+
+if HAVE_MEEGOTOUCH
+tracker_miner_apps_SOURCES += \
+ tracker-miner-meego.cpp \
+ tracker-miner-meego.h
+endif
diff --git a/src/miners/apps/tracker-main.c b/src/miners/apps/tracker-main.c
new file mode 100644
index 0000000..caef883
--- /dev/null
+++ b/src/miners/apps/tracker-main.c
@@ -0,0 +1,254 @@
+/*
+ * Copyright (C) 2014, Lanedo GmbH. <martyn lanedo com>
+
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <locale.h>
+#include <signal.h>
+#include <errno.h>
+
+#include <glib.h>
+#include <glib-object.h>
+#include <glib/gi18n.h>
+
+#include <libtracker-common/tracker-common.h>
+
+#include <libtracker-miner/tracker-miner.h>
+
+#include "tracker-miner-applications.h"
+
+#define ABOUT \
+ "Tracker " PACKAGE_VERSION "\n"
+
+#define LICENSE \
+ "This program is free software and comes without any warranty.\n" \
+ "It is licensed under version 2 or later of the General Public " \
+ "License which can be viewed at:\n" \
+ "\n" \
+ " http://www.gnu.org/licenses/gpl.txt\n"
+
+static GMainLoop *main_loop;
+
+static gint verbosity = -1;
+static gboolean no_daemon;
+static gboolean version;
+
+static GOptionEntry entries[] = {
+ { "verbosity", 'v', 0,
+ G_OPTION_ARG_INT, &verbosity,
+ N_("Logging, 0 = errors only, "
+ "1 = minimal, 2 = detailed and 3 = debug (default=0)"),
+ NULL },
+ { "no-daemon", 'n', 0,
+ G_OPTION_ARG_NONE, &no_daemon,
+ N_("Runs until all applications are indexed and then exits"),
+ NULL },
+ { "version", 'V', 0,
+ G_OPTION_ARG_NONE, &version,
+ N_("Displays version information"),
+ NULL },
+ { NULL }
+};
+
+static void
+signal_handler (int signo)
+{
+ static gboolean in_loop = FALSE;
+
+ /* Die if we get re-entrant signals handler calls */
+ if (in_loop) {
+ _exit (EXIT_FAILURE);
+ }
+
+ switch (signo) {
+ case SIGTERM:
+ case SIGINT:
+ in_loop = TRUE;
+ if (main_loop != NULL) {
+ g_main_loop_quit (main_loop);
+ } else {
+ exit (0);
+ }
+ /* Fall through */
+ default:
+ if (g_strsignal (signo)) {
+ g_print ("\n");
+ g_print ("Received signal:%d->'%s'\n",
+ signo,
+ g_strsignal (signo));
+ }
+ break;
+ }
+}
+
+static void
+initialize_signal_handler (void)
+{
+#ifndef G_OS_WIN32
+ struct sigaction act;
+ sigset_t empty_mask;
+
+ sigemptyset (&empty_mask);
+ act.sa_handler = signal_handler;
+ act.sa_mask = empty_mask;
+ act.sa_flags = 0;
+
+ sigaction (SIGTERM, &act, NULL);
+ sigaction (SIGINT, &act, NULL);
+ sigaction (SIGHUP, &act, NULL);
+#endif /* G_OS_WIN32 */
+}
+
+static void
+initialize_priority_and_scheduling (TrackerSchedIdle sched_idle,
+ gboolean first_time_index)
+{
+ /* Set CPU priority */
+ if (sched_idle == TRACKER_SCHED_IDLE_ALWAYS ||
+ (sched_idle == TRACKER_SCHED_IDLE_FIRST_INDEX && first_time_index)) {
+ tracker_sched_idle ();
+ }
+
+ /* Set disk IO priority and scheduling */
+ tracker_ioprio_init ();
+
+ /* Set process priority:
+ * The nice() function uses attribute "warn_unused_result" and
+ * so complains if we do not check its returned value. But it
+ * seems that since glibc 2.2.4, nice() can return -1 on a
+ * successful call so we have to check value of errno too.
+ * Stupid...
+ */
+
+ g_message ("Setting priority nice level to 19");
+
+ errno = 0;
+ if (nice (19) == -1 && errno != 0) {
+ const gchar *str = g_strerror (errno);
+
+ g_message ("Couldn't set nice value to 19, %s",
+ str ? str : "no error given");
+ }
+}
+
+static void
+miner_finished_cb (TrackerMinerFS *fs,
+ gdouble seconds_elapsed,
+ guint total_directories_found,
+ guint total_directories_ignored,
+ guint total_files_found,
+ guint total_files_ignored,
+ gpointer user_data)
+{
+ tracker_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
+ seconds_elapsed,
+ total_directories_found,
+ total_files_found);
+
+ if (no_daemon && main_loop) {
+ g_main_loop_quit (main_loop);
+ }
+}
+
+int
+main (gint argc, gchar *argv[])
+{
+ TrackerMiner *miner_applications;
+ GOptionContext *context;
+ GError *error = NULL;
+ gchar *log_filename = NULL;
+
+ main_loop = NULL;
+
+ setlocale (LC_ALL, "");
+
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
+ /* Set timezone info */
+ tzset ();
+
+ /* Translators: this messagge will apper immediately after the
+ * usage string - Usage: COMMAND <THIS_MESSAGE>
+ */
+ context = g_option_context_new (_("- start the application data miner"));
+
+ g_option_context_add_main_entries (context, entries, NULL);
+ g_option_context_parse (context, &argc, &argv, &error);
+ g_option_context_free (context);
+
+ if (error) {
+ g_printerr ("%s\n", error->message);
+ g_error_free (error);
+ return EXIT_FAILURE;
+ }
+
+ if (version) {
+ g_print ("\n" ABOUT "\n" LICENSE "\n");
+ return EXIT_SUCCESS;
+ }
+
+ initialize_signal_handler ();
+
+ tracker_log_init (verbosity, &log_filename);
+ if (log_filename) {
+ g_message ("Using log file:'%s'", log_filename);
+ g_free (log_filename);
+ }
+
+ /* This makes sure we don't steal all the system's resources */
+ initialize_priority_and_scheduling (TRACKER_SCHED_IDLE_ALWAYS, FALSE);
+
+ main_loop = g_main_loop_new (NULL, FALSE);
+
+ g_message ("Checking if we're running as a daemon:");
+ g_message (" %s %s",
+ no_daemon ? "No" : "Yes",
+ no_daemon ? "(forced by command line)" : "");
+
+ /* Create miner for applications */
+ miner_applications = tracker_miner_applications_new (&error);
+ if (!miner_applications) {
+ g_critical ("Couldn't create new applications miner, '%s'",
+ error ? error->message : "unknown error");
+ tracker_log_shutdown ();
+ return EXIT_FAILURE;
+ }
+
+ g_signal_connect (miner_applications, "finished",
+ G_CALLBACK (miner_finished_cb),
+ NULL);
+
+ /* Go, go, go! */
+ tracker_miner_start (miner_applications);
+ g_main_loop_run (main_loop);
+
+ g_message ("Shutdown started");
+
+ g_main_loop_unref (main_loop);
+ g_object_unref (G_OBJECT (miner_applications));
+
+ tracker_log_shutdown ();
+
+ g_print ("\nOK\n\n");
+
+ return EXIT_SUCCESS;
+}
diff --git a/src/miners/fs/tracker-miner-applications.c b/src/miners/apps/tracker-miner-applications.c
similarity index 99%
rename from src/miners/fs/tracker-miner-applications.c
rename to src/miners/apps/tracker-miner-applications.c
index 06d1e54..ced615a 100644
--- a/src/miners/fs/tracker-miner-applications.c
+++ b/src/miners/apps/tracker-miner-applications.c
@@ -19,16 +19,9 @@
#include "config.h"
-#include <libtracker-common/tracker-utils.h>
-#include <libtracker-common/tracker-ontologies.h>
-#include <libtracker-common/tracker-locale.h>
+#include <libtracker-common/tracker-common.h>
#include "tracker-miner-applications.h"
-#include "tracker-miner-locale.h"
-
-#ifdef HAVE_MEEGOTOUCH
-#include "tracker-miner-meego.h"
-#endif
#define GROUP_DESKTOP_ENTRY "Desktop Entry"
diff --git a/src/miners/fs/tracker-miner-applications.h b/src/miners/apps/tracker-miner-applications.h
similarity index 100%
rename from src/miners/fs/tracker-miner-applications.h
rename to src/miners/apps/tracker-miner-applications.h
diff --git a/src/miners/fs/Makefile.am b/src/miners/fs/Makefile.am
index 9c54b8f..b6bfa6e 100644
--- a/src/miners/fs/Makefile.am
+++ b/src/miners/fs/Makefile.am
@@ -30,10 +30,6 @@ tracker_miner_fs_SOURCES = \
tracker-config.c \
tracker-config.h \
tracker-main.c \
- tracker-miner-applications.c \
- tracker-miner-applications.h \
- tracker-miner-locale.c \
- tracker-miner-locale.h \
tracker-miner-files.c \
tracker-miner-files.h \
tracker-miner-files-index.c \
@@ -62,8 +58,3 @@ tracker_miner_fs_CFLAGS = $(LIBXML2_CFLAGS)
tracker_miner_fs_LDADD += $(LIBXML2_LIBS)
endif
-if HAVE_MEEGOTOUCH
-tracker_miner_fs_SOURCES += \
- tracker-miner-meego.cpp \
- tracker-miner-meego.h
-endif
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index 6c7752c..2574d0f 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -45,7 +45,6 @@
#include "tracker-config.h"
#include "tracker-miner-userguides.h"
-#include "tracker-miner-applications.h"
#include "tracker-miner-files.h"
#include "tracker-miner-files-index.h"
#include "tracker-writeback.h"
@@ -63,13 +62,11 @@
#define SECONDS_PER_DAY 60 * 60 * 24
#define OPTION_DISABLE_FILES "files"
-#define OPTION_DISABLE_APPLICATIONS "applications"
#define OPTION_DISABLE_USERGUIDES "userguides"
typedef enum {
DISABLE_NONE,
DISABLE_FILES,
- DISABLE_APPLICATIONS,
#ifdef HAVE_MAEMO
DISABLE_USERGUIDES,
#endif /* HAVE_MAEMO */
@@ -119,7 +116,6 @@ static GOptionEntry entries[] = {
G_OPTION_ARG_CALLBACK, miner_disable_option_arg_func,
N_("Disable miners started as part of this process, options include"
": '" OPTION_DISABLE_FILES "'"
- ", '" OPTION_DISABLE_APPLICATIONS "'"
#ifdef HAVE_MAEMO
", '" OPTION_DISABLE_USERGUIDES "'"
#endif /* HAVE_MAEMO */
@@ -151,15 +147,13 @@ miner_disable_option_arg_func (const gchar *option_value,
G_OPTION_ERROR_FAILED,
"A value is required, either "
"'" OPTION_DISABLE_FILES "', "
- "'" OPTION_DISABLE_APPLICATIONS "' or "
"'" OPTION_DISABLE_USERGUIDES "'");
#else /* HAVE_MAEMO */
g_set_error_literal (error,
G_OPTION_ERROR,
G_OPTION_ERROR_FAILED,
"A value is required, either "
- "'" OPTION_DISABLE_FILES "', "
- "'" OPTION_DISABLE_APPLICATIONS "'");
+ "'" OPTION_DISABLE_FILES "'");
#endif /* HAVE_MAEMO */
return FALSE;
}
@@ -168,8 +162,6 @@ miner_disable_option_arg_func (const gchar *option_value,
if (strcmp (value_casefold, OPTION_DISABLE_FILES) == 0) {
option = DISABLE_FILES;
- } else if (strcmp (value_casefold, OPTION_DISABLE_APPLICATIONS) == 0) {
- option = DISABLE_APPLICATIONS;
#ifdef HAVE_MAEMO
} else if (strcmp (value_casefold, OPTION_DISABLE_USERGUIDES) == 0) {
option = DISABLE_USERGUIDES;
@@ -381,9 +373,6 @@ miner_disabled_check (void)
case DISABLE_FILES:
disabled = strcmp (name_casefold, OPTION_DISABLE_FILES) == 0;
break;
- case DISABLE_APPLICATIONS:
- disabled = strcmp (name_casefold, OPTION_DISABLE_APPLICATIONS) == 0;
- break;
#ifdef HAVE_MAEMO
case DISABLE_USERGUIDES:
@@ -845,7 +834,7 @@ int
main (gint argc, gchar *argv[])
{
TrackerConfig *config;
- TrackerMiner *miner_applications, *miner_files;
+ TrackerMiner *miner_files;
TrackerMinerFilesIndex *miner_files_index;
#ifdef HAVE_MAEMO
TrackerMiner *miner_userguides;
@@ -956,23 +945,9 @@ main (gint argc, gchar *argv[])
return EXIT_FAILURE;
}
- /* Create miner for applications */
- miner_applications = tracker_miner_applications_new (&error);
- if (!miner_applications) {
- g_critical ("Couldn't create new Applications miner: '%s'",
- error ? error->message : "unknown error");
- g_object_unref (miner_files);
- tracker_writeback_shutdown ();
- g_object_unref (config);
- tracker_log_shutdown ();
- g_array_free (disable_options, TRUE);
- return EXIT_FAILURE;
- }
-
/* Create new TrackerMinerFilesIndex object */
miner_files_index = tracker_miner_files_index_new (TRACKER_MINER_FILES (miner_files));
if (!miner_files_index) {
- g_object_unref (miner_applications);
g_object_unref (miner_files);
tracker_writeback_shutdown ();
g_object_unref (config);
@@ -987,7 +962,6 @@ main (gint argc, gchar *argv[])
if (!miner_userguides) {
g_critical ("Couldn't create new User Guides miner: '%s'",
error ? error->message : "unknown error");
- g_object_unref (miner_applications);
g_object_unref (miner_files);
g_object_unref (miner_files_index);
tracker_writeback_shutdown ();
@@ -1035,26 +1009,11 @@ main (gint argc, gchar *argv[])
G_CALLBACK (miner_finished_cb),
NULL);
- /* Configure applications miner */
- tracker_miner_fs_set_initial_crawling (TRACKER_MINER_FS (miner_applications), do_crawling);
-
#ifdef HAVE_MAEMO
/* Configure userguides miner */
tracker_miner_fs_set_initial_crawling (TRACKER_MINER_FS (miner_userguides), do_crawling);
-#endif /* HAVE_MAEMO */
/* If a locale change was detected, always do mtime checks */
- if (tracker_miner_applications_detect_locale_changed (miner_applications)) {
- if (!do_mtime_checking)
- g_debug ("Forcing mtime check in applications miner as locale change was detected");
- tracker_miner_fs_set_mtime_checking (TRACKER_MINER_FS (miner_applications), TRUE);
- } else {
- tracker_miner_fs_set_mtime_checking (TRACKER_MINER_FS (miner_applications),
do_mtime_checking);
- }
-
-
-#ifdef HAVE_MAEMO
- /* If a locale change was detected, always do mtime checks */
if (tracker_miner_userguides_detect_locale_changed (miner_userguides)) {
if (!do_mtime_checking)
g_debug ("Forcing mtime check in userguides miner as locale change was detected");
@@ -1062,25 +1021,15 @@ main (gint argc, gchar *argv[])
} else {
tracker_miner_fs_set_mtime_checking (TRACKER_MINER_FS (miner_userguides), do_mtime_checking);
}
-#endif /* HAVE_MAEMO */
-
- g_signal_connect (miner_applications, "finished",
- G_CALLBACK (miner_finished_cb),
- NULL);
-#ifdef HAVE_MAEMO
g_signal_connect (miner_userguides, "finished",
G_CALLBACK (miner_finished_cb),
NULL);
-#endif /* HAVE_MAEMO */
- /* Setup miners, applications first in list */
-#ifdef HAVE_MAEMO
miners = g_slist_prepend (miners, miner_userguides);
#endif /* HAVE_MAEMO */
miners = g_slist_prepend (miners, miner_files);
- miners = g_slist_prepend (miners, miner_applications);
miner_handle_first (config, do_mtime_checking);
@@ -1092,11 +1041,10 @@ main (gint argc, gchar *argv[])
store_available = store_is_available ();
if (miners_timeout_id == 0 &&
- !miner_needs_check (miner_files, store_available) &&
#ifdef HAVE_MAEMO
!miner_needs_check (miner_userguides, store_available) &&
#endif
- !miner_needs_check (miner_applications, store_available)) {
+ !miner_needs_check (miner_files, store_available)) {
tracker_db_manager_set_need_mtime_check (FALSE);
}
diff --git a/src/miners/fs/tracker-miner-userguides.c b/src/miners/fs/tracker-miner-userguides.c
index e8cc580..c674c45 100644
--- a/src/miners/fs/tracker-miner-userguides.c
+++ b/src/miners/fs/tracker-miner-userguides.c
@@ -23,19 +23,10 @@
#include <libxml/HTMLparser.h>
-#include <libtracker-common/tracker-utils.h>
-#include <libtracker-common/tracker-ontologies.h>
-#include <libtracker-common/tracker-locale.h>
+#include <libtracker-common/tracker-common.h>
#include "tracker-miner-userguides.h"
-/* FIXME: Should we rename this to just -locale not -applications-locale ? */
-#include "tracker-miner-locale.h"
-
-#ifdef HAVE_MEEGOTOUCH
-#include "tracker-miner-meego.h"
-#endif /* HAVE_MEEGOTOUCH */
-
// FIXME: get this value from tracker conf
#define MAX_EXTRACT_SIZE 1024 * 1024 // 1 MiB
#define MAX_TITLE_LENGTH 1000
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]