Changeset 8003
- Timestamp:
- Mar 3, 2009, 5:58:25 PM (14 years ago)
- Location:
- trunk/gtk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/icons.c
r7999 r8003 4 4 */ 5 5 6 #include <string.h> /* strcmp */ 6 7 #include <glib.h> 7 8 #include <gtk/gtk.h> … … 9 10 10 11 #ifdef HAVE_GIO 11 12 # include <gio/gio.h>12 #include <gio/gio.h> 13 #endif 13 14 14 15 #define VOID_PIXBUF_KEY "void-pixbuf" … … 97 98 } 98 99 100 #ifdef HAVE_GIO 99 101 static const char * 100 102 _icon_cache_get_icon_key( GIcon * icon ) … … 218 220 return pixbuf; 219 221 } 222 223 #else /* HAVE_GIO */ 224 225 static GdkPixbuf * 226 icon_cache_get_mime_type_icon( IconCache * icon_cache, 227 const char * mime_type ) 228 { 229 GdkPixbuf * pixbuf; 230 const char * stock_name; 231 232 if( !strcmp( mime_type, DIRECTORY_MIME_TYPE ) ) 233 stock_name = GTK_STOCK_DIRECTORY; 234 else 235 stock_name = GTK_STOCK_FILE; 236 237 pixbuf = g_hash_table_lookup( icon_cache->cache, stock_name ); 238 239 if( pixbuf != NULL ) 240 { 241 g_object_ref( pixbuf ); 242 return pixbuf; 243 } 244 245 pixbuf = gtk_icon_theme_load_icon( icon_cache->icon_theme, 246 stock_name, 247 icon_cache->icon_size, 248 0, NULL ); 249 g_hash_table_insert( icon_cache->cache, (gpointer) stock_name, g_object_ref( pixbuf )); 250 return pixbuf; 251 } 252 253 #endif 220 254 221 255 … … 245 279 246 280 const char * 247 get_mime_type_from_filename( const char *file ) 248 { 281 get_mime_type_from_filename( const char * file G_GNUC_UNUSED ) 282 { 283 #ifdef HAVE_GIO 249 284 return get_static_string( g_content_type_guess( file, NULL, 0, NULL )); 250 }251 252 285 #else 253 254 GdkPixbuf *255 get_mime_type_icon( const char * mime_type,256 GtkIconSize icon_size,257 GtkWidget * for_widget )258 {259 return NULL;260 }261 262 263 const char *264 get_mime_type_from_filename( const char *file )265 {266 286 return "uncertain"; 267 }268 269 287 #endif 288 } -
trunk/gtk/torrent-cell-renderer.c
r7996 r8003 12 12 13 13 #include "assert.h" 14 #include <string.h> /* strcmp */ 14 15 #include <gtk/gtk.h> 15 16 #include <glib/gi18n.h> … … 365 366 /* cleanup */ 366 367 g_free( status ); 368 g_object_unref( icon ); 367 369 } 368 370 … … 427 429 g_free( status ); 428 430 g_free( progress ); 431 g_object_unref( icon ); 429 432 } 430 433 … … 556 559 /* cleanup */ 557 560 g_free( status ); 561 g_object_unref( icon ); 558 562 } 559 563 … … 664 668 g_free( status ); 665 669 g_free( progress ); 670 g_object_unref( icon ); 666 671 } 667 672
Note: See TracChangeset
for help on using the changeset viewer.