[nautilus] trash-bar: Use dbus-launcher to open settings



commit 65455ab78fee3ef34da34af03cec2625196b2809
Author: Corey Berla <corey berla me>
Date:   Fri Jun 10 10:08:15 2022 -0700

    trash-bar: Use dbus-launcher to open settings
    
    With the trash-bar the "settings" button opens Settings via
    commandline which doesn't work within a flatpak.  Use dbus-launcher
    to open settings for flatpak integration and stability.

 src/nautilus-trash-bar.c | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)
---
diff --git a/src/nautilus-trash-bar.c b/src/nautilus-trash-bar.c
index 08631f571..558b88557 100644
--- a/src/nautilus-trash-bar.c
+++ b/src/nautilus-trash-bar.c
@@ -25,6 +25,7 @@
 
 #include "nautilus-trash-bar.h"
 
+#include "nautilus-dbus-launcher.h"
 #include "nautilus-global-preferences.h"
 #include "nautilus-files-view.h"
 #include "nautilus-file-operations.h"
@@ -171,23 +172,14 @@ trash_bar_response_cb (GtkInfoBar *infobar,
     {
         case TRASH_BAR_RESPONSE_AUTODELETE:
         {
-            g_autoptr (GAppInfo) app_info = NULL;
-            g_autoptr (GError) error = NULL;
-
-            app_info = g_app_info_create_from_commandline ("gnome-control-center usage",
-                                                           NULL,
-                                                           G_APP_INFO_CREATE_NONE,
-                                                           NULL);
-
-            g_app_info_launch (app_info, NULL, NULL, &error);
-
-            if (error)
-            {
-                show_dialog (_("There was an error launching the application."),
-                             error->message,
-                             GTK_WINDOW (window),
-                             GTK_MESSAGE_ERROR);
-            }
+            GVariant *parameters;
+
+            parameters = g_variant_new_parsed ("('launch-panel', [<('usage', @av [])>], "
+                                               "@a{sv} {})");
+            nautilus_dbus_launcher_call (nautilus_dbus_launcher_get (),
+                                         NAUTILUS_DBUS_LAUNCHER_SETTINGS,
+                                         "Activate",
+                                         parameters, GTK_WINDOW (window));
         }
         break;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]