do not create thumbnail when autosave
This commit is contained in:
parent
f80caadfe8
commit
4cd48850a3
3 changed files with 15 additions and 13 deletions
|
@ -738,7 +738,7 @@ class Score : public QObject, ScoreElement {
|
|||
bool saveFile(QFileInfo& info);
|
||||
bool saveFile(QIODevice* f, bool msczFormat, bool onlySelection = false);
|
||||
bool saveCompressedFile(QFileInfo&, bool onlySelection);
|
||||
bool saveCompressedFile(QIODevice*, QFileInfo&, bool onlySelection);
|
||||
bool saveCompressedFile(QIODevice*, QFileInfo&, bool onlySelection, bool createThumbnail = true);
|
||||
bool exportFile();
|
||||
|
||||
void print(QPainter* printer, int page);
|
||||
|
|
|
@ -526,7 +526,7 @@ QImage Score::createThumbnail()
|
|||
// file is already opened
|
||||
//---------------------------------------------------------
|
||||
|
||||
bool Score::saveCompressedFile(QIODevice* f, QFileInfo& info, bool onlySelection)
|
||||
bool Score::saveCompressedFile(QIODevice* f, QFileInfo& info, bool onlySelection, bool doCreateThumbnail)
|
||||
{
|
||||
MQZipWriter uz(f);
|
||||
|
||||
|
@ -539,7 +539,7 @@ bool Score::saveCompressedFile(QIODevice* f, QFileInfo& info, bool onlySelection
|
|||
xml.stag("rootfiles");
|
||||
xml.stag(QString("rootfile full-path=\"%1\"").arg(XmlWriter::xmlString(fn)));
|
||||
xml.etag();
|
||||
foreach(ImageStoreItem* ip, imageStore) {
|
||||
for (ImageStoreItem* ip : imageStore) {
|
||||
if (!ip->isUsed(this))
|
||||
continue;
|
||||
QString path = QString("Pictures/") + ip->hashName();
|
||||
|
@ -562,15 +562,17 @@ bool Score::saveCompressedFile(QIODevice* f, QFileInfo& info, bool onlySelection
|
|||
}
|
||||
|
||||
// create thumbnail
|
||||
QImage pm = createThumbnail();
|
||||
if (doCreateThumbnail) {
|
||||
QImage pm = createThumbnail();
|
||||
|
||||
QByteArray ba;
|
||||
QBuffer b(&ba);
|
||||
if (!b.open(QIODevice::WriteOnly))
|
||||
qDebug("open buffer failed");
|
||||
if (!pm.save(&b, "PNG"))
|
||||
qDebug("save failed");
|
||||
uz.addFile("Thumbnails/thumbnail.png", ba);
|
||||
QByteArray ba;
|
||||
QBuffer b(&ba);
|
||||
if (!b.open(QIODevice::WriteOnly))
|
||||
qDebug("open buffer failed");
|
||||
if (!pm.save(&b, "PNG"))
|
||||
qDebug("save failed");
|
||||
uz.addFile("Thumbnails/thumbnail.png", ba);
|
||||
}
|
||||
|
||||
#ifdef OMR
|
||||
//
|
||||
|
|
|
@ -3870,7 +3870,7 @@ void MuseScore::removeSessionFile()
|
|||
void MuseScore::autoSaveTimerTimeout()
|
||||
{
|
||||
bool sessionChanged = false;
|
||||
foreach (MasterScore* s, scoreList) {
|
||||
for (MasterScore* s : scoreList) {
|
||||
if (s->autosaveDirty()) {
|
||||
QString tmp = s->tmpName();
|
||||
if (!tmp.isEmpty()) {
|
||||
|
@ -3889,7 +3889,7 @@ void MuseScore::autoSaveTimerTimeout()
|
|||
}
|
||||
s->setTmpName(tf.fileName());
|
||||
QFileInfo info(tf.fileName());
|
||||
s->saveCompressedFile(&tf, info, false);
|
||||
s->saveCompressedFile(&tf, info, false, false); // no thumbnail
|
||||
tf.close();
|
||||
sessionChanged = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue