Home
Phabricator
Search
Log In
Paste
P59
Masterwork From Distant Lands
Active
Public
Actions
Authored by
dkazakov
on Nov 7 2016, 9:44 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
diff --git a/libs/ui/KisDocument.cpp b/libs/ui/KisDocument.cpp
index a7bd1cd..1d8ac6f 100644
--- a/libs/ui/KisDocument.cpp
+++ b/libs/ui/KisDocument.cpp
@@ -939,8 +939,26 @@ bool KisDocument::isModified() const
bool KisDocument::saveNativeFormat(const QString & file)
{
- Private::SafeSavingLocker locker(d);
- if (!locker.successfullyLocked()) return false;
+ KisImageSP clonedImage;
+
+ {
+ Private::SafeSavingLocker locker(d);
+ if (locker.successfullyLocked()) {
+ clonedImage = d->image->clone(true);
+ locker.unlock();
+ } else {
+ QMessageBox::message("Emergency save!");
+ d->image->lock();
+ clonedImage = d->image->clone(true);
+ d->image->unlock();
+ }
+ }
+
+ std::unique_lock l(d->savingLock, std::try_to_lock);
+ if (!l.locked()) return;
+
+
+ // From now on we work only with clonedImage, not with d->image!
d->lastErrorMessage.clear();
//dbgUI <<"Saving to store";
diff --git a/libs/ui/KisMainWindow.cpp b/libs/ui/KisMainWindow.cpp
index 977d0d4..fb4364e 100644
--- a/libs/ui/KisMainWindow.cpp
+++ b/libs/ui/KisMainWindow.cpp
@@ -885,7 +885,8 @@ bool KisMainWindow::saveDocument(KisDocument *document, bool saveas, bool silent
KisDelayedSaveDialog dlg(document->image(), this);
dlg.blockIfImageIsBusy();
- if (dlg.result() != QDialog::Accepted) {
+ if (dlg.result() != QDialog::Accepted &&
+ dlg.result() != SaveAnyway) {
return false;
}
dkazakov
edited the content of this paste.
(Show Details)
Nov 7 2016, 9:44 AM
dkazakov
changed the title of this paste from untitled to
Masterwork From Distant Lands
.
dkazakov
updated the paste's language from
autodetect
to
autodetect
.
Log In to Comment