ui/gtk/icon.c

changeset 1160
881dfcf46cd6
parent 1016
ccde46662db7
equal deleted inserted replaced
1159:9811e27e0889 1160:881dfcf46cd6
121 #if GTK_MAJOR_VERSION >= 4 121 #if GTK_MAJOR_VERSION >= 4
122 GFile *file = gtk_icon_paintable_get_file(icon->info); 122 GFile *file = gtk_icon_paintable_get_file(icon->info);
123 char *path = g_file_get_path(file); 123 char *path = g_file_get_path(file);
124 if(!path) { 124 if(!path) {
125 icon = ui_icon("application-x-generic", size); 125 icon = ui_icon("application-x-generic", size);
126 } else {
127 g_free(path);
126 } 128 }
127 #else 129 #else
128 if(!icon) { 130 if(!icon) {
129 icon = ui_icon("application-x-generic", size); 131 icon = ui_icon("application-x-generic", size);
130 } 132 }
141 if(!icon->pixbuf) { 143 if(!icon->pixbuf) {
142 GFile *file = gtk_icon_paintable_get_file(icon->info); 144 GFile *file = gtk_icon_paintable_get_file(icon->info);
143 GError *error = NULL; 145 GError *error = NULL;
144 char *path = g_file_get_path(file); 146 char *path = g_file_get_path(file);
145 icon->pixbuf = gdk_pixbuf_new_from_file(path, &error); 147 icon->pixbuf = gdk_pixbuf_new_from_file(path, &error);
148 g_free(path);
146 } 149 }
147 return icon->pixbuf; 150 return icon->pixbuf;
148 } 151 }
149 #else 152 #else
150 GdkPixbuf* ui_icon_pixbuf(UiIcon *icon) { 153 GdkPixbuf* ui_icon_pixbuf(UiIcon *icon) {

mercurial