Skip to content

Replace deprecated gtk_show_uri() method for help window

Compiling GParted on some distros with newer gtk3/gtkmm versions displays warnings similar to the following:

$ make
<-- snip -->
Win_GParted.cc: In member function ‘void GParted::Win_GParted::show_help(const Glib::ustring&, const Glib::ustring&)’:
Win_GParted.cc:1789:21: warning: ‘gboolean gtk_show_uri(GdkScreen*, const gchar*, guint32, GError**)’ is deprecated: Use 'gtk_show_uri_on_window' instead [-Wdeprecated-declarations]
 1789 |         gtk_show_uri(gscreen, uri.c_str(), gtk_get_current_event_time(), &error1);
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtk.h:200,
                 from /usr/include/gtkmm-3.0/gtkmm/enums.h:31,
                 from /usr/include/gtkmm-3.0/gtkmm/widget.h:47,
                 from /usr/include/gtkmm-3.0/gtkmm/misc.h:27,
                 from /usr/include/gtkmm-3.0/gtkmm/label.h:27,
                 from ../include/Utils.h:29,
                 from ../include/Partition.h:26,
                 from ../include/Device.h:21,
                 from ../include/Win_GParted.h:21,
                 from Win_GParted.cc:18:
/usr/include/gtk-3.0/gtk/gtkshow.h:33:10: note: declared here
   33 | gboolean gtk_show_uri  (GdkScreen   *screen,
      |          ^~~~~~~~~~~~
<-- snip -->

The gtk_show_uri() [1] method was deprecated as of gtk3 version 3.22 and has been replaced with gtk_show_uri_on_window [2].

[1] https://developer.gnome.org/gtk3/stable/gtk3-Filesystem-utilities.html#gtk-show-uri

[2] https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html#id-1.6.3.3.7

This patch set will replace the old method with the new method on newer gtk3/gtkmm.

Edited by Curtis Gedak

Merge request reports