[pulseaudio-discuss] [paprefs][PATCH 8/9] run gsettings-data-convert unconditionally

Tanu Kaskinen tanuk at iki.fi
Tue Apr 17 06:25:47 UTC 2018


We don't need to read the gsettings-data-convert state file ourselves to
skip the conversion, the program does it by itself.
---
 src/paprefs.cc | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/src/paprefs.cc b/src/paprefs.cc
index 39f3706..c3c15ed 100644
--- a/src/paprefs.cc
+++ b/src/paprefs.cc
@@ -750,21 +750,10 @@ void MainWindow::checkForPackageKit() {
 }
 
 void MainWindow::ensureMigrated() {
-    Glib::KeyFile kf;
-    std::string keypath;
-    std::vector<std::string> list;
-
-    try {
-        kf.load_from_data_dirs("gsettings-data-convert",
-                               keypath, Glib::KEY_FILE_NONE);
-        list = kf.get_string_list("State", "converted");
-    } catch(Glib::KeyFileError) {}
-
-    if (std::find(list.begin(), list.end(), "paprefs.convert") == list.end()) {
-        Glib::spawn_command_line_sync("gsettings-data-convert",
-                                      NULL, NULL, NULL);
-
-    }
+    /* gsettings-data-convert copies data from GConf to GSettings. It will do
+     * that only once, so running the command every time paprefs starts is
+     * safe. */
+    Glib::spawn_command_line_sync("gsettings-data-convert", NULL, NULL, NULL);
 }
 
 int main(int argc, char *argv[]) {
-- 
2.16.3



More information about the pulseaudio-discuss mailing list