Changeset View
Changeset View
Standalone View
Standalone View
lib/document/document.cpp
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Line(s) | |||||
149 | Document::Document(const QUrl &url) | 149 | Document::Document(const QUrl &url) | ||
150 | : QObject() | 150 | : QObject() | ||
151 | , d(new DocumentPrivate) | 151 | , d(new DocumentPrivate) | ||
152 | { | 152 | { | ||
153 | d->q = this; | 153 | d->q = this; | ||
154 | d->mImpl = 0; | 154 | d->mImpl = 0; | ||
155 | d->mUrl = url; | 155 | d->mUrl = url; | ||
156 | d->mKeepRawData = false; | 156 | d->mKeepRawData = false; | ||
157 | connect(&d->mUndoStack, SIGNAL(indexChanged(int)), SLOT(slotUndoIndexChanged())); | | |||
158 | 157 | | |||
159 | reload(); | 158 | reload(); | ||
160 | } | 159 | } | ||
161 | 160 | | |||
162 | Document::~Document() | 161 | Document::~Document() | ||
163 | { | 162 | { | ||
164 | // We do not want undo stack to emit signals, forcing us to emit signals | 163 | // We do not want undo stack to emit signals, forcing us to emit signals | ||
165 | // ourself while we are being destroyed. | 164 | // ourself while we are being destroyed. | ||
▲ Show 20 Lines • Show All 312 Lines • ▼ Show 20 Line(s) | 476 | { | |||
478 | emit loadingFailed(d->mUrl); | 477 | emit loadingFailed(d->mUrl); | ||
479 | } | 478 | } | ||
480 | 479 | | |||
481 | QUndoStack* Document::undoStack() const | 480 | QUndoStack* Document::undoStack() const | ||
482 | { | 481 | { | ||
483 | return &d->mUndoStack; | 482 | return &d->mUndoStack; | ||
484 | } | 483 | } | ||
485 | 484 | | |||
486 | void Document::slotUndoIndexChanged() | 485 | void Document::imageOperationCompleted() | ||
487 | { | 486 | { | ||
488 | if (d->mUndoStack.isClean()) { | 487 | if (d->mUndoStack.isClean()) { | ||
489 | // If user just undid all his changes this does not really correspond | 488 | // If user just undid all his changes this does not really correspond | ||
490 | // to a save, but it's similar enough as far as Document users are | 489 | // to a save, but it's similar enough as far as Document users are | ||
491 | // concerned | 490 | // concerned | ||
492 | saved(d->mUrl, d->mUrl); | 491 | saved(d->mUrl, d->mUrl); | ||
493 | } else { | 492 | } else { | ||
494 | modified(d->mUrl); | 493 | modified(d->mUrl); | ||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |