@@ -501,6 +501,7 @@ nemo_file_clear_info (NemoFile *file)
501
501
file -> details -> ctime = 0 ;
502
502
file -> details -> btime = 0 ;
503
503
file -> details -> trash_time = 0 ;
504
+ file -> details -> load_thumb = FALSE;
504
505
g_free (file -> details -> symlink_name );
505
506
file -> details -> symlink_name = NULL ;
506
507
eel_ref_str_unref (file -> details -> mime_type );
@@ -564,7 +565,7 @@ nemo_file_new_from_filename (NemoDirectory *directory,
564
565
file -> details -> name = eel_ref_str_new (filename );
565
566
566
567
#ifdef NEMO_FILE_DEBUG_REF
567
- DEBUG_REF_PRINTF ("%10p ref'd" , file );
568
+ DEBUG_REF_PRINTF ("%10p ref'd\n " , file );
568
569
#endif
569
570
570
571
return file ;
@@ -676,7 +677,7 @@ nemo_file_new_from_info (NemoDirectory *directory,
676
677
update_info_and_name (file , info );
677
678
678
679
#ifdef NEMO_FILE_DEBUG_REF
679
- DEBUG_REF_PRINTF ("%10p ref'd" , file );
680
+ DEBUG_REF_PRINTF ("%10p ref'd\n " , file );
680
681
#endif
681
682
682
683
return file ;
@@ -865,6 +866,8 @@ finalize (GObject *object)
865
866
metadata_hash_free (file -> details -> metadata );
866
867
}
867
868
869
+ g_free (file -> details -> cached_uri );
870
+
868
871
G_OBJECT_CLASS (nemo_file_parent_class )-> finalize (object );
869
872
}
870
873
@@ -877,7 +880,7 @@ nemo_file_ref (NemoFile *file)
877
880
g_return_val_if_fail (NEMO_IS_FILE (file ), NULL );
878
881
879
882
#ifdef NEMO_FILE_DEBUG_REF
880
- DEBUG_REF_PRINTF ("%10p ref'd" , file );
883
+ DEBUG_REF_PRINTF ("%10p ref'd\n " , file );
881
884
#endif
882
885
883
886
return g_object_ref (file );
@@ -893,7 +896,7 @@ nemo_file_unref (NemoFile *file)
893
896
g_return_if_fail (NEMO_IS_FILE (file ));
894
897
895
898
#ifdef NEMO_FILE_DEBUG_REF
896
- DEBUG_REF_PRINTF ("%10p unref'd" , file );
899
+ DEBUG_REF_PRINTF ("%10p unref'd\n " , file );
897
900
#endif
898
901
899
902
g_object_unref (file );
@@ -1639,6 +1642,18 @@ nemo_file_get_uri (NemoFile *file)
1639
1642
return uri ;
1640
1643
}
1641
1644
1645
+ const char *
1646
+ nemo_file_peek_uri (NemoFile * file )
1647
+ {
1648
+ g_return_val_if_fail (NEMO_IS_FILE (file ), NULL );
1649
+
1650
+ if (file -> details -> cached_uri == NULL ) {
1651
+ file -> details -> cached_uri = nemo_file_get_uri (file );
1652
+ }
1653
+
1654
+ return file -> details -> cached_uri ;
1655
+ }
1656
+
1642
1657
/* Return the actual path associated with the passed-in file. */
1643
1658
char *
1644
1659
nemo_file_get_path (NemoFile * file )
@@ -4342,6 +4357,12 @@ nemo_file_delete_thumbnail (NemoFile *file)
4342
4357
}
4343
4358
}
4344
4359
4360
+ gboolean
4361
+ nemo_file_has_loaded_thumbnail (NemoFile * file )
4362
+ {
4363
+ return file -> details -> thumbnail_is_up_to_date ;
4364
+ }
4365
+
4345
4366
static void
4346
4367
prepend_icon_name (const char * name ,
4347
4368
GThemedIcon * icon )
@@ -4636,7 +4657,7 @@ nemo_file_get_icon (NemoFile *file,
4636
4657
DEBUG ("Called file_get_icon(), at size %d, force thumbnail %d" , size ,
4637
4658
flags & NEMO_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE );
4638
4659
4639
- if (flags & NEMO_FILE_ICON_FLAGS_USE_THUMBNAILS &&
4660
+ if (( flags & NEMO_FILE_ICON_FLAGS_USE_THUMBNAILS ) &&
4640
4661
nemo_file_should_show_thumbnail (file )) {
4641
4662
4642
4663
if (flags & NEMO_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE ) {
@@ -4727,12 +4748,12 @@ nemo_file_get_icon (NemoFile *file,
4727
4748
!file -> details -> is_thumbnailing &&
4728
4749
!file -> details -> thumbnailing_failed ) {
4729
4750
if (nemo_can_thumbnail (file )) {
4730
- nemo_create_thumbnail (file , get_throttle_count (file ));
4751
+ nemo_create_thumbnail (file , get_throttle_count (file ), TRUE );
4731
4752
}
4732
4753
}
4733
4754
}
4734
4755
4735
- if (file -> details -> is_thumbnailing &&
4756
+ if (file -> details -> thumbnail_path == NULL && nemo_can_thumbnail ( file ) &&
4736
4757
flags & NEMO_FILE_ICON_FLAGS_USE_THUMBNAILS )
4737
4758
gicon = g_themed_icon_new (ICON_NAME_THUMBNAIL_LOADING );
4738
4759
else
@@ -8019,6 +8040,13 @@ nemo_file_invalidate_extension_info_internal (NemoFile *file)
8019
8040
nemo_module_get_extensions_for_type (NEMO_TYPE_INFO_PROVIDER );
8020
8041
}
8021
8042
8043
+ void
8044
+ nemo_file_set_load_thumb (NemoFile * file ,
8045
+ gboolean load_thumb )
8046
+ {
8047
+ file -> details -> load_thumb = load_thumb ;
8048
+ }
8049
+
8022
8050
void
8023
8051
nemo_file_invalidate_attributes_internal (NemoFile * file ,
8024
8052
NemoFileAttributes file_attributes )
0 commit comments