Commit b783f06f authored by Tom Moebert's avatar Tom Moebert Committed by Nate Graham
Browse files

Rename DeleteThumbnailCacheOnExit -> LowResourceUsageMode

Summary: DeleteThumbnailCacheOnExit has been promoted to a low-resource-usage mode. Reflect that change in the code.

Reviewers: #gwenview, ngraham

Reviewed By: #gwenview, ngraham

Subscribers: ngraham, #gwenview

Tags: #gwenview

Differential Revision: https://phabricator.kde.org/D21406
parent 9fda1460
......@@ -24,7 +24,7 @@
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="kcfg_DeleteThumbnailCacheOnExit">
<widget class="QCheckBox" name="kcfg_LowResourceUsageMode">
<property name="text">
<string>Low resource usage mode</string>
</property>
......
......@@ -918,7 +918,7 @@ MainWindow::MainWindow()
MainWindow::~MainWindow()
{
if (GwenviewConfig::deleteThumbnailCacheOnExit()) {
if (GwenviewConfig::lowResourceUsageMode()) {
QDir dir(ThumbnailProvider::thumbnailBaseDir());
if (dir.exists()) {
dir.removeRecursively();
......
......@@ -27,3 +27,10 @@ File=gwenviewrc
Options=overwrite
Group=ImageView
Script=gwenview-imageview-alphabackgroundmode-update.pl,perl
Id=DeleteThumbnailSetting_Rename
File=gwenviewrc
Group=ThumbnailView
Key=DeleteThumbnailCacheOnExit,LowResourceUsageMode
......@@ -206,7 +206,7 @@
<default>3./2.</default>
</entry>
<entry name="DeleteThumbnailCacheOnExit" type="Bool">
<entry name="LowResourceUsageMode" type="Bool">
<default>false</default>
</entry>
......
......@@ -119,7 +119,7 @@ bool ThumbnailContext::load(const QString &pixPath, int pixelSize)
// If the user does not care about the generated thumbnails (by deleting them on exit), use ANY
// embedded thumnail, even if it's too small.
if (!thumbnail.isNull() &&
(GwenviewConfig::deleteThumbnailCacheOnExit() || qMax(thumbnail.width(), thumbnail.height()) >= pixelSize)
(GwenviewConfig::lowResourceUsageMode() || qMax(thumbnail.width(), thumbnail.height()) >= pixelSize)
) {
mImage = std::move(thumbnail);
mOriginalWidth = content.size().width();
......
......@@ -223,7 +223,7 @@ void ThumbnailProviderTest::testUseEmbeddedOrNot()
syncRun(&provider);
QCOMPARE(spy.count(), 1);
if (GwenviewConfig::deleteThumbnailCacheOnExit()) {
if (GwenviewConfig::lowResourceUsageMode()) {
expectedThumbnail = createColoredImage(128, 64, Qt::white);
} else {
expectedThumbnail = createColoredImage(256, 128, QColor(254, 0, 0));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment