Commit 025c9776 authored by Sam Thursfield's avatar Sam Thursfield

Merge branch 'sam/domain-rules-outside-usr' into 'master'

Allow use of domain rules that aren't installed into /usr

See merge request GNOME/tracker-miners!17
parents b176eb40 5a58a451
......@@ -302,7 +302,17 @@ tracker_domain_ontology_initable_init (GInitable *initable,
domain_ontology = TRACKER_DOMAIN_ONTOLOGY (initable);
priv = tracker_domain_ontology_get_instance_private (domain_ontology);
if (priv->name) {
if (priv->name && priv->name[0] == '/') {
if (!g_file_test (priv->name, G_FILE_TEST_IS_REGULAR)) {
inner_error = g_error_new (G_KEY_FILE_ERROR,
G_KEY_FILE_ERROR_NOT_FOUND,
"Could not find rule at '%s'",
priv->name);
goto end;
}
path = g_strdup (priv->name);
} else if (priv->name) {
path = find_rule_in_data_dirs (priv->name);
if (!path) {
......@@ -454,9 +464,9 @@ tracker_domain_ontology_get_domain (TrackerDomainOntology *domain_ontology,
priv = tracker_domain_ontology_get_instance_private (domain_ontology);
if (suffix)
return g_strconcat (priv->domain, ".Tracker1.", suffix, NULL);
return g_strconcat (priv->domain, ".", suffix, NULL);
else
return g_strconcat (priv->domain, ".Tracker1", NULL);
return g_strconcat (priv->domain, NULL);
}
gboolean
......
......@@ -44,7 +44,7 @@
"\n" \
" http://www.gnu.org/licenses/gpl.txt\n"
#define DBUS_NAME_SUFFIX "Miner.Applications"
#define DBUS_NAME_SUFFIX "Tracker1.Miner.Applications"
#define DBUS_PATH "/org/freedesktop/Tracker1/Miner/Applications"
static GMainLoop *main_loop;
......@@ -186,7 +186,7 @@ main (gint argc, gchar *argv[])
GDBusConnection *connection;
TrackerMinerProxy *proxy;
TrackerDomainOntology *domain_ontology;
gchar *dbus_name;
gchar *domain_name, *dbus_name;
main_loop = NULL;
......@@ -248,11 +248,13 @@ main (gint argc, gchar *argv[])
main_loop = g_main_loop_new (NULL, FALSE);
if (domain_ontology && domain_ontology_name) {
g_bus_watch_name_on_connection (connection, domain_ontology_name,
if (domain_ontology) {
domain_name = tracker_domain_ontology_get_domain (domain_ontology, NULL);
g_bus_watch_name_on_connection (connection, domain_name,
G_BUS_NAME_WATCHER_FLAGS_NONE,
NULL, on_domain_vanished,
main_loop, NULL);
g_free (domain_name);
}
g_message ("Checking if we're running as a daemon:");
......
......@@ -52,7 +52,7 @@
#define SECONDS_PER_DAY 60 * 60 * 24
#define DBUS_NAME_SUFFIX "Miner.Files"
#define DBUS_NAME_SUFFIX "Tracker1.Miner.Files"
#define DBUS_PATH "/org/freedesktop/Tracker1/Miner/Files"
static GMainLoop *main_loop;
......@@ -667,7 +667,7 @@ main (gint argc, gchar *argv[])
TrackerMinerProxy *proxy;
GDBusConnection *connection;
TrackerDomainOntology *domain_ontology;
gchar *dbus_name;
gchar *domain_name, *dbus_name;
main_loop = NULL;
......@@ -749,11 +749,13 @@ main (gint argc, gchar *argv[])
main_loop = g_main_loop_new (NULL, FALSE);
if (domain_ontology && domain_ontology_name) {
g_bus_watch_name_on_connection (connection, domain_ontology_name,
if (domain_ontology) {
domain_name = tracker_domain_ontology_get_domain (domain_ontology, NULL);
g_bus_watch_name_on_connection (connection, domain_name,
G_BUS_NAME_WATCHER_FLAGS_NONE,
NULL, on_domain_vanished,
main_loop, NULL);
g_free (domain_name);
}
g_message ("Checking if we're running as a daemon:");
......
......@@ -29,7 +29,7 @@
#include "tracker-miner-rss.h"
#define DBUS_NAME_SUFFIX "Miner.RSS"
#define DBUS_NAME_SUFFIX "Tracker1.Miner.RSS"
#define DBUS_PATH "/org/freedesktop/Tracker1/Miner/RSS"
static gint verbosity = -1;
......@@ -79,7 +79,7 @@ main (int argc, char **argv)
GDBusConnection *connection;
TrackerMinerProxy *proxy;
TrackerDomainOntology *domain_ontology;
gchar *dbus_name;
gchar *domain_name, *dbus_name;
setlocale (LC_ALL, "");
......@@ -217,11 +217,13 @@ main (int argc, char **argv)
loop = g_main_loop_new (NULL, FALSE);
if (domain_ontology && domain_ontology_name) {
if (domain_ontology) {
domain_name = tracker_domain_ontology_get_domain (domain_ontology, NULL);
g_bus_watch_name_on_connection (connection, domain_ontology_name,
G_BUS_NAME_WATCHER_FLAGS_NONE,
NULL, on_domain_vanished,
loop, NULL);
g_free (domain_name);
}
g_main_loop_run (loop);
......
......@@ -60,7 +60,7 @@
"\n" \
" http://www.gnu.org/licenses/gpl.txt\n"
#define DBUS_NAME_SUFFIX "Miner.Extract"
#define DBUS_NAME_SUFFIX "Tracker1.Miner.Extract"
#define DBUS_PATH "/org/freedesktop/Tracker1/Miner/Extract"
static GMainLoop *main_loop;
......@@ -351,7 +351,7 @@ main (int argc, char *argv[])
GDBusConnection *connection;
TrackerMinerProxy *proxy;
TrackerDomainOntology *domain_ontology;
gchar *dbus_name;
gchar *domain_name, *dbus_name;
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
......@@ -494,11 +494,13 @@ main (int argc, char *argv[])
/* Main loop */
main_loop = g_main_loop_new (NULL, FALSE);
if (domain_ontology && domain_ontology_name) {
g_bus_watch_name_on_connection (connection, domain_ontology_name,
if (domain_ontology) {
domain_name = tracker_domain_ontology_get_domain (domain_ontology, NULL);
g_bus_watch_name_on_connection (connection, domain_name,
G_BUS_NAME_WATCHER_FLAGS_NONE,
NULL, on_domain_vanished,
main_loop, NULL);
g_free (domain_name);
}
g_signal_connect (decorator, "finished",
......
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