diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-08-15 22:53:05 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-08-15 15:54:34 -0700 |
commit | a01feae15b0c8079478418406936307746d24b48 (patch) | |
tree | 9edaf41dddb9d244e6b62f95238c90e0091b5721 /gtk/gtkfilechoosernativeportal.c | |
parent | b4d4f73d9f6ff98f3cc8f564f95e8a2e1e463577 (diff) | |
download | gtk+-a01feae15b0c8079478418406936307746d24b48.tar.gz |
Use defines for bus names
This helps eradicate typos (we had some here).
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1267
Diffstat (limited to 'gtk/gtkfilechoosernativeportal.c')
-rw-r--r-- | gtk/gtkfilechoosernativeportal.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gtk/gtkfilechoosernativeportal.c b/gtk/gtkfilechoosernativeportal.c index f6d7c4283c..aaaa13a8eb 100644 --- a/gtk/gtkfilechoosernativeportal.c +++ b/gtk/gtkfilechoosernativeportal.c @@ -152,9 +152,9 @@ send_close (FilechooserPortalData *data) GDBusMessage *message; GError *error = NULL; - message = g_dbus_message_new_method_call ("org.freedesktop.portal.Desktop", - "/org/freedesktop/portal/desktop", - "org.freedesktop.portal.FileChooser", + message = g_dbus_message_new_method_call (PORTAL_BUS_NAME, + PORTAL_OBJECT_PATH, + PORTAL_FILECHOOSER_INTERFACE, "Close"); g_dbus_message_set_body (message, g_variant_new ("(o)", data->portal_handle)); @@ -216,8 +216,8 @@ open_file_msg_cb (GObject *source_object, data->portal_response_signal_id = g_dbus_connection_signal_subscribe (data->connection, - "org.freedesktop.portal.Desktop", - "org.freedesktop.portal.Request", + PORTAL_BUS_NAME, + PORTAL_REQUEST_INTERFACE, "Response", data->portal_handle, NULL, @@ -299,9 +299,9 @@ show_portal_file_chooser (GtkFileChooserNative *self, char *sender; int i; - message = g_dbus_message_new_method_call ("org.freedesktop.portal.Desktop", - "/org/freedesktop/portal/desktop", - "org.freedesktop.portal.FileChooser", + message = g_dbus_message_new_method_call (PORTAL_BUS_NAME, + PORTAL_OBJECT_PATH, + PORTAL_FILECHOOSER_INTERFACE, data->method_name); token = g_strdup_printf ("gtk%d", g_random_int_range (0, G_MAXINT)); @@ -310,13 +310,13 @@ show_portal_file_chooser (GtkFileChooserNative *self, if (sender[i] == '.') sender[i] = '_'; - data->portal_handle = g_strdup_printf ("/org/fredesktop/portal/desktop/request/%s/%s", sender, token); + data->portal_handle = g_strconcat (PORTAL_OBJECT_PATH "/request/", sender, "/", token, NULL); g_free (sender); data->portal_response_signal_id = g_dbus_connection_signal_subscribe (data->connection, - "org.freedesktop.portal.Desktop", - "org.freedesktop.portal.Request", + PORTAL_BUS_NAME, + PORTAL_REQUEST_INTERFACE, "Response", data->portal_handle, NULL, |