Mercurial > audlegacy
diff audacious/ui_fileinfo.c @ 2006:beaeb1990cb4 trunk
[svn] - now filepopup can find newly added images immediately.
author | yaz |
---|---|
date | Sat, 25 Nov 2006 00:31:33 -0800 |
parents | f027afc2ca2e |
children | 8feb3d69b5be |
line wrap: on
line diff
--- a/audacious/ui_fileinfo.c Fri Nov 24 09:49:06 2006 -0800 +++ b/audacious/ui_fileinfo.c Sat Nov 25 00:31:33 2006 -0800 @@ -555,10 +555,11 @@ void filepopup_show_for_tuple(TitleInput *tuple) { - gchar *tmp = NULL, *fullpath = NULL; + gchar *tmp = NULL; gint x, y, x_off = 3, y_off = 3, h, w; static gchar *last_artwork = NULL; + const static char default_artwork[] = DATA_DIR "/images/audio.png"; if (tuple == NULL) return; @@ -579,31 +580,25 @@ if (tuple->track_number != 0) filepopup_entry_set_text_free("label_track", g_strdup_printf("%d", tuple->track_number)); - if (cfg.use_file_cover) { - /* Use the file name */ - fullpath = g_strconcat(tuple->file_path, "/", tuple->file_name, NULL); - } else { - fullpath = g_strconcat(tuple->file_path, "/", NULL); - } - - if (!last_artwork || strcmp(last_artwork, fullpath)) - { - if (last_artwork != NULL) + tmp = fileinfo_recursive_get_image(tuple->file_path, tuple->file_name, 0); + if (tmp) { // picture found + if (!last_artwork || strcmp(last_artwork, tmp)) { // new picture + filepopup_entry_set_image("image_artwork", tmp); g_free(last_artwork); - - last_artwork = g_strdup(fullpath); - - tmp = fileinfo_recursive_get_image(tuple->file_path, tuple->file_name, 0); - if (tmp) - { - filepopup_entry_set_image("image_artwork", tmp); - g_free(tmp); - } else { - filepopup_entry_set_image("image_artwork", DATA_DIR "/images/audio.png"); + last_artwork = tmp; + } + else { // same picture } } - - g_free(fullpath); + else { // no picture found + if (!last_artwork || strcmp(last_artwork, default_artwork)) { + filepopup_entry_set_image("image_artwork", default_artwork); + g_free(last_artwork); + last_artwork = g_strdup(default_artwork); + } + else { + } + } gdk_window_get_pointer(NULL, &x, &y, NULL); gtk_window_get_size(GTK_WINDOW(filepopup_win), &w, &h);