Don't fill disk with thumbnails if thumbnail saving is turned off

Authored by sandsmark on Mar 28 2020, 1:52 PM.

Description

Don't fill disk with thumbnails if thumbnail saving is turned off

Even if "low resource usage mode" is turned on, which says it avoids
storing thumbnails to disk to save space, it still stores thumbnails to
disk. It just deletes _all_ thumbnails afterwards (even those not from
gwenview itself).

This was also kind of racy, because thumbnailwriter could still be
running, but the folders would be deleted, so it spammed a ton of error
messages.

Test Plan:
Doesn't store thumbnails when it shouldn't anymore, doesn't
delete thumbnails from other applications nor the thumbnail folders,
thumbnailwriter doesn't spaz out during exit, stores thumbnails when it
should.

Differential Revision: https://phabricator.kde.org/D28375