Drops our dependency on GConf, but bumps our GLib dependency to 2.26.0.
Closes: https://bugzilla.gnome.org/show_bug.cgi?id=647909
Dependencies:
• telepathy-glib ≥ 0.17.5
+• GLib ≥ 2.26.0
+• GConf dependency dropped
Bugs fixed:
• Bug 674256 — telepathy-glib minimal version is insufficient
+• Bug 647909 — Port Folks to GSettings
Overview of changes from libfolks 0.6.9 to libfolks 0.7.0
=========================================================
AC_DISABLE_STATIC
LT_INIT
PKG_PROG_PKG_CONFIG([0.21])
+GLIB_GSETTINGS
AC_SUBST([CFLAGS])
AC_SUBST([CPPFLAGS])
# Dependencies
# -----------------------------------------------------------
-GLIB_REQUIRED=2.24.0
+GLIB_REQUIRED=2.26.0
TP_GLIB_REQUIRED=0.17.5
VALA_REQUIRED=0.15.2
VALADOC_REQUIRED=0.3.1
TRACKER_SPARQL_MAJOR=0.14
TRACKER_SPARQL_REQUIRED=0.13.1
-GCONF2_REQUIRED=2.31
EBOOK_REQUIRED=3.1.5
EDATASERVER_REQUIRED=3.1.5
PKG_CHECK_MODULES([GMODULE], [gmodule-no-export-2.0])
PKG_CHECK_MODULES([GIO], [gio-2.0 >= $GLIB_REQUIRED])
PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
-PKG_CHECK_MODULES([GCONF2], [gconf-2.0 >= $GCONF2_REQUIRED])
# FIXME: We depend on libgee < 0.7 because 0.7 breaks API. bgo#627746
PKG_CHECK_MODULES([GEE], [gee-1.0 < 0.7],
# Final output
# -----------------------------------------------------------
+# FIXME: We can't remove gconf.path until bgo#635379 is fixed, since we need to
+# safely contain EDS' use of GConf for the EDS backend tests.
+# Note that our use of gconf.path doesn't actually need GConf to be installed,
+# though, so it's not a hard dependency of folks.
+
AC_CONFIG_FILES([
backends/telepathy/lib/folks-telepathy.pc
backends/telepathy/lib/folks-telepathy-uninstalled.pc
backends/eds/lib/folks-eds-uninstalled.pc
folks/folks.pc
folks/folks-uninstalled.pc
+ folks/org.freedesktop.folks.gschema.xml.in
Makefile
backends/Makefile
backends/key-file/Makefile
$(sort \
$(filter-out $(folks_doc_files_blacklist),$(folks_doc_files_all)))
folks_doc_deps = \
- gconf-2.0 \
gmodule-2.0 \
gio-2.0 \
gee-1.0 \
# folks-telepathy documentation
folks_telepathy_doc_files = $(top_srcdir)/backends/telepathy/lib/*.vala
folks_telepathy_doc_deps = \
- gconf-2.0 \
gmodule-2.0 \
gio-2.0 \
gee-1.0 \
folks_eds_doc_files = $(top_srcdir)/backends/eds/lib/*.vala
folks_eds_doc_deps = \
- gconf-2.0 \
gmodule-2.0 \
gio-2.0 \
gee-1.0 \
folks_libsocialweb_doc_files = $(top_srcdir)/backends/libsocialweb/lib/*.vala
folks_libsocialweb_doc_deps = \
- gconf-2.0 \
gmodule-2.0 \
gio-2.0 \
gee-1.0 \
--pkg gmodule-2.0 \
--pkg gio-2.0 \
--pkg gee-1.0 \
- --pkg gconf-2.0 \
--includedir folks \
--vapi folks.vapi \
-H folks.h \
$(GLIB_CFLAGS) \
$(GMODULE_CFLAGS) \
$(GEE_CFLAGS) \
- $(GCONF2_CFLAGS) \
$(NULL)
libfolks_la_LIBADD = \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
$(GEE_LIBS) \
- $(GCONF2_LIBS) \
libfolks-internal.la \
$(NULL)
$(BUILT_SOURCES) \
$(NULL)
+##################################################
+# GSettings
+##################################################
+
+gsettings_SCHEMAS = org.freedesktop.folks.gschema.xml
+
+@GSETTINGS_RULES@
+@INTLTOOL_XML_NOMERGE_RULE@
+
+# Data migration tool
+convertdir = $(datadir)/GConf/gsettings
+convert_DATA = folks.convert
+
+EXTRA_DIST += $(convert_DATA)
+CLEANFILES += $(gsettings_SCHEMAS)
+GITIGNOREFILES += org.freedesktop.folks.gschema.valid
+
-include $(top_srcdir)/git.mk
--- /dev/null
+[org.freedesktop.folks]
+primary-store = /system/folks/backends/primary_store
private Debug _debug;
private string _configured_primary_store_type_id;
private string _configured_primary_store_id;
- private static const string _FOLKS_CONFIG_KEY =
- "/system/folks/backends/primary_store";
+ private static const string _FOLKS_GSETTINGS_SCHEMA = "org.freedesktop.folks";
+ private static const string _PRIMARY_STORE_CONFIG_KEY = "primary-store";
/* The number of persona stores and backends we're waiting to become
* quiescent. Once these both reach 0, we should be in a quiescent state.
private static const uint _QUIESCENT_TIMEOUT = 30; /* seconds */
/* We use this to know if the primary PersonaStore has been explicitly
- * set by the user (either via GConf or an env variable). If that is the
+ * set by the user (either via GSettings or an env variable). If that is the
* case, we don't want to override it with other PersonaStores that
* announce themselves as default (i.e.: default address book from e-d-s). */
private bool _user_configured_primary_store = false;
* by:
*
* - the FOLKS_PRIMARY_STORE env var (mostly for debugging)
- * - the GConf key set in _FOLKS_CONFIG_KEY (system set store)
+ * - the GSettings key set in `_PRIMARY_STORE_CONFIG_KEY` (system set store)
* - going with the `key-file` or `eds` store as the fall-back option
*
* @since 0.5.0
this._configured_primary_store_id = "";
}
- try
- {
- unowned GConf.Client client = GConf.Client.get_default ();
- GConf.Value? val = client.get (this._FOLKS_CONFIG_KEY);
- if (val != null)
- {
- string? val_str = ((!) val).get_string ();
-
- if (val_str != null)
- {
- debug ("Setting primary store IDs from GConf.");
- this._configure_primary_store ((!) val_str);
- }
- }
- }
- catch (GLib.Error e)
+ var settings = new Settings (this._FOLKS_GSETTINGS_SCHEMA);
+ var val = settings.get_string (this._PRIMARY_STORE_CONFIG_KEY);
+ if (val != null && val != "")
{
- /* We ignore errors and go with the default store */
+ debug ("Setting primary store IDs from GSettings.");
+ this._configure_primary_store ((!) val);
}
}
throw new IndividualAggregatorError.NO_PRIMARY_STORE (
_("Can’t link personas with no primary store.") + "\n" +
_("Persona store ‘%s:%s’ is configured as primary, but could not be found or failed to load.") + "\n" +
- _("Check the service providing the persona store is running, or change the default store in that service or using the “%s” GConf key."),
+ _("Check the relevant service is running, or change the default store in that service or using the “%s” GSettings key."),
this._configured_primary_store_type_id,
- this._configured_primary_store_id, this._FOLKS_CONFIG_KEY);
+ this._configured_primary_store_id,
+ "%s %s".printf (this._FOLKS_GSETTINGS_SCHEMA,
+ this._PRIMARY_STORE_CONFIG_KEY));
}
/* Don't bother linking if it's just one Persona */
throw new IndividualAggregatorError.NO_PRIMARY_STORE (
_("Can’t add personas with no primary store.") + "\n" +
_("Persona store ‘%s:%s’ is configured as primary, but could not be found or failed to load.") + "\n" +
- _("Check the service providing the persona store is running, or change the default store in that service or using the “%s” GConf key."),
+ _("Check the relevant service is running, or change the default store in that service or using the “%s” GSettings key."),
this._configured_primary_store_type_id,
- this._configured_primary_store_id, this._FOLKS_CONFIG_KEY);
+ this._configured_primary_store_id,
+ "%s %s".printf (this._FOLKS_GSETTINGS_SCHEMA,
+ this._PRIMARY_STORE_CONFIG_KEY));
}
else if (new_persona == null)
{
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<schemalist>
+ <schema id="org.freedesktop.folks" path="/org/freedesktop/folks/" gettext-domain="@GETTEXT_PACKAGE@">
+ <key name="primary-store" type="s">
+ <default>''</default>
+ <_summary>Primary store ID</_summary>
+ <_description>The ID of the persona store which folks should use as primary (i.e. to store linking data in).
+ The type ID of the store may optionally be prepended, separated by a colon.
+ For example: “eds:system” or “key-file”.</_description>
+ </key>
+ </schema>
+</schemalist>
public abstract string type_id
{
/* Note: the type_id must not contain colons because the primary writeable
- * store is configured, either via GConf or the FOLKS_PRIMARY_STORE
+ * store is configured, either via GSettings or the FOLKS_PRIMARY_STORE
* env variable, with a string of the form 'type_id:store_id'. */
get;
}
folks/local-id-details.vala
folks/name-details.vala
folks/note-details.vala
+folks/org.freedesktop.folks.gschema.xml.in.in
folks/phone-details.vala
folks/postal-address-details.vala
folks/role-details.vala
folks/local-id-details.c
folks/name-details.c
folks/note-details.c
+folks/org.freedesktop.folks.gschema.xml.in
folks/phone-details.c
folks/postal-address-details.c
folks/role-details.c