diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2023-04-14 03:52:01 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2023-04-14 05:24:57 +0200 |
commit | 05ac3a065198378653d0b94dc25946c71d4d23a1 (patch) | |
tree | 17a33ef7dc107920402e3dc690c5d3e1f3de7aae /fiv-io.c | |
parent | 4317c7e581415078c876ad5699d41cbea3c89cb5 (diff) | |
download | fiv-05ac3a065198378653d0b94dc25946c71d4d23a1.tar.gz fiv-05ac3a065198378653d0b94dc25946c71d4d23a1.tar.xz fiv-05ac3a065198378653d0b94dc25946c71d4d23a1.zip |
Check filesize when retrieving thumbnails
In particular, this handles screenshots from Rigol oscilloscopes,
which reuse the same name series with the same file modification time.
Diffstat (limited to 'fiv-io.c')
-rw-r--r-- | fiv-io.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3172,6 +3172,7 @@ model_reload_to(FivIoModel *self, GFile *directory, GFileEnumerator *enumerator = g_file_enumerate_children(directory, G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_STANDARD_NAME "," + G_FILE_ATTRIBUTE_STANDARD_SIZE "," G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "," G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "," @@ -3208,7 +3209,9 @@ model_reload_to(FivIoModel *self, GFile *directory, FivIoModelEntry entry = {.uri = g_file_get_uri(child), .target_uri = g_strdup(g_file_info_get_attribute_string( info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI)), - .display_name = g_strdup(g_file_info_get_display_name(info))}; + .display_name = g_strdup(g_file_info_get_display_name(info)), + .filesize = (guint64) g_file_info_get_size(info)}; + GDateTime *mtime = g_file_info_get_modification_date_time(info); if (mtime) { entry.mtime_msec = g_date_time_to_unix(mtime) * 1000 + |