From kde-commits Sat Jun 30 22:53:55 2007 From: =?utf-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Sat, 30 Jun 2007 22:53:55 +0000 To: kde-commits Subject: KDE/kdegraphics/gwenview Message-Id: <1183244035.904308.1494.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=118324404418050 SVN commit 681944 by gateau: Update Document::format() when saving. M +5 -1 lib/documentloadedimpl.cpp M +1 -0 tests/documenttest.cpp --- trunk/KDE/kdegraphics/gwenview/lib/documentloadedimpl.cpp #681943:681944 @@ -58,7 +58,11 @@ bool DocumentLoadedImpl::saveInternal(QIODevice* device, const QString& format) { - return document()->image().save(device, format.toAscii()); + bool ok = document()->image().save(device, format.toAscii()); + if (ok) { + setDocumentFormat(format.toAscii()); + } + return ok; } --- trunk/KDE/kdegraphics/gwenview/tests/documenttest.cpp #681943:681944 @@ -96,6 +96,7 @@ KUrl destUrl(QDir::currentPath() + "/result.png"); Document::SaveResult result = doc->save(destUrl, "png"); QCOMPARE(result, Document::SR_OK); + QCOMPARE(doc->format().data(), "png"); QVERIFY2(doc->isLoaded(), "Document is supposed to finish loading before saving"