print portal: use request path utilities
Less code duplication, more cookies!
This commit is contained in:
@@ -561,17 +561,9 @@ call_prepare_print (GtkPrintOperation *op,
|
|||||||
GtkPrintOperationPrivate *priv = op->priv;
|
GtkPrintOperationPrivate *priv = op->priv;
|
||||||
GVariantBuilder opt_builder;
|
GVariantBuilder opt_builder;
|
||||||
char *token;
|
char *token;
|
||||||
char *sender;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
token = g_strdup_printf ("gtk%d", g_random_int_range (0, G_MAXINT));
|
portal->prepare_print_handle =
|
||||||
sender = g_strdup (g_dbus_connection_get_unique_name (g_dbus_proxy_get_connection (portal->proxy)) + 1);
|
gtk_get_portal_request_path (g_dbus_proxy_get_connection (portal->proxy), &token);
|
||||||
for (i = 0; sender[i]; i++)
|
|
||||||
if (sender[i] == '.')
|
|
||||||
sender[i] = '_';
|
|
||||||
|
|
||||||
portal->prepare_print_handle = g_strconcat (PORTAL_OBJECT_PATH "/request/", sender, "/", token, NULL);
|
|
||||||
g_free (sender);
|
|
||||||
|
|
||||||
portal->response_signal_id =
|
portal->response_signal_id =
|
||||||
g_dbus_connection_signal_subscribe (g_dbus_proxy_get_connection (G_DBUS_PROXY (portal->proxy)),
|
g_dbus_connection_signal_subscribe (g_dbus_proxy_get_connection (G_DBUS_PROXY (portal->proxy)),
|
||||||
|
|||||||
Reference in New Issue
Block a user