Commit e9215d33 authored by Carlos Garnacho's avatar Carlos Garnacho

tracker: Drop Tracker code

The story of saved contacts in Tracker is a convoluted one,
and this code is mostly an artifact. 65 Million years ago, when
Nokia dominated the world, Maemo/meego relied on Tracker and had
specialized contact apps that used it as a storage.

After Elop hit the Earth, saved contacts barely survived the
event, mostly feeding off a small Evolution plugin. But that
was not meant to last long, the evolution plugin went extinct,
taking all traces of saved contacts with it. Just the ontology
remained, a hollow shell that yes, could be able to hold a
contact, would they still exist.

Modern times arrived, and with them the interest on archeology,
thus this fossilized piece of code is found and taken to the
museum where it belongs.

Should Tracker-using contacts ever exist again, the way to
communicate with them would be radically different, let this code
be a testimony of how it won't be done.

Fixes: #126
parent 5785ecae
Pipeline #256445 passed with stages
in 5 minutes and 7 seconds
......@@ -183,7 +183,7 @@ but then running it against an older version with a different API. EDS exposes
its API version in its D-Bus interface, so if the wrong version of EDS is
running, folks can’t find it on the bus, which cripples folks’ EDS backend.
The same principle applies to other D-Bus services which folks relies on, such
as Telepathy and Tracker.
as Telepathy.
There are two ways to fix this:
• If you wish to use your desktop’s session bus, re-compile folks against the
......
......@@ -27,10 +27,6 @@ if telepathy_backend_enabled
subdir('telepathy')
endif
if tracker_backend_enabled
subdir('tracker')
endif
if eds_backend_enabled
subdir('eds')
endif
......
glib-2.0
gobject-2.0
folks
tracker-sparql-@TRACKER_SPARQL_MAJOR@
{
global:
TRF_*;
trf_*;
local:
*;
};
tracker_backendlib_gir_name = 'FolksTracker-@0@'.format(folks_api_version)
tracker_backendlib_sources = files(
'trf-persona-store.vala',
'trf-persona.vala',
'trf-util.vala',
)
tracker_backendlib_sources += configure_file(
input: namespace_vala_in,
output: 'namespace.vala',
configuration: {
'BACKENDLIB_GIR_NAME': tracker_backendlib_gir_name.split('-')[0],
'BACKENDLIB_GIR_VERSION': folks_api_version,
'BACKENDLIB_NAMESPACE': 'Trf',
},
)
tracker_backendlib_deps = [
backend_deps,
tracker_sparql_dep,
]
# FIXME: we need to set these manually for the valadoc target as long as meson
# doesn't have native support (https://github.com/mesonbuild/meson/issues/894)
tracker_backendlib_doc_deps = [
'--pkg', tracker_sparql_dep.name(),
'--pkg', 'folks',
]
tracker_backendlib_vala_flags = [
common_backendlib_vala_flags,
]
tracker_backendlib_c_flags = [
'-include', 'config.h',
'-DBACKEND_NAME="@0@"'.format(tracker_backend_name),
'-DG_LOG_DOMAIN="@0@"'.format(tracker_backend_name),
]
tracker_backendlib_symbolmap = meson.current_source_dir() / 'folks-@0@.map'.format(tracker_backend_name)
tracker_backendlib_link_flags = cc.get_supported_link_arguments(
'-Wl,--version-script,@0@'.format(tracker_backendlib_symbolmap),
)
tracker_backendlib = shared_library('folks-@0@'.format(tracker_backend_name),
tracker_backendlib_sources,
dependencies: tracker_backendlib_deps,
vala_args: tracker_backendlib_vala_flags,
c_args: tracker_backendlib_c_flags,
link_args: tracker_backendlib_link_flags,
link_depends: tracker_backendlib_symbolmap,
version: folks_tracker_lib_version,
vala_header: 'folks/folks-@0@.h'.format(dummy_backend_name),
vala_gir: tracker_backendlib_gir_name + '.gir',
install: true,
install_dir: [ true, folks_headers_install_dir, true, true ],
)
# Also make sure to install the VAPI's .deps file
configure_file(
output: 'folks-tracker.deps',
input: 'folks-tracker.deps.in',
configuration: { 'TRACKER_SPARQL_MAJOR': tracker_sparql_version },
install_dir: get_option('datadir') / 'vala' / 'vapi',
)
# FIXME: This comes straight from the Meson docs on how to create/install a
# typelib file for your Vala shared library. However, as mentioned in
# https://github.com/mesonbuild/meson/issues/4481, this is not ideal.
custom_target(tracker_backendlib_gir_name + ' typelib',
command: [ g_ir_compiler,
'--output', '@OUTPUT@',
'--includedir', folks_build_dir,
meson.current_build_dir() / (tracker_backendlib_gir_name + '.gir')
],
output: tracker_backendlib_gir_name + '.typelib',
depends: tracker_backendlib,
install: true,
install_dir: folks_typelibdir,
)
tracker_backendlib_dep = declare_dependency(
link_with: tracker_backendlib,
include_directories: include_directories('.'),
dependencies: tracker_sparql_dep,
)
# Pkg-config file
pkgconfig.generate(tracker_backendlib,
name: 'Folks tracker support library',
description: 'Tracker support library for the Folks meta-contacts library',
filebase: 'folks-@0@'.format(tracker_backend_name),
requires: [ 'folks', glib_dep, gobject_dep, gee_dep, tracker_sparql_dep ],
variables: common_pkgconf_variables,
)
This diff is collapsed.
This diff is collapsed.
/*
* Copyright (C) 2011 Collabora Ltd.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
*/
using Gee;
using Tracker;
using Tracker.Sparql;
public struct Event
{
int graph_id;
int subject_id;
int pred_id;
int object_id;
}
[DBus (name = "org.freedesktop.Tracker1.Resources")]
private interface Resources : DBusProxy {
[DBus (name = "GraphUpdated")]
public signal void graph_updated
(string class_name, Event[] deletes, Event[] inserts);
}
internal class Trf.AfflInfo : Object
{
public string im_tracker_id { get; set; }
public string im_proto { get; set; }
public string im_account_id { get; set; }
public string im_nickname { get; set; }
public string affl_tracker_id { get; set; }
public string title { get; set; }
public string org { get; set; }
public string role { get; set; }
public Folks.PostalAddressFieldDetails postal_address_fd;
public string email { get; set; }
public string phone { get; set; }
public string website { get; set; }
public string blog { get; set; }
public string url { get; set; }
public string to_string ()
{
string ret = " { ";
bool first = true;
var properties = this.get_class ().list_properties ();
foreach (unowned ParamSpec pspec in properties)
{
var property = pspec.get_name ();
var prop_value = Value (pspec.value_type);
this.get_property (property, ref prop_value);
string value = prop_value.get_string ();
if (first == false)
ret += ", ";
ret += "%s : %s".printf (property, value);
first = false;
}
ret += " } ";
return ret;
}
}
public class Trf.OntologyDefs : Object
{
public const string DEFAULT_CONTACT_URN =
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#default-contact-me";
public const string PERSON_CLASS =
"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#PersonContact";
public const string NCO_FULLNAME = "nco:fullname";
public const string NCO_FAMILY = "nco:nameFamily";
public const string NCO_GIVEN = "nco:nameGiven";
public const string NCO_ADDITIONAL = "nco:nameAdditional";
public const string NCO_SUFFIX = "nco:nameHonorificSuffix";
public const string NCO_PREFIX = "nco:nameHonorificPrefix";
public const string NCO_NICKNAME = "nco:nickname";
public const string RDF_TYPE = "ns:type";
public const string NCO_PERSON = "nco:PersonContact";
public const string NCO_URL = "nco:url";
public const string NCO_WEBSITE = "nco:websiteUrl";
public const string NCO_BLOG = "nco:blogUrl";
public const string NAO_FAVORITE = "nao:predefined-tag-favorite";
public const string NAO_TAG = "nao:hasTag";
public const string NAO_PROPERTY = "nao:Property";
public const string NAO_HAS_PROPERTY = "nao:hasProperty";
public const string NAO_PROPERTY_NAME = "nao:propertyName";
public const string NAO_PROPERTY_VALUE = "nao:propertyValue";
public const string NCO_HAS_EMAIL = "nco:hasEmailAddress";
public const string NCO_EMAIL = "nco:EmailAddress";
public const string NCO_EMAIL_PROP = "nco:emailAddress";
public const string NCO_HAS_PHONE = "nco:hasPhoneNumber";
public const string NCO_PHONE = "nco:PhoneNumber";
public const string NCO_PHONE_PROP = "nco:phoneNumber";
public const string NCO_HAS_AFFILIATION = "nco:hasAffiliation";
public const string NCO_AFFILIATION = "nco:Affiliation";
public const string NCO_BIRTHDAY = "nco:birthDate";
public const string NCO_NOTE = "nco:note";
public const string NCO_GENDER = "nco:gender";
public const string NCO_MALE = "nco:gender-male";
public const string NCO_FEMALE = "nco:gender-female";
public const string NCO_PHOTO = "nco:photo";
public const string NIE_URL = "nie:url";
public const string NFO_IMAGE = "nfo:Image";
public const string NIE_DATAOBJECT = "nie:DataObject";
public const string NCO_IMADDRESS = "nco:IMAddress";
public const string NCO_HAS_IMADDRESS = "nco:hasIMAddress";
public const string NCO_IMPROTOCOL = "nco:imProtocol";
public const string NCO_IMID = "nco:imID";
public const string NCO_IM_NICKNAME = "nco:imNickname";
public const string NCO_POSTAL_ADDRESS = "nco:PostalAddress";
public const string NCO_HAS_POSTAL_ADDRESS = "nco:hasPostalAddress";
public const string NCO_POBOX = "nco:pobox";
public const string NCO_DISTRICT = "nco:district";
public const string NCO_COUNTY = "nco:county";
public const string NCO_LOCALITY = "nco:locality";
public const string NCO_POSTALCODE = "nco:postalcode";
public const string NCO_STREET_ADDRESS = "nco:streetAddress";
public const string NCO_ADDRESS_LOCATION = "nco:addressLocation";
public const string NCO_EXTENDED_ADDRESS = "nco:extendedAddress";
public const string NCO_COUNTRY = "nco:country";
public const string NCO_REGION = "nco:region";
public const string NCO_ROLE = "nco:role";
public const string NCO_TITLE = "nco:title";
public const string NCO_ORG = "nco:org";
public const string NCO_URL_PREFIX =
"<http://www.semanticdesktop.org/ontologies/2007/03/22/";
public const string NAO_URL_PREFIX =
"<http://www.semanticdesktop.org/ontologies/2007/08/15/";
public const string RDF_URL_PREFIX =
"<http://www.w3.org/1999/02/";
}
# The tracker backend
tracker_backend_name = 'tracker'
# Backend library
subdir('lib')
tracker_backend_sources = [
'tr-backend-factory.vala',
'tr-backend.vala',
]
tracker_backend_deps = [
backend_deps,
tracker_sparql_dep,
tracker_backendlib_dep,
]
tracker_backend_vala_flags = [
]
tracker_backend_c_flags = [
'-include', 'config.h',
'-DBACKEND_NAME="@0@"'.format(tracker_backend_name),
'-DG_LOG_DOMAIN="@0@"'.format(tracker_backend_name),
]
tracker_backend = shared_library(tracker_backend_name,
tracker_backend_sources,
dependencies: tracker_backend_deps,
vala_args: tracker_backend_vala_flags,
c_args: tracker_backend_c_flags,
name_prefix: '',
install_dir: folks_backend_dir / tracker_backend_name,
install: true,
)
folks_backends += tracker_backend
/*
* Copyright (C) 2009 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
* Copyright (C) 2009 Nokia Corporation.
* Copyright (C) 2010 Collabora Ltd.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
* Travis Reitter <travis.reitter@collabora.co.uk>
* Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
*
* This file was originally part of Rygel.
*/
using Folks;
/**
* The Tracker backend module entry point.
*
* @backend_store a store to add the Tracker backends to
*/
public void module_init (BackendStore backend_store)
{
backend_store.add_backend (new Folks.Backends.Tr.Backend ());
}
/**
* The tracker backend module exit point.
*
* @param backend_store the store to remove the backends from
*/
public void module_finalize (BackendStore backend_store)
{
/* FIXME: No way to remove backends from the store. */
}
/*
* Copyright (C) 2011 Collabora Ltd.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Travis Reitter <travis.reitter@collabora.co.uk>
* Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
*/
using Folks;
using Folks.Backends.Tr;
using GLib;
using Gee;
extern const string BACKEND_NAME;
/**
* A backend which connects to Tracker and creates a {@link PersonaStore}
* for each service.
*/
public class Folks.Backends.Tr.Backend : Folks.Backend
{
private bool _is_prepared = false;
private bool _prepare_pending = false; /* used by unprepare() too */
private bool _is_quiescent = false;
private HashMap<string, PersonaStore> _persona_stores;
private Map<string, PersonaStore> _persona_stores_ro;
/**
* {@inheritDoc}
*/
public override string name { get { return BACKEND_NAME; } }
/**
* {@inheritDoc}
*/
public override Map<string, PersonaStore> persona_stores
{
get { return this._persona_stores_ro; }
}
/**
* {@inheritDoc}
*/
public override void enable_persona_store (Folks.PersonaStore store)
{
if (this._persona_stores.has_key (store.id) == false)
{
this._add_store ((Trf.PersonaStore) store);
}
}
/**
* {@inheritDoc}
*/
public override void disable_persona_store (Folks.PersonaStore store)
{
if (this._persona_stores.has_key (store.id))
{
this._store_removed_cb (store);
}
}
/**
* {@inheritDoc}
*/
public override void set_persona_stores (Set<string>? storeids)
{
if (storeids != null)
{
if (storeids.size == 0)
{
this.disable_persona_store (this._persona_stores.get (BACKEND_NAME));
}
else
{
this._add_default_persona_store ();
}
}
else
{
this._add_default_persona_store ();
}
}
/**
* {@inheritDoc}
*/
public Backend ()
{
Object ();
}
construct
{
this._persona_stores = new HashMap<string, PersonaStore> ();
this._persona_stores_ro = this._persona_stores.read_only_view;
}
/**
* Whether this Backend has been prepared.
*
* See {@link Folks.Backend.is_prepared}.
*/
public override bool is_prepared
{
get { return this._is_prepared; }
}
/**
* Whether this Backend has reached a quiescent state.
*
* See {@link Folks.Backend.is_quiescent}.
*
* @since 0.6.2
*/
public override bool is_quiescent
{
get { return this._is_quiescent; }
}
/**
* {@inheritDoc}
*
*/
public override async void prepare () throws GLib.Error
{
Internal.profiling_start ("preparing Tr.Backend");
if (this._is_prepared || this._prepare_pending)
{
return;
}
try
{
this._prepare_pending = true;
this.freeze_notify ();
this._add_default_persona_store ();
this._is_prepared = true;
this.notify_property ("is-prepared");
this._is_quiescent = true;
this.notify_property ("is-quiescent");
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
Internal.profiling_end ("preparing Tr.Backend");
}
/**
* {@inheritDoc}
*/
public override async void unprepare () throws GLib.Error
{
if (!this._is_prepared || this._prepare_pending)
{
return;
}
try
{
this._prepare_pending = true;
this.freeze_notify ();
foreach (var persona_store in this._persona_stores.values)
{
this.persona_store_removed (persona_store);
}
this._persona_stores.clear ();
this.notify_property ("persona-stores");
this._is_quiescent = false;
this.notify_property ("is-quiescent");
this._is_prepared = false;
this.notify_property ("is-prepared");
}
finally
{
this.thaw_notify ();
this._prepare_pending = false;
}
}
/**
* Add a the default Persona Store.
*/