diff options
author | António Fernandes <antoniof@gnome.org> | 2021-08-10 20:32:05 +0100 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2021-08-15 21:21:07 +0100 |
commit | d684d6765385e394880788a93727296b5899fdb6 (patch) | |
tree | ff03d6d9ded45e55c375614e02c62e7d14fbdd42 | |
parent | b5765a9e2745a78ed2d2dd1c6ef7f2713c62a357 (diff) | |
download | nautilus-d684d6765385e394880788a93727296b5899fdb6.tar.gz |
autorun-software: Don't use gtk_window_set_icon()
It's gone in GTK4.
We get an icon from GMount. Assuming it's a GThemedIcon, so we can
simply get its name and use gtk_window_set_icon_name() which is still
going to work in GTK4.
-rw-r--r-- | src/nautilus-autorun-software.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nautilus-autorun-software.c b/src/nautilus-autorun-software.c index f989e3d9a..8c80d4eaf 100644 --- a/src/nautilus-autorun-software.c +++ b/src/nautilus-autorun-software.c @@ -31,8 +31,6 @@ #include <glib/gi18n.h> -#include "nautilus-icon-info.h" - typedef struct { GtkWidget *dialog; @@ -172,8 +170,6 @@ static void present_autorun_for_software_dialog (GMount *mount) { GIcon *icon; - g_autoptr (NautilusIconInfo) icon_info = NULL; - g_autoptr (GdkPixbuf) pixbuf = NULL; g_autofree char *mount_name = NULL; GtkWidget *dialog; AutorunSoftwareDialogData *data; @@ -202,11 +198,15 @@ present_autorun_for_software_dialog (GMount *mount) icon = g_mount_get_icon (mount); - icon_info = nautilus_icon_info_lookup (icon, 48, - gtk_widget_get_scale_factor (GTK_WIDGET (dialog))); - pixbuf = nautilus_icon_info_get_pixbuf_at_size (icon_info, 48); + if (G_IS_THEMED_ICON (icon)) + { + g_autofree gchar *name = NULL; - gtk_window_set_icon (GTK_WINDOW (dialog), pixbuf); + g_object_get (icon, + "name", &name, + NULL); + gtk_window_set_icon_name (GTK_WINDOW (dialog), name); + } data = g_new0 (AutorunSoftwareDialogData, 1); data->dialog = dialog; |