summaryrefslogtreecommitdiff
path: root/gtk/gtkaboutdialog.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2017-01-22 22:58:45 +0100
committerMatthias Clasen <mclasen@redhat.com>2017-11-15 14:22:17 -0500
commit049cc6aa013601c4e662c38df408f8956b155f0a (patch)
tree4f8359363a1b005790b6d8cbc7d7f590fa859ee7 /gtk/gtkaboutdialog.c
parentf53b72e5ffc034f003801b9d4ee64328180bc297 (diff)
downloadgtk+-049cc6aa013601c4e662c38df408f8956b155f0a.tar.gz
image: Change getters
Instead of returning the icon size with them, make gtk_image_get_icon_name() and gtk_image_get_gicon() only return the icon itself. As a benefit, we can turn them into regular getters that return values instead of requiring out parameters. Instead, provide gtk_image_get_icon_size() to query the icon size.
Diffstat (limited to 'gtk/gtkaboutdialog.c')
-rw-r--r--gtk/gtkaboutdialog.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index 56c0c17e77..bfab623f2a 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -961,12 +961,7 @@ gtk_about_dialog_get_property (GObject *object,
break;
case PROP_LOGO_ICON_NAME:
if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) == GTK_IMAGE_ICON_NAME)
- {
- const gchar *icon_name;
-
- gtk_image_get_icon_name (GTK_IMAGE (priv->logo_image), &icon_name, NULL);
- g_value_set_string (value, icon_name);
- }
+ g_value_set_string (value, gtk_image_get_icon_name (GTK_IMAGE (priv->logo_image)));
else
g_value_set_string (value, NULL);
break;
@@ -1862,16 +1857,15 @@ const gchar *
gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about)
{
GtkAboutDialogPrivate *priv;
- const gchar *icon_name = NULL;
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
priv = about->priv;
- if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) == GTK_IMAGE_ICON_NAME)
- gtk_image_get_icon_name (GTK_IMAGE (priv->logo_image), &icon_name, NULL);
+ if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) != GTK_IMAGE_ICON_NAME)
+ return NULL;
- return icon_name;
+ return gtk_image_get_icon_name (GTK_IMAGE (priv->logo_image));
}
/**