[tracker] Moved tracker-config to tracker-global-config, 1st phase
- From: Martyn James Russell <mr src gnome org>
- To: svn-commits-list gnome org
- Subject: [tracker] Moved tracker-config to tracker-global-config, 1st phase
- Date: Thu, 16 Jul 2009 10:18:40 +0000 (UTC)
commit 74b0545469dc857832650b1520787d6702f0ed14
Author: Martyn Russell <martyn imendio com>
Date: Fri Jul 10 21:34:44 2009 +0100
Moved tracker-config to tracker-global-config, 1st phase
This change involves creating a tracker-config in the miner-fs based
on the original config module. It will be cut down for miner only
config.
The global config will have options which don't belong to any specific
binary OR apply to all binaries (like verbosity).
src/libtracker-common/Makefile.am | 8 +--
src/libtracker-common/tracker-common.h | 2 +-
.../{tracker-config.c => tracker-global-config.c} | 2 +-
.../{tracker-config.h => tracker-global-config.h} | 0
src/libtracker-common/tracker-language.h | 2 +-
src/libtracker-common/tracker-thumbnailer.c | 2 +-
src/libtracker-common/tracker-thumbnailer.h | 2 +-
src/libtracker-common/tracker-utils.c | 20 -------
src/libtracker-common/tracker-utils.h | 39 ++++++-------
src/libtracker-data/tracker-data-manager.h | 2 +-
src/libtracker-data/tracker-data-query.h | 2 +-
src/tracker-extract/tracker-main.c | 2 +-
src/tracker-miner-fs/Makefile.am | 8 ++-
.../tracker-config.c | 7 +-
.../tracker-config.h | 0
src/tracker-miner-fs/tracker-crawler.c | 3 +-
src/tracker-miner-fs/tracker-crawler.h | 2 +-
src/tracker-miner-fs/tracker-indexer.c | 5 +-
src/tracker-miner-fs/tracker-main.c | 4 +-
src/tracker-miner-fs/tracker-monitor.c | 2 +-
src/tracker-miner-fs/tracker-monitor.h | 2 +-
src/tracker-miner-fs/tracker-processor.c | 4 +-
src/tracker-miner-fs/tracker-processor.h | 2 +-
.../tracker-status.c | 0
.../tracker-status.h | 3 +-
src/tracker-miner-fs/tracker-utils.c | 43 ++++++++++++++
src/tracker-miner-fs/tracker-utils.h | 31 ++++++++++
src/tracker-store/tracker-backup.c | 8 ++-
src/tracker-store/tracker-dbus.c | 16 +----
src/tracker-store/tracker-dbus.h | 11 +--
src/tracker-store/tracker-main.c | 61 ++-----------------
src/tracker-store/tracker-resource-class.c | 1 -
src/tracker-store/tracker-statistics.c | 4 -
src/tracker-store/tracker-statistics.h | 2 -
tests/tracker-miner-fs/Makefile.am | 4 +-
35 files changed, 154 insertions(+), 152 deletions(-)
---
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index 984a604..42dfc65 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -58,9 +58,9 @@ libtracker_common_la_SOURCES = \
$(power_sources) \
$(storage_sources) \
tracker-class.c \
- tracker-config.c \
tracker-dbus.c \
tracker-file-utils.c \
+ tracker-global-config.c \
tracker-ioprio.c \
tracker-language.c \
tracker-log.c \
@@ -71,7 +71,6 @@ libtracker_common_la_SOURCES = \
tracker-parser.c \
tracker-property.c \
tracker-statement-list.c \
- tracker-status.c \
tracker-type-utils.c \
tracker-utils.c \
tracker-thumbnailer.c \
@@ -92,17 +91,16 @@ noinst_HEADERS = \
libtracker_commoninclude_HEADERS = \
tracker-class.h \
tracker-common.h \
- tracker-config.h \
tracker-file-utils.h \
+ tracker-global-config.h \
tracker-language.h \
tracker-module-config.h \
tracker-namespace.h \
tracker-ontology.h \
tracker-parser.h \
tracker-property.h \
- tracker-sparql-builder.h \
+ tracker-sparql-builder.h \
tracker-statement-list.h \
- tracker-status.h \
tracker-type-utils.h \
tracker-utils.h
diff --git a/src/libtracker-common/tracker-common.h b/src/libtracker-common/tracker-common.h
index 46d090e..99a1653 100644
--- a/src/libtracker-common/tracker-common.h
+++ b/src/libtracker-common/tracker-common.h
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
#define __LIBTRACKER_COMMON_INSIDE__
#include "tracker-class.h"
-#include "tracker-config.h"
+#include "tracker-global-config.h"
#include "tracker-file-utils.h"
#include "tracker-language.h"
#include "tracker-module-config.h"
diff --git a/src/libtracker-common/tracker-config.c b/src/libtracker-common/tracker-global-config.c
similarity index 99%
copy from src/libtracker-common/tracker-config.c
copy to src/libtracker-common/tracker-global-config.c
index 733e56c..bf4ede0 100644
--- a/src/libtracker-common/tracker-config.c
+++ b/src/libtracker-common/tracker-global-config.c
@@ -29,7 +29,7 @@
#include <gio/gio.h>
#include "tracker-language.h"
-#include "tracker-config.h"
+#include "tracker-global-config.h"
#include "tracker-file-utils.h"
#include "tracker-type-utils.h"
diff --git a/src/libtracker-common/tracker-config.h b/src/libtracker-common/tracker-global-config.h
similarity index 100%
copy from src/libtracker-common/tracker-config.h
copy to src/libtracker-common/tracker-global-config.h
diff --git a/src/libtracker-common/tracker-language.h b/src/libtracker-common/tracker-language.h
index 8a0fdb3..561951c 100644
--- a/src/libtracker-common/tracker-language.h
+++ b/src/libtracker-common/tracker-language.h
@@ -24,7 +24,7 @@
#include <glib-object.h>
-#include "tracker-config.h"
+#include "tracker-global-config.h"
G_BEGIN_DECLS
diff --git a/src/libtracker-common/tracker-thumbnailer.c b/src/libtracker-common/tracker-thumbnailer.c
index e9211bd..1cd9db0 100644
--- a/src/libtracker-common/tracker-thumbnailer.c
+++ b/src/libtracker-common/tracker-thumbnailer.c
@@ -25,7 +25,7 @@
#include <tracker-miner-fs/tracker-module-file.h>
-#include "tracker-config.h"
+#include "tracker-global-config.h"
#include "tracker-dbus.h"
#include "tracker-thumbnailer.h"
diff --git a/src/libtracker-common/tracker-thumbnailer.h b/src/libtracker-common/tracker-thumbnailer.h
index bb1d2c3..183c7dc 100644
--- a/src/libtracker-common/tracker-thumbnailer.h
+++ b/src/libtracker-common/tracker-thumbnailer.h
@@ -22,7 +22,7 @@
#ifndef __LIBTRACKER_COMMON_THUMBNAILER_H__
#define __LIBTRACKER_COMMON_THUMBNAILER_H__
-#include <libtracker-common/tracker-config.h>
+#include "tracker-global-config.h"
G_BEGIN_DECLS
diff --git a/src/libtracker-common/tracker-utils.c b/src/libtracker-common/tracker-utils.c
index 88275e5..863e6bb 100644
--- a/src/libtracker-common/tracker-utils.c
+++ b/src/libtracker-common/tracker-utils.c
@@ -203,26 +203,6 @@ tracker_seconds_to_string (gdouble seconds_elapsed,
return str;
}
-void
-tracker_throttle (TrackerConfig *config,
- gint multiplier)
-{
- gint throttle;
-
- g_return_if_fail (TRACKER_IS_CONFIG (config));
-
- /* Get the throttle, add 5 (minimum value) so we don't do
- * nothing and then multiply it by the factor given
- */
- throttle = tracker_config_get_throttle (config);
- /* throttle += 5; */
- throttle *= multiplier;
-
- if (throttle > 0) {
- g_usleep (throttle);
- }
-}
-
/* Temporary: Just here until we upgrade to GLib 2.18. */
static gboolean
tracker_dgettext_should_translate (void)
diff --git a/src/libtracker-common/tracker-utils.h b/src/libtracker-common/tracker-utils.h
index ac78513..369e35d 100644
--- a/src/libtracker-common/tracker-utils.h
+++ b/src/libtracker-common/tracker-utils.h
@@ -27,30 +27,27 @@
#endif
#include <glib.h>
-#include "tracker-config.h"
-gboolean tracker_is_empty_string (const char *str);
-gchar * tracker_string_replace (const gchar *haystack,
- const gchar *needle,
- const gchar *replacement);
-gchar * tracker_string_remove (gchar *haystack,
- const gchar *needle);
-gchar * tracker_seconds_estimate_to_string (gdouble seconds_elapsed,
- gboolean short_string,
- guint items_done,
- guint items_remaining);
-gchar * tracker_seconds_to_string (gdouble seconds_elapsed,
- gboolean short_string);
-void tracker_throttle (TrackerConfig *config,
- gint multiplier);
-
-
-gchar* tracker_uri_vprintf_escaped (const gchar *format,
- va_list args);
-gchar* tracker_uri_printf_escaped (const gchar *format, ...);
+gboolean tracker_is_empty_string (const char *str);
+gchar * tracker_string_replace (const gchar *haystack,
+ const gchar *needle,
+ const gchar *replacement);
+gchar * tracker_string_remove (gchar *haystack,
+ const gchar *needle);
+gchar * tracker_seconds_estimate_to_string (gdouble seconds_elapsed,
+ gboolean short_string,
+ guint items_done,
+ guint items_remaining);
+gchar * tracker_seconds_to_string (gdouble seconds_elapsed,
+ gboolean short_string);
+gchar* tracker_uri_vprintf_escaped (const gchar *format,
+ va_list args);
+gchar* tracker_uri_printf_escaped (const gchar *format,
+ ...);
/* Temporary: Just here until we upgrade to GLib 2.18. */
-G_CONST_RETURN gchar *tracker_dngettext (const gchar *domain,
+G_CONST_RETURN gchar *
+ tracker_dngettext (const gchar *domain,
const gchar *msgid,
const gchar *msgid_plural,
gulong n);
diff --git a/src/libtracker-data/tracker-data-manager.h b/src/libtracker-data/tracker-data-manager.h
index 3071e97..05a6588 100644
--- a/src/libtracker-data/tracker-data-manager.h
+++ b/src/libtracker-data/tracker-data-manager.h
@@ -26,7 +26,7 @@
#include <glib.h>
-#include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-global-config.h>
#include <libtracker-common/tracker-language.h>
#include <libtracker-common/tracker-ontology.h>
diff --git a/src/libtracker-data/tracker-data-query.h b/src/libtracker-data/tracker-data-query.h
index de9dd5e..7508055 100644
--- a/src/libtracker-data/tracker-data-query.h
+++ b/src/libtracker-data/tracker-data-query.h
@@ -26,7 +26,7 @@
#include <glib.h>
-#include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-global-config.h>
#include <libtracker-common/tracker-language.h>
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-property.h>
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index 1039da0..214ed8a 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -44,7 +44,7 @@
#endif
#include <libtracker-common/tracker-log.h>
-#include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-global-config.h>
#include <libtracker-common/tracker-dbus.h>
#include <libtracker-common/tracker-os-dependant.h>
#include <libtracker-common/tracker-thumbnailer.h>
diff --git a/src/tracker-miner-fs/Makefile.am b/src/tracker-miner-fs/Makefile.am
index bee975d..c1946c9 100644
--- a/src/tracker-miner-fs/Makefile.am
+++ b/src/tracker-miner-fs/Makefile.am
@@ -43,6 +43,8 @@ libexec_PROGRAMS = tracker-miner-fs
tracker_miner_fs_SOURCES = \
tracker-dbus.h \
+ tracker-config.c \
+ tracker-config.h \
tracker-crawler.c \
tracker-crawler.h \
tracker-indexer.c \
@@ -57,8 +59,12 @@ tracker_miner_fs_SOURCES = \
tracker-monitor.h \
tracker-processor.c \
tracker-processor.h \
+ tracker-status.c \
+ tracker-status.h \
tracker-removable-device.c \
- tracker-removable-device.h
+ tracker-removable-device.h \
+ tracker-utils.c \
+ tracker-utils.h
tracker_miner_fs_LDADD = \
$(plugin_libs) \
diff --git a/src/libtracker-common/tracker-config.c b/src/tracker-miner-fs/tracker-config.c
similarity index 99%
rename from src/libtracker-common/tracker-config.c
rename to src/tracker-miner-fs/tracker-config.c
index 733e56c..b2d7e45 100644
--- a/src/libtracker-common/tracker-config.c
+++ b/src/tracker-miner-fs/tracker-config.c
@@ -28,10 +28,11 @@
#include <glib.h>
#include <gio/gio.h>
-#include "tracker-language.h"
+#include <libtracker-common/tracker-language.h>
+#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-type-utils.h>
+
#include "tracker-config.h"
-#include "tracker-file-utils.h"
-#include "tracker-type-utils.h"
#define TRACKER_CONFIG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_CONFIG, TrackerConfigPrivate))
diff --git a/src/libtracker-common/tracker-config.h b/src/tracker-miner-fs/tracker-config.h
similarity index 100%
rename from src/libtracker-common/tracker-config.h
rename to src/tracker-miner-fs/tracker-config.h
diff --git a/src/tracker-miner-fs/tracker-crawler.c b/src/tracker-miner-fs/tracker-crawler.c
index 82ae06e..e7be37f 100644
--- a/src/tracker-miner-fs/tracker-crawler.c
+++ b/src/tracker-miner-fs/tracker-crawler.c
@@ -26,7 +26,6 @@
#include <libtracker-common/tracker-dbus.h>
#include <libtracker-common/tracker-file-utils.h>
-#include <libtracker-common/tracker-status.h>
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-utils.h>
#include <libtracker-common/tracker-module-config.h>
@@ -35,6 +34,8 @@
#include "tracker-dbus.h"
#include "tracker-monitor.h"
#include "tracker-marshal.h"
+#include "tracker-status.h"
+#include "tracker-utils.h"
#define TRACKER_CRAWLER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_CRAWLER, TrackerCrawlerPrivate))
diff --git a/src/tracker-miner-fs/tracker-crawler.h b/src/tracker-miner-fs/tracker-crawler.h
index d11559e..8d6a8d8 100644
--- a/src/tracker-miner-fs/tracker-crawler.h
+++ b/src/tracker-miner-fs/tracker-crawler.h
@@ -23,7 +23,7 @@
#include <glib-object.h>
-#include <libtracker-common/tracker-config.h>
+#include "tracker-config.h"
G_BEGIN_DECLS
diff --git a/src/tracker-miner-fs/tracker-indexer.c b/src/tracker-miner-fs/tracker-indexer.c
index 06b2b45..e6fcd7f 100644
--- a/src/tracker-miner-fs/tracker-indexer.c
+++ b/src/tracker-miner-fs/tracker-indexer.c
@@ -53,7 +53,6 @@
#include <gio/gio.h>
#include <gmodule.h>
-#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-dbus.h>
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-power.h>
@@ -61,7 +60,6 @@
#include <libtracker-common/tracker-parser.h>
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-module-config.h>
-#include <libtracker-common/tracker-status.h>
#include <libtracker-common/tracker-utils.h>
#include <libtracker-common/tracker-thumbnailer.h>
@@ -75,11 +73,14 @@
#include <libtracker/tracker.h>
+#include "tracker-config.h"
#include "tracker-indexer.h"
#include "tracker-indexer-module.h"
#include "tracker-marshal.h"
#include "tracker-processor.h"
#include "tracker-removable-device.h"
+#include "tracker-status.h"
+#include "tracker-utils.h"
#define TRACKER_INDEXER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_INDEXER, TrackerIndexerPrivate))
diff --git a/src/tracker-miner-fs/tracker-main.c b/src/tracker-miner-fs/tracker-main.c
index 3ea1505..33afc98 100644
--- a/src/tracker-miner-fs/tracker-main.c
+++ b/src/tracker-miner-fs/tracker-main.c
@@ -35,7 +35,6 @@
#include <glib-object.h>
#include <glib/gi18n.h>
-#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-ioprio.h>
#include <libtracker-common/tracker-log.h>
#include <libtracker-common/tracker-ontology.h>
@@ -52,6 +51,7 @@
#include "tracker-indexer.h"
#include "tracker-miner.h"
#include "tracker-miner-glue.h"
+#include "tracker-config.h"
#define ABOUT \
"Tracker " PACKAGE_VERSION "\n"
@@ -157,6 +157,8 @@ initialize_signal_handler (void)
#endif /* G_OS_WIN32 */
}
+
+
static void
initialize_priority (void)
{
diff --git a/src/tracker-miner-fs/tracker-monitor.c b/src/tracker-miner-fs/tracker-monitor.c
index 410b56c..c56dd64 100644
--- a/src/tracker-miner-fs/tracker-monitor.c
+++ b/src/tracker-miner-fs/tracker-monitor.c
@@ -25,7 +25,6 @@
#include <libtracker-common/tracker-dbus.h>
#include <libtracker-common/tracker-file-utils.h>
-#include <libtracker-common/tracker-status.h>
#include <libtracker-common/tracker-module-config.h>
#include <sys/inotify.h>
@@ -34,6 +33,7 @@
#include "tracker-monitor.h"
#include "tracker-dbus.h"
#include "tracker-marshal.h"
+#include "tracker-status.h"
#define TRACKER_MONITOR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_MONITOR, TrackerMonitorPrivate))
diff --git a/src/tracker-miner-fs/tracker-monitor.h b/src/tracker-miner-fs/tracker-monitor.h
index 27728fa..c456988 100644
--- a/src/tracker-miner-fs/tracker-monitor.h
+++ b/src/tracker-miner-fs/tracker-monitor.h
@@ -25,7 +25,7 @@
#include <glib-object.h>
#include <gio/gio.h>
-#include <libtracker-common/tracker-config.h>
+#include "tracker-config.h"
G_BEGIN_DECLS
diff --git a/src/tracker-miner-fs/tracker-processor.c b/src/tracker-miner-fs/tracker-processor.c
index 460d8cb..73ac796 100644
--- a/src/tracker-miner-fs/tracker-processor.c
+++ b/src/tracker-miner-fs/tracker-processor.c
@@ -27,15 +27,15 @@
#include <libtracker-common/tracker-storage.h>
#include <libtracker-common/tracker-module-config.h>
#include <libtracker-common/tracker-utils.h>
-#include <libtracker-common/tracker-status.h>
#include <libtracker-db/tracker-db-manager.h>
-#include "tracker-processor.h"
#include "tracker-crawler.h"
#include "tracker-dbus.h"
#include "tracker-indexer.h"
#include "tracker-monitor.h"
+#include "tracker-processor.h"
+#include "tracker-status.h"
#define TRACKER_PROCESSOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_PROCESSOR, TrackerProcessorPrivate))
diff --git a/src/tracker-miner-fs/tracker-processor.h b/src/tracker-miner-fs/tracker-processor.h
index a5755a5..506b8cd 100644
--- a/src/tracker-miner-fs/tracker-processor.h
+++ b/src/tracker-miner-fs/tracker-processor.h
@@ -24,10 +24,10 @@
#include <glib-object.h>
#include <gio/gio.h>
-#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-storage.h>
#include "tracker-indexer.h"
+#include "tracker-config.h"
G_BEGIN_DECLS
diff --git a/src/libtracker-common/tracker-status.c b/src/tracker-miner-fs/tracker-status.c
similarity index 100%
rename from src/libtracker-common/tracker-status.c
rename to src/tracker-miner-fs/tracker-status.c
diff --git a/src/libtracker-common/tracker-status.h b/src/tracker-miner-fs/tracker-status.h
similarity index 98%
rename from src/libtracker-common/tracker-status.h
rename to src/tracker-miner-fs/tracker-status.h
index d4d8202..d73e13b 100644
--- a/src/libtracker-common/tracker-status.h
+++ b/src/tracker-miner-fs/tracker-status.h
@@ -24,9 +24,10 @@
#include <glib-object.h>
-#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-power.h>
+#include "tracker-config.h"
+
G_BEGIN_DECLS
#define TRACKER_TYPE_STATUS (tracker_status_get_type ())
diff --git a/src/tracker-miner-fs/tracker-utils.c b/src/tracker-miner-fs/tracker-utils.c
new file mode 100644
index 0000000..69b3fd5
--- /dev/null
+++ b/src/tracker-miner-fs/tracker-utils.c
@@ -0,0 +1,43 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2009, Nokia (urho konttori nokia 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 "tracker-utils.h"
+
+void
+tracker_throttle (TrackerConfig *config,
+ gint multiplier)
+{
+ gint throttle;
+
+ g_return_if_fail (TRACKER_IS_CONFIG (config));
+
+ /* Get the throttle, add 5 (minimum value) so we don't do
+ * nothing and then multiply it by the factor given
+ */
+ throttle = tracker_config_get_throttle (config);
+ /* throttle += 5; */
+ throttle *= multiplier;
+
+ if (throttle > 0) {
+ g_usleep (throttle);
+ }
+}
diff --git a/src/tracker-miner-fs/tracker-utils.h b/src/tracker-miner-fs/tracker-utils.h
new file mode 100644
index 0000000..f5b643b
--- /dev/null
+++ b/src/tracker-miner-fs/tracker-utils.h
@@ -0,0 +1,31 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2009, Nokia
+ *
+ * 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.
+ */
+
+#ifndef __TRACKERD_UTILS_H__
+#define __TRACKERD_UTILS_H__
+
+#include <glib.h>
+
+#include "tracker-config.h"
+
+void tracker_throttle (TrackerConfig *config,
+ gint multiplier);
+
+#endif /* __TRACKERD_UTILS_H__ */
diff --git a/src/tracker-store/tracker-backup.c b/src/tracker-store/tracker-backup.c
index 6dd2529..e92d60d 100644
--- a/src/tracker-store/tracker-backup.c
+++ b/src/tracker-store/tracker-backup.c
@@ -24,7 +24,7 @@
#include <glib/gstdio.h>
#include <libtracker-common/tracker-dbus.h>
-#include <libtracker-common/tracker-status.h>
+
#include <libtracker-data/tracker-data-backup.h>
#include <libtracker-data/tracker-data-update.h>
@@ -134,6 +134,7 @@ tracker_backup_restore (TrackerBackup *object,
DBusGMethodInvocation *context,
GError **error)
{
+#if 0
guint request_id;
GError *actual_error = NULL;
TrackerDBusMethodInfo *info;
@@ -146,7 +147,8 @@ tracker_backup_restore (TrackerBackup *object,
uri);
/* First check we have disk space */
-
+#if 0
+ /* FIXME: MJR */
if (tracker_status_get_is_paused_for_space ()) {
tracker_dbus_request_failed (request_id,
&actual_error,
@@ -156,6 +158,7 @@ tracker_backup_restore (TrackerBackup *object,
g_error_free (actual_error);
return;
}
+#endif
tracker_dbus_request_new (request_id,
"DBus request to restore backup '%s'",
@@ -180,4 +183,5 @@ tracker_backup_restore (TrackerBackup *object,
info, destroy_method_info);
g_object_unref (file);
+#endif
}
diff --git a/src/tracker-store/tracker-dbus.c b/src/tracker-store/tracker-dbus.c
index 534e8d0..ee019c7 100644
--- a/src/tracker-store/tracker-dbus.c
+++ b/src/tracker-store/tracker-dbus.c
@@ -21,12 +21,10 @@
#include "config.h"
-#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-dbus.h>
#include <libtracker-common/tracker-log.h>
#include <libtracker-common/tracker-utils.h>
#include <libtracker-common/tracker-ontology.h>
-#include <libtracker-common/tracker-status.h>
#include <libtracker-db/tracker-db-dbus.h>
#include <libtracker-db/tracker-db-manager.h>
@@ -99,7 +97,7 @@ dbus_register_object (DBusGConnection *lconnection,
}
static gboolean
-dbus_register_names (TrackerConfig *config)
+dbus_register_names (void)
{
GError *error = NULL;
@@ -139,17 +137,15 @@ dbus_register_names (TrackerConfig *config)
}
gboolean
-tracker_dbus_init (TrackerConfig *config)
+tracker_dbus_init (void)
{
- g_return_val_if_fail (TRACKER_IS_CONFIG (config), FALSE);
-
/* Don't reinitialize */
if (objects) {
return TRUE;
}
/* Register names and get proxy/connection details */
- if (!dbus_register_names (config)) {
+ if (!dbus_register_names ()) {
return FALSE;
}
@@ -174,17 +170,13 @@ tracker_dbus_shutdown (void)
}
gboolean
-tracker_dbus_register_objects (TrackerConfig *config,
- TrackerLanguage *language)
+tracker_dbus_register_objects (void)
{
TrackerDBResultSet *result_set;
GSList *event_sources = NULL;
GStrv classes, p;
gpointer object, resources;
- g_return_val_if_fail (TRACKER_IS_CONFIG (config), FALSE);
- g_return_val_if_fail (TRACKER_IS_LANGUAGE (language), FALSE);
-
if (!connection || !gproxy) {
g_critical ("DBus support must be initialized before registering objects!");
return FALSE;
diff --git a/src/tracker-store/tracker-dbus.h b/src/tracker-store/tracker-dbus.h
index 0bdff7f..fa6b123 100644
--- a/src/tracker-store/tracker-dbus.h
+++ b/src/tracker-store/tracker-dbus.h
@@ -26,18 +26,15 @@
#include <dbus/dbus-glib-bindings.h>
-#include <libtracker-common/tracker-config.h>
-#include <libtracker-common/tracker-language.h>
-
G_BEGIN_DECLS
#define TRACKER_INDEXER_PAUSE_TIME_FOR_REQUESTS 5 /* seconds */
-gboolean tracker_dbus_init (TrackerConfig *config);
+gboolean tracker_dbus_init (void);
void tracker_dbus_shutdown (void);
-gboolean tracker_dbus_register_objects (TrackerConfig *config,
- TrackerLanguage *language);
-GObject *tracker_dbus_get_object (GType type);
+gboolean tracker_dbus_register_objects (void);
+
+GObject *tracker_dbus_get_object (GType type);
void tracker_dbus_indexer_check_is_paused (void);
DBusGProxy *tracker_dbus_indexer_get_proxy (void);
diff --git a/src/tracker-store/tracker-main.c b/src/tracker-store/tracker-main.c
index 6d7c86b..1d6389a 100644
--- a/src/tracker-store/tracker-main.c
+++ b/src/tracker-store/tracker-main.c
@@ -42,7 +42,7 @@
#include <glib/gi18n.h>
#include <glib/gstdio.h>
-#include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-global-config.h>
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-power.h>
#include <libtracker-common/tracker-storage.h>
@@ -51,7 +51,6 @@
#include <libtracker-common/tracker-log.h>
#include <libtracker-common/tracker-module-config.h>
#include <libtracker-common/tracker-ontology.h>
-#include <libtracker-common/tracker-status.h>
#include <libtracker-common/tracker-thumbnailer.h>
#include <libtracker-db/tracker-db-manager.h>
@@ -107,6 +106,7 @@ typedef struct {
gchar *sys_tmp_dir;
gchar *ttl_backup_file;
+ gboolean first_time_index;
gboolean reindex_on_shutdown;
gboolean shutdown;
} TrackerMainPrivate;
@@ -467,31 +467,6 @@ initialize_directories (void)
g_free (filename);
}
-static gboolean
-initialize_databases (void)
-{
- /* This means we doing the initial check that our dbs are up
- * to date. Once we get finished from the indexer, we set
- * this to FALSE.
- */
- tracker_status_set_is_initial_check (TRUE);
-
- /* We set our first time indexing state here */
- if (!tracker_status_get_is_readonly () && force_reindex) {
- tracker_status_set_is_first_time_index (TRUE);
- }
-
- /* Check db integrity if not previously shut down cleanly */
- if (!tracker_status_get_is_readonly () &&
- !tracker_status_get_is_first_time_index () &&
- tracker_data_manager_get_db_option_int ("IntegrityCheck") == 1) {
- g_message ("Performing integrity check as the daemon was not shutdown cleanly");
- /* FIXME: Finish */
- }
-
- return TRUE;
-}
-
static void
shutdown_databases (void)
{
@@ -506,8 +481,6 @@ shutdown_databases (void)
tracker_data_backup_save (private->ttl_backup_file, NULL);
}
#endif
- /* Reset integrity status as threads have closed cleanly */
- tracker_data_manager_set_db_option_int ("IntegrityCheck", 0);
}
static void
@@ -542,9 +515,10 @@ get_ttl_backup_filename (void)
}
static void
-backup_user_metadata (TrackerConfig *config, TrackerLanguage *language)
+backup_user_metadata (TrackerConfig *config,
+ TrackerLanguage *language)
{
- gboolean is_first_time_index;
+ gboolean is_first_time_index;
g_message ("Saving metadata in %s", get_ttl_backup_filename ());
@@ -757,7 +731,7 @@ main (gint argc, gchar *argv[])
initialize_directories ();
- if (!tracker_dbus_init (config)) {
+ if (!tracker_dbus_init ()) {
return EXIT_FAILURE;
}
@@ -780,8 +754,6 @@ main (gint argc, gchar *argv[])
#endif /* HAVE_HAL */
tracker_store_init ();
- tracker_status_init (config, hal_power);
-
tracker_turtle_init ();
tracker_thumbnailer_init (config);
@@ -802,17 +774,6 @@ main (gint argc, gchar *argv[])
return EXIT_FAILURE;
}
- tracker_status_set_is_first_time_index (is_first_time_index);
-
- /*
- * Check mode
- */
- tracker_status_set_is_readonly (readonly_mode);
-
- if (!initialize_databases ()) {
- return EXIT_FAILURE;
- }
-
tracker_volume_cleanup_init ();
#ifdef HAVE_HAL
@@ -829,8 +790,7 @@ main (gint argc, gchar *argv[])
}
/* Make Tracker available for introspection */
- if (!tracker_dbus_register_objects (config,
- language)) {
+ if (!tracker_dbus_register_objects ()) {
return EXIT_FAILURE;
}
@@ -842,8 +802,6 @@ main (gint argc, gchar *argv[])
/* Set our status as running, if this is FALSE, threads stop
* doing what they do and shutdown.
*/
- tracker_status_set_is_ready (TRUE);
-
if (!private->shutdown) {
private->main_loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (private->main_loop);
@@ -870,7 +828,6 @@ shutdown:
tracker_volume_cleanup_shutdown ();
tracker_dbus_shutdown ();
tracker_data_manager_shutdown ();
- tracker_status_shutdown ();
tracker_turtle_shutdown ();
tracker_store_shutdown ();
tracker_thumbnailer_shutdown ();
@@ -906,10 +863,6 @@ tracker_shutdown (void)
private = g_static_private_get (&private_key);
if (private) {
- if (tracker_status_is_initialized ()) {
- tracker_status_set_is_ready (FALSE);
- }
-
if (private->main_loop) {
g_main_loop_quit (private->main_loop);
}
diff --git a/src/tracker-store/tracker-resource-class.c b/src/tracker-store/tracker-resource-class.c
index 8980acb..c1b29cc 100644
--- a/src/tracker-store/tracker-resource-class.c
+++ b/src/tracker-store/tracker-resource-class.c
@@ -26,7 +26,6 @@
#include <string.h>
#include <libtracker-common/tracker-dbus.h>
-#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-db/tracker-db-dbus.h>
diff --git a/src/tracker-store/tracker-statistics.c b/src/tracker-store/tracker-statistics.c
index 6e98473..ee4332e 100644
--- a/src/tracker-store/tracker-statistics.c
+++ b/src/tracker-store/tracker-statistics.c
@@ -26,9 +26,7 @@
#include <string.h>
#include <libtracker-common/tracker-log.h>
-#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-dbus.h>
-#include <libtracker-common/tracker-status.h>
#include <libtracker-db/tracker-db-dbus.h>
#include <libtracker-db/tracker-db-manager.h>
@@ -49,8 +47,6 @@
#define CACHE_LIFETIME 300
typedef struct {
- TrackerConfig *config;
-
GHashTable *cache;
guint cache_timeout_id;
} TrackerStatisticsPrivate;
diff --git a/src/tracker-store/tracker-statistics.h b/src/tracker-store/tracker-statistics.h
index e435426..f33ad9a 100644
--- a/src/tracker-store/tracker-statistics.h
+++ b/src/tracker-store/tracker-statistics.h
@@ -24,8 +24,6 @@
#include <glib-object.h>
-#include <libtracker-common/tracker-config.h>
-
#define TRACKER_STATISTICS_SERVICE "org.freedesktop.Tracker"
#define TRACKER_STATISTICS_PATH "/org/freedesktop/Tracker/Statistics"
#define TRACKER_STATISTICS_INTERFACE "org.freedesktop.Tracker.Statistics"
diff --git a/tests/tracker-miner-fs/Makefile.am b/tests/tracker-miner-fs/Makefile.am
index 261fb3a..a5193b1 100644
--- a/tests/tracker-miner-fs/Makefile.am
+++ b/tests/tracker-miner-fs/Makefile.am
@@ -34,11 +34,13 @@ tracker_metadata_utils_SOURCES = \
$(top_srcdir)/src/tracker-miner-fs/tracker-indexer-module.c \
$(top_srcdir)/src/tracker-miner-fs/tracker-marshal-main.c \
$(top_srcdir)/src/tracker-miner-fs/tracker-module-metadata-utils.c \
- $(top_srcdir)/src/tracker-miner-fs/tracker-module-file.c \
+ $(top_srcdir)/src/tracker-miner-fs/tracker-module-file.c \
$(top_srcdir)/src/tracker-miner-fs/tracker-module-iteratable.c \
$(top_srcdir)/src/tracker-miner-fs/tracker-monitor.c \
$(top_srcdir)/src/tracker-miner-fs/tracker-processor.c \
$(top_srcdir)/src/tracker-miner-fs/tracker-removable-device.c \
+ $(top_srcdir)/src/tracker-miner-fs/tracker-status.c \
+ $(top_srcdir)/src/tracker-miner-fs/tracker-utils.c \
tracker-metadata-utils-test.c
tracker_metadata_utils_LDADD = \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]