[gtk/wip/matthiasc/opbuffer] icon theme: Avoid a string copy
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/opbuffer] icon theme: Avoid a string copy
- Date: Tue, 15 Oct 2019 23:20:51 +0000 (UTC)
commit ea5096914327688056ae696156d6e7e6f19f28cc
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 15 19:20:05 2019 -0400
icon theme: Avoid a string copy
GIO has gained a way to peek at a GFile
path; lets use that.
gtk/gtkicontheme.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index ee7f7c49bb..e44b953017 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3276,17 +3276,16 @@ gtk_icon_info_get_filename (GtkIconInfo *icon_info)
gboolean
gtk_icon_info_is_symbolic (GtkIconInfo *icon_info)
{
- gchar *icon_uri;
+ const char *path;
gboolean is_symbolic;
g_return_val_if_fail (GTK_IS_ICON_INFO (icon_info), FALSE);
- icon_uri = NULL;
+ path = NULL;
if (icon_info->icon_file)
- icon_uri = g_file_get_uri (icon_info->icon_file);
+ path = g_file_peek_path (icon_info->icon_file);
- is_symbolic = (icon_uri != NULL) && (icon_uri_is_symbolic (icon_uri, -1));
- g_free (icon_uri);
+ is_symbolic = (path != NULL) && (icon_uri_is_symbolic (path, -1));
return is_symbolic;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]