luspi / photoqt

PhotoQt Image Viewer (mirror repo) - https://photoqt.org
GNU General Public License v2.0
51 stars 12 forks source link

Make the thumbnail cache directory location configurable #34

Closed Hrxn closed 1 month ago

Hrxn commented 2 months ago

Requested Feature/Change

Right now, it seems that the directory for storing the (preview) thumbnails created by PhotoQt is a predefined path, e.g.

https://github.com/luspi/photoqt/blob/ca86637997029694be4fea548917131737c108da/cplusplus/other/pqc_startup.cpp#L134-L141

https://github.com/luspi/photoqt/blob/ca86637997029694be4fea548917131737c108da/cplusplus/header/pqc_configfiles.h#L49-L51

I'd assume that QStandardPaths::GenericCacheLocation is a default already integrated into Qt..

Motivation or Use Case of this Change

On Windows, thumbnails therefore end up in

%LOCALAPPDATA%\cache\thumbnails

If you use PhotoQt with a somewhat large photo collection (or enable higher res thumbnails etc.), this results in using quite a significant chunk of disk space on the C: system drive. This might not be an issue for the "whole disk drive is just C:\" type of uninitiated computer user, but for everything else this is not an optimal solution. I use a dedicated drive for (almost) all application installs, and another one for all cache/logs/thumbnails or similar data. On my real box these are even different physical drives, but I also use these scheme on my laptop, even if there is no performance gain to be made here. But it's just easier and faster to keep my same conventions everywhere, even if used in my scripts etc.

In the Settings Manger, there is already (under Thumbnails > Manage) the Cache option, so I think in terms of UI/UX an option to set a custom path can be integrated here quite straightforwardly.

Context (Environment)

luspi commented 1 month ago

Thanks for the suggestion! You are correct, these paths are currently predefined according to the freedesktop.org specification. Making this path configurable is indeed not a bad idea.

luspi commented 1 month ago

Good news, this has been added with 7327eed6e09fd862f96900615c3822b9545ae757 and will ship with the next release.

Hrxn commented 1 month ago

Thank you, appreciate it!