[polari/wip/carlosg/tracker: 439/445] build: Update to Tracker 3.x




commit 960d0f51f5354e37167a5543d92215f66db91c56
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Jun 19 10:37:27 2021 +0200

    build: Update to Tracker 3.x
    
    Depend on a relatively recent version, some features there will
    be handy.

 data/resources/polari.ontology | 14 ++++++--------
 meson.build                    |  2 +-
 src/chatView.js                |  3 ---
 src/lib/polari-util.c          | 15 +++++++--------
 src/main.js                    |  2 +-
 src/meson.build                |  2 +-
 src/polari-log-tool.c          |  4 ++--
 src/telepathyClient.js         |  2 +-
 8 files changed, 19 insertions(+), 25 deletions(-)
---
diff --git a/data/resources/polari.ontology b/data/resources/polari.ontology
index 6d8da96b..a8ca603b 100644
--- a/data/resources/polari.ontology
+++ b/data/resources/polari.ontology
@@ -1,16 +1,14 @@
 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix tracker: <http://www.tracker-project.org/ontologies/tracker#> .
 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix nao: <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#> .
-@prefix nrl: <http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#> .
+@prefix nrl: <http://tracker.api.gnome.org/ontology/v3/nrl#> .
 
 @prefix polari: <http://example.org/ns#> .
 
-polari: a tracker:Namespace, tracker:Ontology ;
-        tracker:prefix "polari" ;
+polari: a nrl:Namespace, nrl:Ontology ;
+        nrl:prefix "polari" ;
         rdfs:comment "Ontology for Polari chat logs" ;
-        nao:lastModified "2017-07-22T02:35:00Z" .
+        nrl:lastModified "2017-07-22T02:35:00Z" .
 
 polari:Account a rdfs:Class ;
                rdfs:subClassOf rdfs:Resource .
@@ -77,13 +75,13 @@ polari:time a rdf:Property ;
             nrl:maxCardinality 1 ;
             rdfs:domain polari:Message ;
             rdfs:range xsd:dateTime ;
-            tracker:indexed true .
+            nrl:indexed true .
 
 polari:text a rdf:Property ;
             nrl:maxCardinality 1 ;
             rdfs:domain polari:Message ;
             rdfs:range xsd:string ;
-            tracker:fulltextIndexed true .
+            nrl:fulltextIndexed true .
 
 polari:isAction a rdf:Property ;
             nrl:maxCardinality 1 ;
diff --git a/meson.build b/meson.build
index 34e9fe6e..48247c53 100644
--- a/meson.build
+++ b/meson.build
@@ -36,7 +36,7 @@ appstream_util = find_program('appstream-util', required: false)
 gio = dependency('gio-2.0', version: '>= 2.43.4')
 gtk3 = dependency('gtk+-3.0', version: '>= 3.21.6')
 telepathy_glib = dependency('telepathy-glib')
-tracker = dependency('tracker-sparql-2.0')
+tracker = dependency('tracker-sparql-3.0', version: '>= 3.1.0')
 girepository = dependency('gobject-introspection-1.0')
 gjs = dependency('gjs-1.0', version: '>= 1.67.2')
 
diff --git a/src/chatView.js b/src/chatView.js
index 127ebc3d..5e49c4ca 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -17,9 +17,6 @@ import { UserStatusMonitor } from './userTracker.js';
 import { URLPreview } from './urlPreview.js';
 import * as Utils from './utils.js';
 
-Gio._promisify(Tpl.LogWalker.prototype,
-    'get_events_async', 'get_events_finish');
-
 export const MAX_NICK_CHARS = 8;
 const IGNORE_STATUS_TIME = 5;
 
diff --git a/src/lib/polari-util.c b/src/lib/polari-util.c
index 3f72a500..ce9b116b 100644
--- a/src/lib/polari-util.c
+++ b/src/lib/polari-util.c
@@ -153,7 +153,7 @@ polari_util_get_tracker_connection (gboolean readonly,
 
       store_path = g_build_filename (g_get_user_data_dir (),
                                      "polari",
-                                     "chatlogs.v1",
+                                     "chatlogs.v2",
                                      NULL);
       store = g_file_new_for_path (store_path);
       ontology = g_file_new_for_uri ("resource:///org/gnome/Polari/ontologies/");
@@ -161,12 +161,11 @@ polari_util_get_tracker_connection (gboolean readonly,
       if (readonly)
         flags |= TRACKER_SPARQL_CONNECTION_FLAGS_READONLY;
 
-      connection = tracker_sparql_connection_local_new (flags,
-                                                        store,
-                                                        NULL,
-                                                        ontology,
-                                                        NULL,
-                                                        error);
+      connection = tracker_sparql_connection_new (flags,
+                                                  store,
+                                                  ontology,
+                                                  NULL,
+                                                  error);
     }
 
   return connection;
@@ -184,5 +183,5 @@ polari_util_close_tracker_connection (void)
 
   connection = polari_util_get_tracker_connection (TRUE, NULL);
   if (connection)
-    g_object_unref (connection);
+    tracker_sparql_connection_close (connection);
 }
diff --git a/src/main.js b/src/main.js
index b68c95b7..26a5464a 100755
--- a/src/main.js
+++ b/src/main.js
@@ -25,7 +25,7 @@ pkg.require({
     'Secret': '1',
     'Soup': '2.4',
     'TelepathyGLib': '0.12',
-    'Tracker': '2.0',
+    'Tracker': '3.0',
 });
 pkg.requireSymbol('Gio', '2.0', 'Application.send_notification');
 pkg.requireSymbol('GLib', '2.0', 'log_variant');
diff --git a/src/meson.build b/src/meson.build
index 567bba07..f4b995c4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -139,7 +139,7 @@ gnome.generate_gir(libpolari,
   namespace: 'Polari',
   symbol_prefix: 'polari',
   identifier_prefix: 'Polari',
-  includes: ['Gio-2.0', 'Gtk-3.0', 'TelepathyGLib-0.12', 'Tracker-2.0'],
+  includes: ['Gio-2.0', 'Gtk-3.0', 'TelepathyGLib-0.12', 'Tracker-3.0'],
   extra_args: '--quiet',
   install_dir_gir: girdir,
   install_dir_typelib: typelibdir,
diff --git a/src/polari-log-tool.c b/src/polari-log-tool.c
index 81e44d2e..cd63a7df 100644
--- a/src/polari-log-tool.c
+++ b/src/polari-log-tool.c
@@ -97,7 +97,7 @@ import_ready (GObject      *source,
       if (batch_count == 500)
         {
           tracker_sparql_connection_update (connection, sparql->str,
-                                            G_PRIORITY_DEFAULT, NULL, &error);
+                                            NULL, &error);
           g_string_free (sparql, TRUE);
           sparql = g_string_new (NULL);
           batch_count = 0;
@@ -107,7 +107,7 @@ import_ready (GObject      *source,
 
   if (sparql->len > 0)
     tracker_sparql_connection_update (connection, sparql->str,
-                                      G_PRIORITY_DEFAULT, NULL, &error);
+                                      NULL, &error);
 
   if (error)
     {
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index 3b946603..97809658 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -704,7 +704,7 @@ class TelepathyClient extends Tp.BaseClient {
 
         let message = Polari.Message.new_from_tp_message (tpMessage);
         let sparql = message.to_sparql(connection, accountId, channelName, isRoom);
-        connection.update_async(sparql, 0, null, (o, res) => {
+        connection.update_async(sparql, null, (o, res) => {
             try {
                 connection.update_finish(res);
             } catch (e) {


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