1908
/* builds a folder/file path and then tests if that file is a valid image.
1909
* returns the file location if it does, NULL if it doesn't */
1911
xfdesktop_check_file_is_valid(const gchar *folder, const gchar *file)
1913
gchar *path = g_strconcat(folder, "/", file, NULL);
1915
if(gdk_pixbuf_get_file_info(path, NULL, NULL) == NULL) {
1924
xfdesktop_load_icon_location_from_folder(XfdesktopFileIcon *icon)
1926
gchar *icon_file = g_file_get_path(xfdesktop_file_icon_peek_file(icon));
1929
g_return_val_if_fail(icon_file, NULL);
1931
/* So much for standards */
1932
path = xfdesktop_check_file_is_valid(icon_file, "Folder.jpg");
1934
path = xfdesktop_check_file_is_valid(icon_file, "folder.jpg");
1937
path = xfdesktop_check_file_is_valid(icon_file, "Folder.JPG");
1940
path = xfdesktop_check_file_is_valid(icon_file, "folder.JPG");
1943
path = xfdesktop_check_file_is_valid(icon_file, "Cover.jpg");
1946
path = xfdesktop_check_file_is_valid(icon_file, "cover.jpg");
1949
path = xfdesktop_check_file_is_valid(icon_file, "albumart.jpg");
1952
path = xfdesktop_check_file_is_valid(icon_file, "fanart.jpg");
1955
path = xfdesktop_check_file_is_valid(icon_file, "Fanart.jpg");
1958
path = xfdesktop_check_file_is_valid(icon_file, "fanart.JPG");
1961
path = xfdesktop_check_file_is_valid(icon_file, "Fanart.JPG");
1964
path = xfdesktop_check_file_is_valid(icon_file, "FANART.JPG");
1967
path = xfdesktop_check_file_is_valid(icon_file, "FANART.jpg");
1972
/* the file *should* already be a thumbnail */
1977
1909
xfdesktop_file_icon_manager_queue_thumbnail(XfdesktopFileIconManager *fmanager,
1978
1910
XfdesktopFileIcon *icon)
1981
GFileInfo *file_info;
1982
gchar *path = NULL, *thumbnail_file = NULL;
1984
1915
file = xfdesktop_file_icon_peek_file(icon);
1985
file_info = xfdesktop_file_icon_peek_file_info(icon);
1987
1917
if(file != NULL)
1988
1918
path = g_file_get_path(file);
1990
1920
if(fmanager->priv->show_thumbnails && path != NULL) {
1991
if(g_file_info_get_file_type(file_info) == G_FILE_TYPE_DIRECTORY) {
1992
/* Try to load a thumbnail from the standard folder image locations */
1993
thumbnail_file = xfdesktop_load_icon_location_from_folder(icon);
1995
if(thumbnail_file) {
1996
GFile *temp = g_file_new_for_path(thumbnail_file);
1997
xfdesktop_icon_set_thumbnail_file(XFDESKTOP_ICON(icon), temp);
2000
g_free(thumbnail_file);
2002
xfdesktop_thumbnailer_queue_thumbnail(fmanager->priv->thumbnailer,
1921
xfdesktop_thumbnailer_queue_thumbnail(fmanager->priv->thumbnailer, path);
2208
2125
/* should never return NULL */
2209
icon = xfdesktop_regular_file_icon_new(file, info, fmanager->priv->gscreen);
2126
icon = xfdesktop_regular_file_icon_new(file, info, fmanager->priv->gscreen, fmanager);
2211
2128
xfdesktop_file_icon_manager_add_icon(fmanager,
2212
2129
XFDESKTOP_FILE_ICON(icon),
2736
2653
* send notification messages when monitored files change */
2737
2654
if(!fmanager->priv->metadata_monitor) {
2738
2655
gchar *location = xfce_resource_lookup(XFCE_RESOURCE_DATA, "gvfs-metadata/");
2739
GFile *metadata_location = g_file_new_for_path(location);
2656
GFile *metadata_location;
2658
if(location == NULL)
2661
metadata_location = g_file_new_for_path(location);
2741
2663
fmanager->priv->metadata_monitor = g_file_monitor(metadata_location,
2742
2664
G_FILE_MONITOR_NONE,