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

Tanu Kaskinen tanuk at iki.fi
Tue Apr 17 06:25:45 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 ++++++++++++++++---------------
 src/paprefs.convert | 14 +++++++-------
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/src/paprefs.cc b/src/paprefs.cc
index 9b6ac78..39f3706 100644
--- a/src/paprefs.cc
+++ b/src/paprefs.cc
@@ -35,7 +35,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 {
@@ -171,26 +172,26 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
     checkForModules();
     ensureMigrated();
 
-    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));
diff --git a/src/paprefs.convert b/src/paprefs.convert
index e23a963..d9268bf 100644
--- a/src/paprefs.convert
+++ b/src/paprefs.convert
@@ -1,4 +1,4 @@
-[org.freedesktop.pulseaudio.module:/org/freedesktop/pulseaudio/modules/combine/]
+[org.freedesktop.pulseaudio.module-group:/org/freedesktop/pulseaudio/module-groups/combine/]
 args0 = /system/pulseaudio/modules/combine/args0
 args1 = /system/pulseaudio/modules/combine/args1
 args2 = /system/pulseaudio/modules/combine/args2
@@ -21,7 +21,7 @@ name8 = /system/pulseaudio/modules/combine/name8
 name9 = /system/pulseaudio/modules/combine/name9
 enabled = /system/pulseaudio/modules/combine/enabled
 
-[org.freedesktop.pulseaudio.module:/org/freedesktop/pulseaudio/modules/remote-access/]
+[org.freedesktop.pulseaudio.module-group:/org/freedesktop/pulseaudio/module-groups/remote-access/]
 args0 = /system/pulseaudio/modules/remote-access/args0
 args1 = /system/pulseaudio/modules/remote-access/args1
 args2 = /system/pulseaudio/modules/remote-access/args2
@@ -44,7 +44,7 @@ name8 = /system/pulseaudio/modules/remote-access/name8
 name9 = /system/pulseaudio/modules/remote-access/name9
 enabled = /system/pulseaudio/modules/remote-access/enabled
 
-[org.freedesktop.pulseaudio.module:/org/freedesktop/pulseaudio/modules/zeroconf-discover/]
+[org.freedesktop.pulseaudio.module-group:/org/freedesktop/pulseaudio/module-groups/zeroconf-discover/]
 args0 = /system/pulseaudio/modules/zeroconf-discover/args0
 args1 = /system/pulseaudio/modules/zeroconf-discover/args1
 args2 = /system/pulseaudio/modules/zeroconf-discover/args2
@@ -67,7 +67,7 @@ name8 = /system/pulseaudio/modules/zeroconf-discover/name8
 name9 = /system/pulseaudio/modules/zeroconf-discover/name9
 enabled = /system/pulseaudio/modules/zeroconf-discover/enabled
 
-[org.freedesktop.pulseaudio.module:/org/freedesktop/pulseaudio/modules/raop-discover/]
+[org.freedesktop.pulseaudio.module-group:/org/freedesktop/pulseaudio/module-groups/raop-discover/]
 args0 = /system/pulseaudio/modules/raop-discover/args0
 args1 = /system/pulseaudio/modules/raop-discover/args1
 args2 = /system/pulseaudio/modules/raop-discover/args2
@@ -90,7 +90,7 @@ name8 = /system/pulseaudio/modules/raop-discover/name8
 name9 = /system/pulseaudio/modules/raop-discover/name9
 enabled = /system/pulseaudio/modules/raop-discover/enabled
 
-[org.freedesktop.pulseaudio.module:/org/freedesktop/pulseaudio/modules/rtp-recv/]
+[org.freedesktop.pulseaudio.module-group:/org/freedesktop/pulseaudio/module-groups/rtp-recv/]
 args0 = /system/pulseaudio/modules/rtp-recv/args0
 args1 = /system/pulseaudio/modules/rtp-recv/args1
 args2 = /system/pulseaudio/modules/rtp-recv/args2
@@ -113,7 +113,7 @@ name8 = /system/pulseaudio/modules/rtp-recv/name8
 name9 = /system/pulseaudio/modules/rtp-recv/name9
 enabled = /system/pulseaudio/modules/rtp-recv/enabled
 
-[org.freedesktop.pulseaudio.module:/org/freedesktop/pulseaudio/modules/rtp-send/]
+[org.freedesktop.pulseaudio.module-group:/org/freedesktop/pulseaudio/module-groups/rtp-send/]
 args0 = /system/pulseaudio/modules/rtp-send/args0
 args1 = /system/pulseaudio/modules/rtp-send/args1
 args2 = /system/pulseaudio/modules/rtp-send/args2
@@ -136,7 +136,7 @@ name8 = /system/pulseaudio/modules/rtp-send/name8
 name9 = /system/pulseaudio/modules/rtp-send/name9
 enabled = /system/pulseaudio/modules/rtp-send/enabled
 
-[org.freedesktop.pulseaudio.module:/org/freedesktop/pulseaudio/modules/upnp-media-server/]
+[org.freedesktop.pulseaudio.module-group:/org/freedesktop/pulseaudio/module-groups/upnp-media-server/]
 args0 = /system/pulseaudio/modules/upnp-media-server/args0
 args1 = /system/pulseaudio/modules/upnp-media-server/args1
 args2 = /system/pulseaudio/modules/upnp-media-server/args2
-- 
2.16.3



More information about the pulseaudio-discuss mailing list