Skip to content

Commit

Permalink
Fixed "Repeat last export on save" when using Save All
Browse files Browse the repository at this point in the history
Due to directly calling Document::save in MainWindow::saveAll, the
DocumentManager::documentSaved signal was not being emitted.

Closes #2969
  • Loading branch information
bjorn committed Feb 26, 2021
1 parent 6dfccc7 commit 7c7be67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/tiled/documentmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ bool DocumentManager::saveDocument(Document *document, const QString &fileName)

QString error;
if (!document->save(fileName, &error)) {
switchToDocument(document);
QMessageBox::critical(mWidget->window(), QCoreApplication::translate("Tiled::MainWindow", "Error Saving File"), error);
return false;
}
Expand Down
4 changes: 1 addition & 3 deletions src/tiled/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,7 @@ void MainWindow::saveAll()
mDocumentManager->switchToDocument(document.data());
if (!mDocumentManager->saveDocumentAs(document.data()))
return;
} else if (!document->save(fileName, &error)) {
mDocumentManager->switchToDocument(document.data());
QMessageBox::critical(this, tr("Error Saving File"), error);
} else if (!mDocumentManager->saveDocument(document.data(), fileName)) {
return;
}
}
Expand Down

0 comments on commit 7c7be67

Please sign in to comment.