Commit 675b7270 authored by Sam Thursfield's avatar Sam Thursfield

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

See !14
parents 034e7a2e bb726349
Pipeline #25289 passed with stage
in 10 minutes and 5 seconds
......@@ -75,6 +75,10 @@ Miners=Miner.Files;Miner.Extract;
<programlisting>
tracker_sparql_connection_set_domain ("org.example.App");
</programlisting>
<para>
It is also possible to pass a full path to the domain rule. If the first
character of the domain name is / it will be treated as a full path.
</para>
</chapter>
<chapter id="recommendations">
<title>Additional precautions and recommendations</title>
......
......@@ -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) {
......@@ -459,9 +469,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
......
......@@ -696,7 +696,7 @@ tracker_miner_manager_get_running (TrackerMinerManager *manager)
return NULL;
}
prefix = tracker_domain_ontology_get_domain (priv->domain_ontology, "Miner");
prefix = tracker_domain_ontology_get_domain (priv->domain_ontology, "Tracker1.Miner");
g_variant_get (v, "(as)", &iter);
while (g_variant_iter_loop (iter, "&s", &str)) {
......@@ -723,7 +723,7 @@ check_file (GFile *file,
TrackerMinerManager *manager;
TrackerMinerManagerPrivate *priv;
GKeyFile *key_file;
gchar *path, *dbus_path, *display_name, *name_suffix, *description;
gchar *path, *dbus_path, *display_name, *name_suffix, *full_name_suffix, *description;
GError *error = NULL;
MinerData *data;
......@@ -768,8 +768,12 @@ check_file (GFile *file,
data = g_slice_new0 (MinerData);
data->dbus_path = dbus_path;
data->name_suffix = name_suffix;
full_name_suffix = g_strconcat ("Tracker1.", name_suffix, NULL);
data->dbus_name = tracker_domain_ontology_get_domain (priv->domain_ontology,
name_suffix);
full_name_suffix);
g_free (full_name_suffix);
data->display_name = display_name;
data->description = description; /* In .desktop file as _comment */
......
......@@ -193,7 +193,7 @@ class Tracker.Sparql.Backend : Connection {
switch (backend) {
case Backend.AUTO:
bus = new Tracker.Bus.Connection (domain_ontology.get_domain (), global_dbus_connection);
bus = new Tracker.Bus.Connection (domain_ontology.get_domain ("Tracker1"), global_dbus_connection);
try {
direct = create_readonly_direct ();
......@@ -208,7 +208,7 @@ class Tracker.Sparql.Backend : Connection {
break;
case Backend.BUS:
bus = new Tracker.Bus.Connection (domain_ontology.get_domain (), global_dbus_connection);
bus = new Tracker.Bus.Connection (domain_ontology.get_domain ("Tracker1"), global_dbus_connection);
break;
default:
......
......@@ -715,7 +715,7 @@ tracker_notifier_initable_init (GInitable *initable,
if (!domain_ontology)
return FALSE;
dbus_name = tracker_domain_ontology_get_domain (domain_ontology, NULL);
dbus_name = tracker_domain_ontology_get_domain (domain_ontology, "Tracker1");
priv->has_arg0_filter =
priv->expanded_classes && g_strv_length (priv->expanded_classes) == 1;
......
......@@ -240,7 +240,7 @@ License which can be viewed at:
cache_location = domain_ontology_config.get_cache ();
data_location = domain_ontology_config.get_journal ();
ontology_location = domain_ontology_config.get_ontology ();
domain = domain_ontology_config.get_domain ();
domain = domain_ontology_config.get_domain ("Tracker1");
sanity_check_option_values (config);
......@@ -319,8 +319,8 @@ License which can be viewed at:
if (!shutdown) {
main_loop = new MainLoop ();
if (domain != null)
Tracker.DBus.watch_domain (domain_ontology, main_loop);
if (domain_ontology != null)
Tracker.DBus.watch_domain (domain_ontology_config.get_domain(), main_loop);
initialize_signal_handler ();
......
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