Do not create thumbnail on autosave

Creating thumbnails on autosave was already disabled in
4cd48850a3
but only for the first score autosave. Subsequent autosaves still
generated thumbnails. This commit makes all autosaves not create
thumbnails.
This commit is contained in:
Dmitri Ovodok 2020-02-04 00:37:32 +02:00
parent a197b9fe19
commit a44827b361
3 changed files with 4 additions and 4 deletions

View file

@ -789,7 +789,7 @@ class Score : public QObject, public ScoreElement {
bool saveFile(QFileInfo& info);
bool saveFile(QIODevice* f, bool msczFormat, bool onlySelection = false);
bool saveCompressedFile(QFileInfo&, bool onlySelection);
bool saveCompressedFile(QFileInfo&, bool onlySelection, bool createThumbnail = true);
bool saveCompressedFile(QFileDevice*, QFileInfo&, bool onlySelection, bool createThumbnail = true);
void print(QPainter* printer, int page);

View file

@ -486,7 +486,7 @@ bool MasterScore::saveFile()
// saveCompressedFile
//---------------------------------------------------------
bool Score::saveCompressedFile(QFileInfo& info, bool onlySelection)
bool Score::saveCompressedFile(QFileInfo& info, bool onlySelection, bool createThumbnail)
{
if (readOnly() && info == *masterScore()->fileInfo())
return false;
@ -495,7 +495,7 @@ bool Score::saveCompressedFile(QFileInfo& info, bool onlySelection)
MScore::lastError = tr("Open File\n%1\nfailed: %2").arg(info.filePath(), strerror(errno));
return false;
}
return saveCompressedFile(&fp, info, onlySelection);
return saveCompressedFile(&fp, info, onlySelection, createThumbnail);
}
//---------------------------------------------------------

View file

@ -5039,7 +5039,7 @@ void MuseScore::autoSaveTimerTimeout()
if (!tmp.isEmpty()) {
QFileInfo fi(tmp);
// TODO: cannot catch exception here:
s->saveCompressedFile(fi, false);
s->saveCompressedFile(fi, false, false); // no thumbnail
}
else {
QDir dir;