Conversation
LStranger
left a comment
There was a problem hiding this comment.
Overall idea is good, although I would rather make a single function for those operations instead of duplicating code many times. Also I would rather allocate paths in the get_thumbnail_paths() function instead of using g_build_filename() everywhere.
Thank you very much for your work.
| GFile* src_large = g_file_new_for_path(src_path_large); | ||
| GFile* dest_normal = g_file_new_for_path(dest_path_normal); | ||
| GFile* dest_large = g_file_new_for_path(dest_path_large); | ||
| g_file_copy (src_normal, dest_normal, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, NULL); |
There was a problem hiding this comment.
I suppose this should be not copying operation but moving one instead. Thank you.
There was a problem hiding this comment.
You're right, it's fixed now
|
|
||
| /* copy thumbnails, if existing */ | ||
| if(ret == TRUE && g_file_is_native(src) && g_file_is_native(dest)) | ||
| { |
There was a problem hiding this comment.
I would consider to honor "thumbnail_local" configuration variable in regards of decision if we have to create a copy for a file thumbnail.
src/job/fm-file-ops-job-xfer.c
Outdated
| ret = FALSE; | ||
|
|
||
| /* move thumbnails, if existing */ | ||
| if(ret == TRUE && g_file_is_native(src) && g_file_is_native(dest)) |
There was a problem hiding this comment.
How about to delete thumbnail if destination file isn't native?
Also I would consider to honor "thumbnail_local" configuration variable in that regard.
13d44ef to
bb91bc7
Compare
|
I applied the suggestion, except for allocating paths in get_thumbnail_paths(). |
|
This may create issues due to multithreading. Let me think about this optimization for release 1.4.0. |
When files are copied, moved or deleted, their thumbnails are re-generated from scratch (which can be CPU- or disk-intensive) and/or left behind without being useful anymore (taking up disk space).
This PR applies the copy/move/delete operations to thumbnails as well (if they exist), solving these problems.