Commit 814de784 authored by Carlos Garnacho's avatar Carlos Garnacho

tracker-extract: Turn into a full-blown miner

TrackerExtractDecorator is put in use, replacing TrackerController as
the master of TrackerExtract. .service and .desktop files are added as
appropriate so tracker-extract is recognized as a miner, handled by
tracker-control, etc...
parent 465baf6b
......@@ -23,7 +23,7 @@ service_in_files = \
org.freedesktop.Tracker1.Miner.Files.service.in \
org.freedesktop.Tracker1.Miner.Userguides.service.in \
org.freedesktop.Tracker1.Miner.RSS.service.in \
org.freedesktop.Tracker1.Extract.service.in \
org.freedesktop.Tracker1.Miner.Extract.service.in \
org.freedesktop.Tracker1.Writeback.service.in
%.service: %.service.in
......@@ -33,11 +33,11 @@ service_in_files = \
servicedir = $(DBUS_SERVICES_DIR)
service_DATA = \
org.freedesktop.Tracker1.service \
org.freedesktop.Tracker1.Extract.service \
org.freedesktop.Tracker1.Writeback.service
if HAVE_TRACKER_MINER_FS
service_DATA += \
org.freedesktop.Tracker1.Miner.Extract.service \
org.freedesktop.Tracker1.Miner.Files.service \
org.freedesktop.Tracker1.Miner.Applications.service
......
[D-BUS Service]
Name=org.freedesktop.Tracker1.Extract
Name=org.freedesktop.Tracker1.Miner.Extract
Exec=@libexecdir@/tracker-extract
include $(top_srcdir)/Makefile.decl
desktop_in_in_files = \
tracker-miner-extract.desktop.in.in \
tracker-miner-userguides.desktop.in.in \
tracker-miner-applications.desktop.in.in \
tracker-miner-evolution.desktop.in.in \
......@@ -8,6 +9,7 @@ desktop_in_in_files = \
tracker-miner-rss.desktop.in.in
desktop_in_files = \
tracker-miner-extract.desktop.in \
tracker-miner-userguides.desktop.in \
tracker-miner-applications.desktop.in \
tracker-miner-evolution.desktop.in \
......@@ -20,6 +22,7 @@ tracker_miners_DATA =
if HAVE_TRACKER_MINER_FS
tracker_miners_DATA += \
tracker-miner-extract.desktop \
tracker-miner-applications.desktop \
tracker-miner-files.desktop
......
[Desktop Entry]
_Name=Extractor
_Comment=Metadata extractor
Icon=folder
DBusName=org.freedesktop.Tracker1.Miner.Extract
DBusPath=/org/freedesktop/Tracker1/Miner/Extract
......@@ -52,6 +52,7 @@
#include "tracker-main.h"
#include "tracker-extract.h"
#include "tracker-controller.h"
#include "tracker-extract-decorator.h"
#ifdef THREAD_ENABLE_TRACE
#warning Main thread traces enabled
......@@ -318,11 +319,10 @@ main (int argc, char *argv[])
{
GOptionContext *context;
GError *error = NULL;
TrackerExtract *object;
TrackerController *controller;
TrackerExtract *extract;
TrackerDecorator *decorator;
gchar *log_filename = NULL;
GMainLoop *my_main_loop;
guint shutdown_timeout;
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
......@@ -397,9 +397,6 @@ main (int argc, char *argv[])
g_free (log_filename);
}
g_message ("Shutdown after 30 seconds of inactivity is %s",
disable_shutdown ? "disabled" : "enabled");
sanity_check_option_values (config);
/* This makes sure we don't steal all the system's resources */
......@@ -407,29 +404,21 @@ main (int argc, char *argv[])
tracker_db_manager_get_first_index_done () == FALSE);
tracker_memory_setrlimits ();
if (disable_shutdown) {
shutdown_timeout = 0;
} else {
shutdown_timeout = QUIT_TIMEOUT;
}
object = tracker_extract_new (disable_shutdown,
force_internal_extractors,
force_module);
extract = tracker_extract_new (TRUE,
force_internal_extractors,
force_module);
if (!object) {
if (!extract) {
g_object_unref (config);
tracker_log_shutdown ();
return EXIT_FAILURE;
}
controller = tracker_controller_new (object, shutdown_timeout, &error);
decorator = tracker_extract_decorator_new (extract, NULL, &error);
if (!controller) {
g_critical ("Controller thread failed to initialize: %s\n", error->message);
g_error_free (error);
if (error) {
g_critical ("Could not start decorator: %s\n", error->message);
g_object_unref (config);
g_object_unref (object);
tracker_log_shutdown ();
return EXIT_FAILURE;
}
......@@ -442,6 +431,8 @@ main (int argc, char *argv[])
tracker_locale_init ();
tracker_media_art_init ();
tracker_miner_start (TRACKER_MINER (decorator));
/* Main loop */
main_loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (main_loop);
......@@ -450,14 +441,14 @@ main (int argc, char *argv[])
main_loop = NULL;
g_main_loop_unref (my_main_loop);
g_message ("Shutdown started");
tracker_miner_stop (TRACKER_MINER (decorator));
/* Shutdown subsystems */
tracker_media_art_shutdown ();
tracker_locale_shutdown ();
g_object_unref (object);
g_object_unref (controller);
g_object_unref (extract);
g_object_unref (decorator);
tracker_log_shutdown ();
......
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