2
* C Implementation: ptk-file-list
7
* Author: Hong Jen Yee (PCMan) <pcman.tw (AT) gmail.com>, (C) 2006
9
* Copyright: See COPYING file that comes with this distribution
13
#include "ptk-file-list.h"
17
#include "vfs-file-info.h"
18
#include "vfs-thumbnail-loader.h"
22
static void ptk_file_list_init ( PtkFileList *list );
24
static void ptk_file_list_class_init ( PtkFileListClass *klass );
26
static void ptk_file_list_tree_model_init ( GtkTreeModelIface *iface );
28
static void ptk_file_list_tree_sortable_init ( GtkTreeSortableIface *iface );
30
static void ptk_file_list_drag_source_init ( GtkTreeDragSourceIface *iface );
32
static void ptk_file_list_drag_dest_init ( GtkTreeDragDestIface *iface );
34
static void ptk_file_list_finalize ( GObject *object );
36
static GtkTreeModelFlags ptk_file_list_get_flags ( GtkTreeModel *tree_model );
38
static gint ptk_file_list_get_n_columns ( GtkTreeModel *tree_model );
40
static GType ptk_file_list_get_column_type ( GtkTreeModel *tree_model,
43
static gboolean ptk_file_list_get_iter ( GtkTreeModel *tree_model,
47
static GtkTreePath *ptk_file_list_get_path ( GtkTreeModel *tree_model,
50
static void ptk_file_list_get_value ( GtkTreeModel *tree_model,
55
static gboolean ptk_file_list_iter_next ( GtkTreeModel *tree_model,
58
static gboolean ptk_file_list_iter_children ( GtkTreeModel *tree_model,
60
GtkTreeIter *parent );
62
static gboolean ptk_file_list_iter_has_child ( GtkTreeModel *tree_model,
65
static gint ptk_file_list_iter_n_children ( GtkTreeModel *tree_model,
68
static gboolean ptk_file_list_iter_nth_child ( GtkTreeModel *tree_model,
73
static gboolean ptk_file_list_iter_parent ( GtkTreeModel *tree_model,
77
static gboolean ptk_file_list_get_sort_column_id( GtkTreeSortable* sortable,
81
static void ptk_file_list_set_sort_column_id( GtkTreeSortable* sortable,
85
static void ptk_file_list_set_sort_func( GtkTreeSortable *sortable,
87
GtkTreeIterCompareFunc sort_func,
89
GtkDestroyNotify destroy );
91
static void ptk_file_list_set_default_sort_func( GtkTreeSortable *sortable,
92
GtkTreeIterCompareFunc sort_func,
94
GtkDestroyNotify destroy );
96
static void ptk_file_list_sort ( PtkFileList* list );
100
static void on_thumbnail_loaded( VFSDir* dir, VFSFileInfo* file, PtkFileList* list );
103
* already declared in ptk-file-list.h
104
void ptk_file_list_file_created( VFSDir* dir, VFSFileInfo* file,
107
void ptk_file_list_file_deleted( VFSDir* dir, VFSFileInfo* file,
110
void ptk_file_list_file_changed( VFSDir* dir, VFSFileInfo* file,
114
static GObjectClass* parent_class = NULL;
116
static GType column_types[ N_FILE_LIST_COLS ];
118
GType ptk_file_list_get_type ( void )
120
static GType type = 0;
121
if ( G_UNLIKELY( !type ) )
123
static const GTypeInfo type_info =
125
sizeof ( PtkFileListClass ),
126
NULL, /* base_init */
127
NULL, /* base_finalize */
128
( GClassInitFunc ) ptk_file_list_class_init,
129
NULL, /* class finalize */
130
NULL, /* class_data */
131
sizeof ( PtkFileList ),
133
( GInstanceInitFunc ) ptk_file_list_init
136
static const GInterfaceInfo tree_model_info =
138
( GInterfaceInitFunc ) ptk_file_list_tree_model_init,
143
static const GInterfaceInfo tree_sortable_info =
145
( GInterfaceInitFunc ) ptk_file_list_tree_sortable_init,
150
static const GInterfaceInfo drag_src_info =
152
( GInterfaceInitFunc ) ptk_file_list_drag_source_init,
157
static const GInterfaceInfo drag_dest_info =
159
( GInterfaceInitFunc ) ptk_file_list_drag_dest_init,
164
type = g_type_register_static ( G_TYPE_OBJECT, "PtkFileList",
165
&type_info, ( GTypeFlags ) 0 );
166
g_type_add_interface_static ( type, GTK_TYPE_TREE_MODEL, &tree_model_info );
167
g_type_add_interface_static ( type, GTK_TYPE_TREE_SORTABLE, &tree_sortable_info );
168
g_type_add_interface_static ( type, GTK_TYPE_TREE_DRAG_SOURCE, &drag_src_info );
169
g_type_add_interface_static ( type, GTK_TYPE_TREE_DRAG_DEST, &drag_dest_info );
174
void ptk_file_list_init ( PtkFileList *list )
178
list->sort_order = -1;
180
/* Random int to check whether an iter belongs to our model */
181
list->stamp = g_random_int();
184
void ptk_file_list_class_init ( PtkFileListClass *klass )
186
GObjectClass * object_class;
188
parent_class = ( GObjectClass* ) g_type_class_peek_parent ( klass );
189
object_class = ( GObjectClass* ) klass;
191
object_class->finalize = ptk_file_list_finalize;
194
void ptk_file_list_tree_model_init ( GtkTreeModelIface *iface )
196
iface->get_flags = ptk_file_list_get_flags;
197
iface->get_n_columns = ptk_file_list_get_n_columns;
198
iface->get_column_type = ptk_file_list_get_column_type;
199
iface->get_iter = ptk_file_list_get_iter;
200
iface->get_path = ptk_file_list_get_path;
201
iface->get_value = ptk_file_list_get_value;
202
iface->iter_next = ptk_file_list_iter_next;
203
iface->iter_children = ptk_file_list_iter_children;
204
iface->iter_has_child = ptk_file_list_iter_has_child;
205
iface->iter_n_children = ptk_file_list_iter_n_children;
206
iface->iter_nth_child = ptk_file_list_iter_nth_child;
207
iface->iter_parent = ptk_file_list_iter_parent;
209
column_types [ COL_FILE_BIG_ICON ] = GDK_TYPE_PIXBUF;
210
column_types [ COL_FILE_SMALL_ICON ] = GDK_TYPE_PIXBUF;
211
column_types [ COL_FILE_NAME ] = G_TYPE_STRING;
212
column_types [ COL_FILE_DESC ] = G_TYPE_STRING;
213
column_types [ COL_FILE_SIZE ] = G_TYPE_STRING;
214
column_types [ COL_FILE_DESC ] = G_TYPE_STRING;
215
column_types [ COL_FILE_PERM ] = G_TYPE_STRING;
216
column_types [ COL_FILE_OWNER ] = G_TYPE_STRING;
217
column_types [ COL_FILE_MTIME ] = G_TYPE_STRING;
218
column_types [ COL_FILE_INFO ] = G_TYPE_POINTER;
221
void ptk_file_list_tree_sortable_init ( GtkTreeSortableIface *iface )
223
/* iface->sort_column_changed = ptk_file_list_sort_column_changed; */
224
iface->get_sort_column_id = ptk_file_list_get_sort_column_id;
225
iface->set_sort_column_id = ptk_file_list_set_sort_column_id;
226
iface->set_sort_func = ptk_file_list_set_sort_func;
227
iface->set_default_sort_func = ptk_file_list_set_default_sort_func;
228
iface->has_default_sort_func = (gboolean(*)(GtkTreeSortable *))gtk_false;
231
void ptk_file_list_drag_source_init ( GtkTreeDragSourceIface *iface )
233
/* FIXME: Unused. Will this cause any problem? */
236
void ptk_file_list_drag_dest_init ( GtkTreeDragDestIface *iface )
238
/* FIXME: Unused. Will this cause any problem? */
241
void ptk_file_list_finalize ( GObject *object )
243
PtkFileList *list = ( PtkFileList* ) object;
245
ptk_file_list_set_dir( list, NULL );
246
/* must chain up - finalize parent */
247
( * parent_class->finalize ) ( object );
250
PtkFileList *ptk_file_list_new ( VFSDir* dir, gboolean show_hidden )
253
list = ( PtkFileList* ) g_object_new ( PTK_TYPE_FILE_LIST, NULL );
254
list->show_hidden = show_hidden;
255
ptk_file_list_set_dir( list, dir );
259
static void _ptk_file_list_file_changed( VFSDir* dir, VFSFileInfo* file,
262
ptk_file_list_file_changed( dir, file, list );
264
/* check if reloading of thumbnail is needed. */
265
if( vfs_file_info_is_image( file )
266
&& vfs_file_info_get_size( file ) < list->max_thumbnail )
268
if( ! vfs_file_info_is_thumbnail_loaded( file, list->big_thumbnail ) )
269
vfs_thumbnail_loader_request( list->dir, file, list->big_thumbnail );
273
static void _ptk_file_list_file_created( VFSDir* dir, VFSFileInfo* file,
276
ptk_file_list_file_created( dir, file, list );
278
/* check if reloading of thumbnail is needed. */
279
if( vfs_file_info_is_image( file )
280
&& vfs_file_info_get_size( file ) < list->max_thumbnail )
282
if( ! vfs_file_info_is_thumbnail_loaded( file, list->big_thumbnail ) )
283
vfs_thumbnail_loader_request( list->dir, file, list->big_thumbnail );
287
void ptk_file_list_set_dir( PtkFileList* list, VFSDir* dir )
291
if( list->dir == dir )
296
if( list->max_thumbnail > 0 )
298
/* cancel all possible pending requests */
299
vfs_thumbnail_loader_cancel_all_requests( list->dir, list->big_thumbnail );
301
g_list_foreach( list->files, (GFunc)vfs_file_info_unref, NULL );
302
g_list_free( list->files );
303
g_signal_handlers_disconnect_by_func( list->dir,
304
_ptk_file_list_file_created, list );
305
g_signal_handlers_disconnect_by_func( list->dir,
306
ptk_file_list_file_deleted, list );
307
g_signal_handlers_disconnect_by_func( list->dir,
308
_ptk_file_list_file_changed, list );
309
g_signal_handlers_disconnect_by_func( list->dir,
310
on_thumbnail_loaded, list );
311
g_object_unref( list->dir );
320
g_object_ref( list->dir );
322
g_signal_connect( list->dir, "file-created",
323
G_CALLBACK(_ptk_file_list_file_created),
325
g_signal_connect( list->dir, "file-deleted",
326
G_CALLBACK(ptk_file_list_file_deleted),
328
g_signal_connect( list->dir, "file-changed",
329
G_CALLBACK(_ptk_file_list_file_changed),
332
if( dir && dir->file_list )
334
for( l = dir->file_list; l; l = l->next )
336
if( list->show_hidden ||
337
((VFSFileInfo*)l->data)->disp_name[0] != '.' )
339
list->files = g_list_prepend( list->files, vfs_file_info_ref( (VFSFileInfo*)l->data) );
346
GtkTreeModelFlags ptk_file_list_get_flags ( GtkTreeModel *tree_model )
348
g_return_val_if_fail ( PTK_IS_FILE_LIST( tree_model ), ( GtkTreeModelFlags ) 0 );
349
return ( GTK_TREE_MODEL_LIST_ONLY | GTK_TREE_MODEL_ITERS_PERSIST );
352
gint ptk_file_list_get_n_columns ( GtkTreeModel *tree_model )
354
return N_FILE_LIST_COLS;
357
GType ptk_file_list_get_column_type ( GtkTreeModel *tree_model,
360
g_return_val_if_fail ( PTK_IS_FILE_LIST( tree_model ), G_TYPE_INVALID );
361
g_return_val_if_fail ( index < G_N_ELEMENTS( column_types ) && index >= 0, G_TYPE_INVALID );
362
return column_types[ index ];
365
gboolean ptk_file_list_get_iter ( GtkTreeModel *tree_model,
370
gint *indices, n, depth;
373
g_assert(PTK_IS_FILE_LIST(tree_model));
374
g_assert(path!=NULL);
376
list = PTK_FILE_LIST(tree_model);
378
indices = gtk_tree_path_get_indices(path);
379
depth = gtk_tree_path_get_depth(path);
381
/* we do not allow children */
382
g_assert(depth == 1); /* depth 1 = top level; a list only has top level nodes and no children */
384
n = indices[0]; /* the n-th top level row */
386
if ( n >= list->n_files || n < 0 )
389
l = g_list_nth( list->files, n );
393
/* We simply store a pointer in the iter */
394
iter->stamp = list->stamp;
396
iter->user_data2 = l->data;
397
iter->user_data3 = NULL; /* unused */
402
GtkTreePath *ptk_file_list_get_path ( GtkTreeModel *tree_model,
407
PtkFileList* list = PTK_FILE_LIST(tree_model);
409
g_return_val_if_fail (list, NULL);
410
g_return_val_if_fail (iter->stamp == list->stamp, NULL);
411
g_return_val_if_fail (iter != NULL, NULL);
412
g_return_val_if_fail (iter->user_data != NULL, NULL);
414
l = (GList*) iter->user_data;
416
path = gtk_tree_path_new();
417
gtk_tree_path_append_index(path, g_list_index(list->files, l->data) );
421
void ptk_file_list_get_value ( GtkTreeModel *tree_model,
427
PtkFileList* list = PTK_FILE_LIST(tree_model);
431
g_return_if_fail (PTK_IS_FILE_LIST (tree_model));
432
g_return_if_fail (iter != NULL);
433
g_return_if_fail (column < G_N_ELEMENTS(column_types) );
435
g_value_init (value, column_types[column] );
437
l = (GList*) iter->user_data;
438
g_return_if_fail ( l != NULL );
440
info = (VFSFileInfo*)iter->user_data2;
444
case COL_FILE_BIG_ICON:
446
/* special file can use special icons saved as thumbnails*/
447
if( list->max_thumbnail > vfs_file_info_get_size( info )
448
&& info->flags == VFS_FILE_INFO_NONE )
449
icon = vfs_file_info_get_big_thumbnail( info );
452
icon = vfs_file_info_get_big_icon( info );
455
g_value_set_object( value, icon );
456
gdk_pixbuf_unref( icon );
459
case COL_FILE_SMALL_ICON:
461
/* special file can use special icons saved as thumbnails*/
462
if( list->max_thumbnail > vfs_file_info_get_size( info ) )
463
icon = vfs_file_info_get_small_thumbnail( info );
465
icon = vfs_file_info_get_small_icon( info );
468
g_value_set_object( value, icon );
469
gdk_pixbuf_unref( icon );
473
g_value_set_string( value, vfs_file_info_get_disp_name(info) );
476
g_value_set_string( value, vfs_file_info_get_disp_size(info) );
479
g_value_set_string( value, vfs_file_info_get_mime_type_desc( info ) );
482
g_value_set_string( value, vfs_file_info_get_disp_perm(info) );
485
g_value_set_string( value, vfs_file_info_get_disp_owner(info) );
488
g_value_set_string( value, vfs_file_info_get_disp_mtime(info) );
491
g_value_set_pointer( value, vfs_file_info_ref( info ) );
496
gboolean ptk_file_list_iter_next ( GtkTreeModel *tree_model,
502
g_return_val_if_fail (PTK_IS_FILE_LIST (tree_model), FALSE);
504
if (iter == NULL || iter->user_data == NULL)
507
list = PTK_FILE_LIST(tree_model);
508
l = (GList *) iter->user_data;
510
/* Is this the last l in the list? */
514
iter->stamp = list->stamp;
515
iter->user_data = l->next;
516
iter->user_data2 = l->next->data;
521
gboolean ptk_file_list_iter_children ( GtkTreeModel *tree_model,
523
GtkTreeIter *parent )
526
g_return_val_if_fail ( parent == NULL || parent->user_data != NULL, FALSE );
528
/* this is a list, nodes have no children */
532
/* parent == NULL is a special case; we need to return the first top-level row */
533
g_return_val_if_fail ( PTK_IS_FILE_LIST ( tree_model ), FALSE );
534
list = PTK_FILE_LIST( tree_model );
536
/* No rows => no first row */
537
if ( list->dir->n_files == 0 )
540
/* Set iter to first item in list */
541
iter->stamp = list->stamp;
542
iter->user_data = list->files;
543
iter->user_data2 = list->files->data;
547
gboolean ptk_file_list_iter_has_child ( GtkTreeModel *tree_model,
553
gint ptk_file_list_iter_n_children ( GtkTreeModel *tree_model,
557
g_return_val_if_fail ( PTK_IS_FILE_LIST ( tree_model ), -1 );
558
g_return_val_if_fail ( iter == NULL || iter->user_data != NULL, FALSE );
559
list = PTK_FILE_LIST( tree_model );
560
/* special case: if iter == NULL, return number of top-level rows */
562
return list->n_files;
563
return 0; /* otherwise, this is easy again for a list */
566
gboolean ptk_file_list_iter_nth_child ( GtkTreeModel *tree_model,
574
g_return_val_if_fail (PTK_IS_FILE_LIST (tree_model), FALSE);
575
list = PTK_FILE_LIST(tree_model);
577
/* a list has only top-level rows */
581
/* special case: if parent == NULL, set iter to n-th top-level row */
582
if( n >= list->n_files || n < 0 )
585
l = g_list_nth( list->files, n );
586
g_assert( l != NULL );
588
iter->stamp = list->stamp;
590
iter->user_data2 = l->data;
595
gboolean ptk_file_list_iter_parent ( GtkTreeModel *tree_model,
602
gboolean ptk_file_list_get_sort_column_id( GtkTreeSortable* sortable,
603
gint* sort_column_id,
606
PtkFileList* list = (PtkFileList*)sortable;
608
*sort_column_id = list->sort_col;
610
*order = list->sort_order;
614
void ptk_file_list_set_sort_column_id( GtkTreeSortable* sortable,
618
PtkFileList* list = (PtkFileList*)sortable;
619
if( list->sort_col == sort_column_id && list->sort_order == order )
621
list->sort_col = sort_column_id;
622
list->sort_order = order;
623
gtk_tree_sortable_sort_column_changed (sortable);
624
ptk_file_list_sort (list);
627
void ptk_file_list_set_sort_func( GtkTreeSortable *sortable,
629
GtkTreeIterCompareFunc sort_func,
631
GtkDestroyNotify destroy )
633
g_warning( "ptk_file_list_set_sort_func: Not supported\n" );
636
void ptk_file_list_set_default_sort_func( GtkTreeSortable *sortable,
637
GtkTreeIterCompareFunc sort_func,
639
GtkDestroyNotify destroy )
641
g_warning( "ptk_file_list_set_default_sort_func: Not supported\n" );
644
static gint ptk_file_list_compare( gconstpointer a,
648
VFSFileInfo* file1 = (VFSFileInfo*)a;
649
VFSFileInfo* file2 = (VFSFileInfo*)b;
650
PtkFileList* list = (PtkFileList*)user_data;
652
/* put folders before files */
653
ret = vfs_file_info_is_dir(file1) - vfs_file_info_is_dir(file2);
657
/* FIXME: strings should not be treated as ASCII when sorted */
658
switch( list->sort_col )
661
ret = g_ascii_strcasecmp( vfs_file_info_get_disp_name(file1),
662
vfs_file_info_get_disp_name(file2) );
665
ret = file1->size - file2->size;
668
ret = g_ascii_strcasecmp( vfs_file_info_get_mime_type_desc(file1),
669
vfs_file_info_get_mime_type_desc(file2) );
672
ret = g_ascii_strcasecmp( vfs_file_info_get_disp_perm(file1),
673
vfs_file_info_get_disp_perm(file2) );
676
ret = g_ascii_strcasecmp( vfs_file_info_get_disp_owner(file1),
677
vfs_file_info_get_disp_owner(file2) );
680
ret = file1->mtime - file2->mtime;
683
return list->sort_order == GTK_SORT_ASCENDING ? ret : -ret;
686
void ptk_file_list_sort ( PtkFileList* list )
688
GHashTable* old_order;
694
if( list->n_files <=1 )
697
old_order = g_hash_table_new( g_direct_hash, g_direct_equal );
699
for( i = 0, l = list->files; l; l = l->next, ++i )
700
g_hash_table_insert( old_order, l, GINT_TO_POINTER(i) );
703
list->files = g_list_sort_with_data( list->files,
704
ptk_file_list_compare, list );
707
new_order = g_new( int, list->n_files );
708
for( i = 0, l = list->files; l; l = l->next, ++i )
709
new_order[i] = (guint)g_hash_table_lookup( old_order, l );
710
g_hash_table_destroy( old_order );
711
path = gtk_tree_path_new ();
712
gtk_tree_model_rows_reordered (GTK_TREE_MODEL (list),
713
path, NULL, new_order);
714
gtk_tree_path_free (path);
718
gboolean ptk_file_list_find_iter( PtkFileList* list, GtkTreeIter* it, VFSFileInfo* fi )
721
for( l = list->files; l; l = l->next )
723
VFSFileInfo* fi2 = (VFSFileInfo*)l->data;
724
if( G_UNLIKELY( fi2 == fi
725
|| 0 == strcmp( vfs_file_info_get_name(fi), vfs_file_info_get_name(fi2) ) ) )
727
it->stamp = list->stamp;
729
it->user_data2 = fi2;
736
void ptk_file_list_file_created( VFSDir* dir,
745
if( ! list->show_hidden && vfs_file_info_get_name(file)[0] == '.' )
748
for( l = list->files; l; l = l->next )
750
file2 = (VFSFileInfo*)l->data;
751
if( G_UNLIKELY( file == file2 || ptk_file_list_compare( file2, file, list ) == 0 ) )
753
/* The file is already in the list */
756
if( ptk_file_list_compare( file2, file, list ) > 0 )
762
list->files = g_list_insert_before( list->files, l, vfs_file_info_ref( file ) );
768
l = g_list_last( list->files );
770
it.stamp = list->stamp;
772
it.user_data2 = file;
774
path = gtk_tree_path_new_from_indices( g_list_index(list->files, l->data), -1 );
776
gtk_tree_model_row_inserted( GTK_TREE_MODEL(list), path, &it );
778
gtk_tree_path_free( path );
781
void ptk_file_list_file_deleted( VFSDir* dir,
788
/* If there is no file info, that means the dir itself was deleted. */
789
if( G_UNLIKELY( ! file ) )
791
/* Clear the whole list */
792
path = gtk_tree_path_new_from_indices(0, -1);
793
for( l = list->files; l; l = list->files )
795
gtk_tree_model_row_deleted( GTK_TREE_MODEL(list), path );
796
file = (VFSFileInfo*)l->data;
797
list->files = g_list_delete_link( list->files, l );
798
vfs_file_info_unref( file );
801
gtk_tree_path_free( path );
805
if( ! list->show_hidden && vfs_file_info_get_name(file)[0] == '.' )
808
l = g_list_find( list->files, file );
812
path = gtk_tree_path_new_from_indices( g_list_index(list->files, l->data), -1 );
814
gtk_tree_model_row_deleted( GTK_TREE_MODEL(list), path );
816
gtk_tree_path_free( path );
818
list->files = g_list_delete_link( list->files, l );
819
vfs_file_info_unref( file );
823
void ptk_file_list_file_changed( VFSDir* dir,
831
if( ! list->show_hidden && vfs_file_info_get_name(file)[0] == '.' )
833
l = g_list_find( list->files, file );
838
it.stamp = list->stamp;
840
it.user_data2 = l->data;
842
path = gtk_tree_path_new_from_indices( g_list_index(list->files, l->data), -1 );
844
gtk_tree_model_row_changed( GTK_TREE_MODEL(list), path, &it );
846
gtk_tree_path_free( path );
849
void on_thumbnail_loaded( VFSDir* dir, VFSFileInfo* file, PtkFileList* list )
851
/* g_debug( "LOADED: %s", file->name ); */
852
ptk_file_list_file_changed( dir, file, list );
855
void ptk_file_list_show_thumbnails( PtkFileList* list, gboolean is_big,
860
int old_max_thumbnail;
862
old_max_thumbnail = list->max_thumbnail;
863
list->max_thumbnail = max_file_size;
864
list->big_thumbnail = is_big;
865
/* FIXME: This is buggy!!! Further testing might be needed.
867
if( 0 == max_file_size )
869
if( old_max_thumbnail > 0 ) /* cancel thumbnails */
871
vfs_thumbnail_loader_cancel_all_requests( list->dir, list->big_thumbnail );
872
g_signal_handlers_disconnect_by_func( list->dir, on_thumbnail_loaded, list );
874
for( l = list->files; l; l = l->next )
876
file = (VFSFileInfo*)l->data;
877
if( vfs_file_info_is_image( file )
878
&& vfs_file_info_is_thumbnail_loaded( file, is_big ) )
880
/* update the model */
881
ptk_file_list_file_changed( list->dir, file, list );
888
g_signal_connect( list->dir, "thumbnail-loaded",
889
G_CALLBACK(on_thumbnail_loaded), list );
891
for( l = list->files; l; l = l->next )
893
file = (VFSFileInfo*)l->data;
894
if( vfs_file_info_is_image( file )
895
&& vfs_file_info_get_size( file ) < list->max_thumbnail )
897
if( vfs_file_info_is_thumbnail_loaded( file, is_big ) )
898
ptk_file_list_file_changed( list->dir, file, list );
901
vfs_thumbnail_loader_request( list->dir, file, is_big );
902
/* g_debug( "REQUEST: %s", file->name ); */