[gnome-photos/wip/mnth/custom-tracker-domain] DO NOT merge this commit until it has been done



commit e5ce594710ec9915614625b26d365621c67fc3e8
Author: Yi-Soo An <yisooan gmail com>
Date:   Thu Oct 4 18:56:41 2018 +0900

    DO NOT merge this commit until it has been done
    
    This commit will be rebased later.

 data/meson.build                          | 28 ++++++++++++++++++++++
 data/org.gnome.Photos.Tracker1.service.in |  4 ++++
 data/org.gnome.Photos.domain.rule.in      | 39 +++++++++++++++++++++++++++++++
 flatpak/org.gnome.Photos.json             |  5 +++-
 src/photos-tracker-queue.c                |  2 ++
 5 files changed, 77 insertions(+), 1 deletion(-)
---
diff --git a/data/meson.build b/data/meson.build
index 7898b0cc..251c3af7 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -45,6 +45,34 @@ configure_file(
   install_dir: dbus_service_dir,
 )
 
+tracker_conf = configuration_data()
+tracker_conf.set('bindir', photos_bindir)
+
+tracker = photos_namespace + '.Tracker1.service'
+
+configure_file(
+  input: tracker + '.in',
+  output: tracker,
+  configuration: tracker_conf,
+  install: true,
+  install_dir: dbus_service_dir,
+)
+
+domain_ontologies_dir = join_paths(photos_datadir, 'tracker', 'domain-ontologies')
+
+domain_conf = configuration_data()
+domain_conf.set('datadir', photos_datadir)
+
+domain_rule = photos_namespace + '.domain.rule'
+
+configure_file(
+  input: domain_rule + '.in',
+  output: domain_rule,
+  configuration: domain_conf,
+  install: true,
+  install_dir: domain_ontologies_dir,
+)
+
 install_data(
   photos_namespace + '.search-provider.ini',
   install_dir: join_paths(photos_datadir, 'gnome-shell', 'search-providers'),
diff --git a/data/org.gnome.Photos.Tracker1.service.in b/data/org.gnome.Photos.Tracker1.service.in
new file mode 100644
index 00000000..a63774c9
--- /dev/null
+++ b/data/org.gnome.Photos.Tracker1.service.in
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=org.gnome.Photos.Tracker1
+Exec=/app/libexec/tracker-store
+SystemdService=tracker-store.service
diff --git a/data/org.gnome.Photos.domain.rule.in b/data/org.gnome.Photos.domain.rule.in
new file mode 100644
index 00000000..3377d15b
--- /dev/null
+++ b/data/org.gnome.Photos.domain.rule.in
@@ -0,0 +1,39 @@
+[DomainOntology]
+# All locations accept
+# 1) Paths relative from a variable, the variables
+#    may be: HOME, XDG_CACHE_HOME, XDG_DATA_HOME, XDG_RUNTIME_DIR,
+#    XDG_DESKTOP_DIR, XDG_DOCUMENTS_DIR, XDG_DOWNLOAD_DIR,
+#    XDG_MUSIC_DIR, XDG_PICTURES_DIR, XDG_PUBLICSHARE_DIR,
+#    XDG_VIDEOS_DIR.
+#
+#    eg. $XDG_CACHE_HOME/...
+#
+# 2) URIs
+#
+#    eg. file:///var/...
+#
+
+# Location for the Tracker database (not optional)
+CacheLocation=$XDG_CACHE_HOME/tracker
+
+# Location for the data journal, used in data recovery
+# situations (optional)
+JournalLocation=$XDG_DATA_HOME/tracker/data
+
+# Name of the ontology to use, must be one located in
+# $(sharedir)/tracker/ontologies
+OntologyName=nepomuk
+
+# DBus name for the owner (not optional). Tracker will use
+# the domain as the prefix of the DBus name for all the
+# services related to this domain ontology.
+#
+# eg. org.gnome.Photos
+Domain=org.gnome.Photos
+
+# Miners that the domain ontology will require. This is
+# purely a hint (mainly for libtracker-control), and not
+# any sort of white list. Anything else knowing about this
+# domain ontology may still perform updates, miners and
+# non-miners.
+Miners=Miner.Extract
diff --git a/flatpak/org.gnome.Photos.json b/flatpak/org.gnome.Photos.json
index 5410a64f..b9a10917 100644
--- a/flatpak/org.gnome.Photos.json
+++ b/flatpak/org.gnome.Photos.json
@@ -9,10 +9,13 @@
     "finish-args": [
         "--env=DCONF_USER_CONFIG_DIR=.config/dconf",
         "--env=TRACKER_SPARQL_BACKEND=bus",
+        "--env=TRACKER_VERBOSITY=3",
         "--filesystem=~/.config/dconf:ro",
         "--filesystem=xdg-download",
         "--filesystem=xdg-pictures",
         "--filesystem=xdg-run/dconf",
+        "--filesystem=~/.cache",
+        "--filesystem=~/.local/share",
         "--share=ipc",
         "--share=network",
         "--socket=fallback-x11",
@@ -309,4 +312,4 @@
             ]
         }
     ]
-}
+}
\ No newline at end of file
diff --git a/src/photos-tracker-queue.c b/src/photos-tracker-queue.c
index 76683ff3..54da62a2 100644
--- a/src/photos-tracker-queue.c
+++ b/src/photos-tracker-queue.c
@@ -290,6 +290,8 @@ photos_tracker_queue_initable_init (GInitable *initable, GCancellable *cancellab
 
   g_assert_no_error (self->initialization_error);
 
+  tracker_sparql_connection_set_domain ("org.gnome.Photos.domain");
+
   self->connection = tracker_sparql_connection_get (cancellable, &self->initialization_error);
   if (G_UNLIKELY (self->initialization_error != NULL))
     goto out;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]