Commit 1e309832 authored by Miklos Marton's avatar Miklos Marton

Do not restore the JPG quality after a "Save" operation

The "Save as" dialog allows to save images with different JPG quality.
After performing the "Save as" operation the JPEG quality was restored
to the original gwenview configuration.

However if the user only saved the modified image this same restoration
process was performed too. But in this case the variable
(configFileJPEGQualityValue) had the value which have been set at startup
not on the start of the save process, which lead to discarding the user
changes made to the JPG save quality since the program start.

Moved the restoration process to be ran only for the "Save as" operation.

Fixes: 423414
parent ede49a38
......@@ -423,6 +423,10 @@ void GvCore::saveAs(const QUrl &url)
name, doc->errorString());
KMessageBox::sorry(QApplication::activeWindow(), msg);
} else {
// Regardless of job result, reset JPEG config value if it was changed by
// the Save As dialog
if (GwenviewConfig::jPEGQuality() != d->configFileJPEGQualityValue)
GwenviewConfig::setJPEGQuality(d->configFileJPEGQualityValue);
connect(job, SIGNAL(result(KJob*)), SLOT(slotSaveResult(KJob*)));
}
}
......@@ -436,12 +440,6 @@ static void applyTransform(const QUrl &url, Orientation orientation)
void GvCore::slotSaveResult(KJob* _job)
{
// Regardless of job result, reset JPEG config value if it was changed by
// the Save As dialog
if (GwenviewConfig::jPEGQuality() != d->configFileJPEGQualityValue) {
GwenviewConfig::setJPEGQuality(d->configFileJPEGQualityValue);
}
SaveJob* job = static_cast<SaveJob*>(_job);
QUrl oldUrl = job->oldUrl();
QUrl newUrl = job->newUrl();
......
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