diff --git a/app/advancedconfigpage.ui b/app/advancedconfigpage.ui --- a/app/advancedconfigpage.ui +++ b/app/advancedconfigpage.ui @@ -48,7 +48,7 @@ - Enable this option if you do not have a lot of disk space. This will avoid storing thumbnails on disk and will prefer embedded thumbnails of lower quality that are faster to load, if available.<br/><br/><em>Be careful:</em> this will delete the folder named <filename>thumbnails</filename> in your <filename>.cache</filename> folder, removing all thumbnails previously generated by Gwenview and other applications. + Enable this option if you do not have a lot of disk space. This will avoid storing thumbnails on disk and will prefer embedded thumbnails of lower quality that are faster to load, if available. true diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -927,12 +927,6 @@ MainWindow::~MainWindow() { - if (GwenviewConfig::lowResourceUsageMode()) { - QDir dir(ThumbnailProvider::thumbnailBaseDir()); - if (dir.exists()) { - dir.removeRecursively(); - } - } delete d->mThumbnailProvider; delete d; } diff --git a/lib/thumbnailprovider/thumbnailwriter.cpp b/lib/thumbnailprovider/thumbnailwriter.cpp --- a/lib/thumbnailprovider/thumbnailwriter.cpp +++ b/lib/thumbnailprovider/thumbnailwriter.cpp @@ -22,10 +22,11 @@ #include "thumbnailwriter.h" // Local +#include "gwenview_lib_debug.h" +#include "gwenviewconfig.h" // Qt #include -#include "gwenview_lib_debug.h" #include namespace Gwenview @@ -42,6 +43,10 @@ static void storeThumbnailToDiskCache(const QString& path, const QImage& image) { + if (GwenviewConfig::lowResourceUsageMode()) { + return; + } + LOG(path); QTemporaryFile tmp(path + QStringLiteral(".gwenview.tmpXXXXXX.png")); if (!tmp.open()) { @@ -59,6 +64,10 @@ void ThumbnailWriter::queueThumbnail(const QString& path, const QImage& image) { + if (GwenviewConfig::lowResourceUsageMode()) { + return; + } + LOG(path); QMutexLocker locker(&mMutex); mCache.insert(path, image);