[nautilus/wip/antoniof/switch-to-gtk4: 34/40] general: Adapt to gtk_show_uri* API changes
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/switch-to-gtk4: 34/40] general: Adapt to gtk_show_uri* API changes
- Date: Sun, 9 Jan 2022 00:43:49 +0000 (UTC)
commit 2db1d811c80408d480c1f2696f3ca73cdf5cee8c
Author: António Fernandes <antoniof gnome org>
Date: Fri Dec 24 01:05:29 2021 +0000
general: Adapt to gtk_show_uri* API changes
src/nautilus-application.c | 3 +--
src/nautilus-shell-search-provider.c | 12 +++++-------
2 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 87b780819..2c0cc2929 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -764,8 +764,7 @@ action_help (GSimpleAction *action,
GError *error = NULL;
window = gtk_application_get_active_window (application);
- gtk_show_uri_on_window (window, "help:gnome-help/files",
- gtk_get_current_event_time (), &error);
+ gtk_show_uri (window, "help:gnome-help/files", GDK_CURRENT_TIME);
if (error)
{
diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c
index 82850dafc..081896520 100644
--- a/src/nautilus-shell-search-provider.c
+++ b/src/nautilus-shell-search-provider.c
@@ -739,12 +739,13 @@ typedef struct
} ShowURIData;
static void
-show_uri_callback (gboolean res,
- gpointer user_data)
+show_uri_callback (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
ShowURIData *data = user_data;
- if (!res)
+ if (!gtk_show_uri_full_finish (NULL, result, NULL))
{
g_application_open (g_application_get_default (), &data->file, 1, "");
}
@@ -764,16 +765,13 @@ handle_activate_result (NautilusShellSearchProvider2 *skeleton,
gpointer user_data)
{
ShowURIData *data;
- gboolean res;
data = g_new (ShowURIData, 1);
data->file = g_file_new_for_uri (result);
data->skeleton = skeleton;
data->invocation = invocation;
- res = gtk_show_uri_on_window (NULL, result, timestamp, NULL);
-
- show_uri_callback (res, data);
+ gtk_show_uri_full (NULL, result, timestamp, NULL, show_uri_callback, data);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]