From 00bdad23b0fe032d5ea579cbc4227b3959944d71 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 9 Dec 2022 11:11:04 -0500 Subject: [PATCH] Deprecate gtk_show_uri This API has been superseded by GtkFileLauncher. --- gtk/{ => deprecated}/gtkshow.c | 8 ++++++++ gtk/{ => deprecated}/gtkshow.h | 6 +++--- gtk/deprecated/meson.build | 2 ++ gtk/gtk.h | 2 +- gtk/meson.build | 2 -- po/POTFILES.in | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) rename gtk/{ => deprecated}/gtkshow.c (96%) rename gtk/{ => deprecated}/gtkshow.h (91%) diff --git a/gtk/gtkshow.c b/gtk/deprecated/gtkshow.c similarity index 96% rename from gtk/gtkshow.c rename to gtk/deprecated/gtkshow.c index 15c4ee1b11..ff57a27550 100644 --- a/gtk/gtkshow.c +++ b/gtk/deprecated/gtkshow.c @@ -27,6 +27,8 @@ #include "gtkalertdialog.h" #include +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + typedef struct { GtkWindow *parent; GAppLaunchContext *context; @@ -96,6 +98,8 @@ window_handle_exported (GtkWindow *window, * * This is the recommended call to be used as it passes information * necessary for sandbox helpers to parent their dialogs properly. + * + * Deprecated: 4.10: Use [method@Gtk.FileLauncher.launch] instead */ void gtk_show_uri_full (GtkWindow *parent, @@ -142,6 +146,8 @@ gtk_show_uri_full (GtkWindow *parent, * * Returns: %TRUE if the URI was shown successfully. * Otherwise, %FALSE is returned and @error is set + * + * Deprecated: 4.10: Use [method@Gtk.FileLauncher.launch_finish] instead */ gboolean gtk_show_uri_full_finish (GtkWindow *parent, @@ -184,6 +190,8 @@ show_uri_done (GObject *object, * * This function launches the default application for showing * a given uri, or shows an error dialog if that fails. + * + * Deprecated: 4.10: Use [method@Gtk.FileLauncher.launch] instead */ void gtk_show_uri (GtkWindow *parent, diff --git a/gtk/gtkshow.h b/gtk/deprecated/gtkshow.h similarity index 91% rename from gtk/gtkshow.h rename to gtk/deprecated/gtkshow.h index 0c5cea6fba..6915be0b11 100644 --- a/gtk/gtkshow.h +++ b/gtk/deprecated/gtkshow.h @@ -29,7 +29,7 @@ G_BEGIN_DECLS -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_10_FOR(gtk_file_launcher_launch) void gtk_show_uri_full (GtkWindow *parent, const char *uri, guint32 timestamp, @@ -37,12 +37,12 @@ void gtk_show_uri_full (GtkWindow *parent, GAsyncReadyCallback callback, gpointer user_data); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_10_FOR(gtk_file_launcher_launch) gboolean gtk_show_uri_full_finish (GtkWindow *parent, GAsyncResult *result, GError **error); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_10_FOR(gtk_file_launcher_launch) void gtk_show_uri (GtkWindow *parent, const char *uri, guint32 timestamp); diff --git a/gtk/deprecated/meson.build b/gtk/deprecated/meson.build index 600934b02d..dd6c8ade9d 100644 --- a/gtk/deprecated/meson.build +++ b/gtk/deprecated/meson.build @@ -32,6 +32,7 @@ gtk_deprecated_sources = [ 'deprecated/gtkinfobar.c', 'deprecated/gtkliststore.c', 'deprecated/gtkrender.c', + 'deprecated/gtkshow.c', 'deprecated/gtkstylecontext.c', 'deprecated/gtktreedatalist.c', 'deprecated/gtktreednd.c', @@ -88,6 +89,7 @@ gtk_deprecated_headers = [ 'deprecated/gtkliststore.h', 'deprecated/gtkmessagedialog.h', 'deprecated/gtkrender.h', + 'deprecated/gtkshow.h', 'deprecated/gtkstylecontext.h', 'deprecated/gtktreednd.h', 'deprecated/gtktreemodel.h', diff --git a/gtk/gtk.h b/gtk/gtk.h index 2dc593b889..e07a3f6605 100644 --- a/gtk/gtk.h +++ b/gtk/gtk.h @@ -238,7 +238,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/gtk/meson.build b/gtk/meson.build index cc25065f22..2cb16d6710 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -346,7 +346,6 @@ gtk_public_sources = files([ 'gtkshortcutsshortcut.c', 'gtkshortcutswindow.c', 'gtkshortcuttrigger.c', - 'gtkshow.c', 'gtksidebarrow.c', 'gtksignallistitemfactory.c', 'gtksingleselection.c', @@ -580,7 +579,6 @@ gtk_public_headers = files([ 'gtkshortcutsshortcut.h', 'gtkshortcutswindow.h', 'gtkshortcuttrigger.h', - 'gtkshow.h', 'gtksignallistitemfactory.h', 'gtksingleselection.h', 'gtksizegroup.h', diff --git a/po/POTFILES.in b/po/POTFILES.in index 88fef68569..338e1a9c52 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -88,6 +88,7 @@ gtk/deprecated/gtkfontbutton.c gtk/deprecated/gtkfontchooser.c gtk/deprecated/gtkiconview.c gtk/deprecated/gtkliststore.c +gtk/deprecated/gtkshow.c gtk/deprecated/gtkstylecontext.c gtk/deprecated/gtktreednd.c gtk/deprecated/gtktreemodel.c @@ -299,7 +300,6 @@ gtk/gtkshortcutssection.c gtk/gtkshortcutsshortcut.c gtk/gtkshortcutswindow.c gtk/gtkshortcuttrigger.c -gtk/gtkshow.c gtk/gtksidebarrow.c gtk/gtksignallistitemfactory.c gtk/gtksingleselection.c -- 2.30.2