[pulseaudio-discuss] [paprefs][PATCH 2/2] rename "module" to "module-group" in GSettings schemas and paths

Tanu Kaskinen tanuk at iki.fi
Mon Apr 23 13:27:27 UTC 2018


This change was done in PulseAudio, because a "module" object actually
referred up to 10 module instances, so talking about a module group is
less confusing.

Also rename the PA_GSETTINGS_PATH_MODULES define to simpler
MODULE_GROUPS_PATH and actually use it (previously the define was not
used anywhere), and add MODULE_GROUP_SCHEMA to be used instead of
repeating the same string literal over and over.
---
 src/paprefs.cc | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/paprefs.cc b/src/paprefs.cc
index e9c5a00..123fea5 100644
--- a/src/paprefs.cc
+++ b/src/paprefs.cc
@@ -31,7 +31,8 @@
 
 #include <pulse/version.h>
 
-#define PA_GSETTINGS_PATH_MODULES "/org/freedesktop/pulseaudio/modules"
+#define MODULE_GROUPS_PATH "/org/freedesktop/pulseaudio/module-groups"
+#define MODULE_GROUP_SCHEMA "org.freedesktop.pulseaudio.module-group"
 #define MAX_MODULES 10
 
 class MainWindow : public Gtk::Window {
@@ -165,26 +166,26 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
     checkForPackageKit();
     checkForModules();
 
-    combineSettings = Gio::Settings::create("org.freedesktop.pulseaudio.module",
-                                            "/org/freedesktop/pulseaudio/modules/combine/");
+    combineSettings = Gio::Settings::create(MODULE_GROUP_SCHEMA,
+                                            MODULE_GROUPS_PATH "/combine/");
 
-    remoteAccessSettings = Gio::Settings::create("org.freedesktop.pulseaudio.module",
-                                                 "/org/freedesktop/pulseaudio/modules/remote-access/");
+    remoteAccessSettings = Gio::Settings::create(MODULE_GROUP_SCHEMA,
+                                                 MODULE_GROUPS_PATH "/remote-access/");
 
-    zeroconfSettings = Gio::Settings::create("org.freedesktop.pulseaudio.module",
-                                             "/org/freedesktop/pulseaudio/modules/zeroconf-discover/");
+    zeroconfSettings = Gio::Settings::create(MODULE_GROUP_SCHEMA,
+                                             MODULE_GROUPS_PATH "/zeroconf-discover/");
 
-    raopSettings = Gio::Settings::create("org.freedesktop.pulseaudio.module",
-                                         "/org/freedesktop/pulseaudio/modules/raop-discover/");
+    raopSettings = Gio::Settings::create(MODULE_GROUP_SCHEMA,
+                                         MODULE_GROUPS_PATH "/raop-discover/");
 
-    rtpRecvSettings = Gio::Settings::create("org.freedesktop.pulseaudio.module",
-                                            "/org/freedesktop/pulseaudio/modules/rtp-recv/");
+    rtpRecvSettings = Gio::Settings::create(MODULE_GROUP_SCHEMA,
+                                            MODULE_GROUPS_PATH "/rtp-recv/");
 
-    rtpSendSettings = Gio::Settings::create("org.freedesktop.pulseaudio.module",
-                                            "/org/freedesktop/pulseaudio/modules/rtp-send/");
+    rtpSendSettings = Gio::Settings::create(MODULE_GROUP_SCHEMA,
+                                            MODULE_GROUPS_PATH "/rtp-send/");
 
-    upnpSettings = Gio::Settings::create("org.freedesktop.pulseaudio.module",
-                                         "/org/freedesktop/pulseaudio/modules/upnp-media-server/");
+    upnpSettings = Gio::Settings::create(MODULE_GROUP_SCHEMA,
+                                         MODULE_GROUPS_PATH "/upnp-media-server/");
 
     combineSettings->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onGSettingsChange));
     remoteAccessSettings->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onGSettingsChange));
-- 
2.17.0



More information about the pulseaudio-discuss mailing list