diff options
author | Corey Berla <corey@berla.me> | 2022-06-10 10:08:15 -0700 |
---|---|---|
committer | António Fernandes <antoniojpfernandes@gmail.com> | 2022-07-14 22:09:29 +0000 |
commit | 65455ab78fee3ef34da34af03cec2625196b2809 (patch) | |
tree | 1bb45d98df91b0f792318cfd193d96e80793933e | |
parent | d219b85d61eeed8ecc8743dfd9fb689894e04e24 (diff) | |
download | nautilus-65455ab78fee3ef34da34af03cec2625196b2809.tar.gz |
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.
-rw-r--r-- | src/nautilus-trash-bar.c | 26 |
1 files 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; |