module-gsettings: new module to store configuration using gsettings

GConf is deprecated, and distributions are removing it. paprefs depends
on GConf, so in order to avoid paprefs getting removed as well, paprefs
has to be changed to use something else than GConf. GSettings is the
easiest alternative to migrate to, although it has the same problems
that GConf had: no support for system mode or networking.

This patch takes the non-GConf specific code from module-gconf and puts
it in stdin-util.[ch], which is then reused by module-gsettings.
module-gsettings is designed to be very similar to module-gconf.

Migration is expected to happen as follows: Distributions update
PulseAudio and paprefs at the same time, or first PulseAudio and then
paprefs. paprefs depends on module-gsettings, and module-gsettings
conflicts with module-gconf. Therefore module-gconf gets automatically
removed during the paprefs update. After the update an old PulseAudio is
likely to be running with module-gconf loaded. If the user tries to use
paprefs during this period, whatever the user does in paprefs won't have
any effect until PulseAudio is restarted (probably by a reboot or
relogin). This is not ideal, but will have to do.

When module-gsettings is loaded, it runs gsettings-data-convert
(implemented in a later patch). That will copy the settings from GConf
to GSettings. If gsettings-data-convert is not available (it's part of
GConf, so it may have already been uninstalled), then any previous
paprefs settings are lost.
This commit is contained in:
Sylvain Baubeau 2016-07-25 21:58:48 +02:00 committed by Tanu Kaskinen
parent ba2b748d40
commit 785b660d8a
8 changed files with 747 additions and 291 deletions

View file

@ -1412,6 +1412,14 @@ pulselibexec_PROGRAMS += \
gconf-helper
endif
if HAVE_GSETTINGS
modlibexec_LTLIBRARIES += \
module-gsettings.la
pulselibexec_PROGRAMS += \
gsettings-helper
endif
if HAVE_WAVEOUT
modlibexec_LTLIBRARIES += \
module-waveout.la
@ -2057,7 +2065,10 @@ module_systemd_login_la_LIBADD = $(MODULE_LIBADD) $(SYSTEMD_LIBS) $(SYSTEMDLOGIN
module_systemd_login_la_CFLAGS = $(AM_CFLAGS) $(SYSTEMD_CFLAGS) $(SYSTEMDLOGIN_CFLAGS) -DPA_MODULE_NAME=module_systemd_login
# GConf support
module_gconf_la_SOURCES = modules/gconf/module-gconf.c
module_gconf_la_SOURCES = \
modules/stdin-util.c modules/stdin-util.h \
modules/gconf/module-gconf.c
module_gconf_la_LDFLAGS = $(MODULE_LDFLAGS)
module_gconf_la_LIBADD = $(MODULE_LIBADD)
module_gconf_la_CFLAGS = $(AM_CFLAGS) -DPA_GCONF_HELPER=\"$(pulselibexecdir)/gconf-helper\" -DPA_MODULE_NAME=module_gconf
@ -2067,6 +2078,24 @@ gconf_helper_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-
gconf_helper_CFLAGS = $(AM_CFLAGS) $(GCONF_CFLAGS)
gconf_helper_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
# GSettings support
module_gsettings_la_SOURCES = \
modules/stdin-util.c modules/stdin-util.h \
modules/gsettings/module-gsettings.c
module_gsettings_la_LDFLAGS = $(MODULE_LDFLAGS)
module_gsettings_la_LIBADD = $(MODULE_LIBADD)
module_gsettings_la_CFLAGS = $(AM_CFLAGS) -DPA_GSETTINGS_HELPER=\"$(pulselibexecdir)/gsettings-helper\" -DPA_MODULE_NAME=module_gsettings
gsettings_helper_SOURCES = modules/gsettings/gsettings-helper.c
gsettings_helper_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@PA_MAJORMINOR@.la libpulse.la $(GSETTINGS_LIBS)
gsettings_helper_CFLAGS = $(AM_CFLAGS) $(GSETTINGS_CFLAGS)
gsettings_helper_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
if HAVE_GSETTINGS
gsettings_SCHEMAS = modules/gsettings/org.freedesktop.pulseaudio.gschema.xml
@GSETTINGS_RULES@
endif
# Bluetooth policy
module_bluetooth_policy_la_SOURCES = modules/bluetooth/module-bluetooth-policy.c
module_bluetooth_policy_la_LDFLAGS = $(MODULE_LDFLAGS)