diff --git a/autotests/parttest.cpp b/autotests/parttest.cpp index 71cfac04f..95b907018 100644 --- a/autotests/parttest.cpp +++ b/autotests/parttest.cpp @@ -739,7 +739,7 @@ void PartTest::testSaveAs() // user to confirm. On the other end, if we expect annotations to be // preserved (and thus no warning), we keep the warning on so that if it // shows the test timeouts and we can notice that something is wrong. - const Part::SaveAsFlags saveAsNativeFlags = nativelySupportsAnnotations ? + const Part::SaveAsFlags extraSaveAsFlags = nativelySupportsAnnotations ? Part::NoSaveAsFlags : Part::SaveAsDontShowWarning; QString annotName; @@ -761,8 +761,8 @@ void PartTest::testSaveAs() part.m_document->addPageAnnotation( 0, annot ); annotName = annot->uniqueName(); - QVERIFY( part.saveAs( QUrl::fromLocalFile( archiveSave.fileName() ), Part::SaveAsOkularArchive ) ); - QVERIFY( part.saveAs( QUrl::fromLocalFile( nativeDirectSave.fileName() ), saveAsNativeFlags ) ); + QVERIFY( part.saveAs( QUrl::fromLocalFile( archiveSave.fileName() ), extraSaveAsFlags | Part::SaveAsOkularArchive ) ); + QVERIFY( part.saveAs( QUrl::fromLocalFile( nativeDirectSave.fileName() ), extraSaveAsFlags ) ); part.closeUrl(); } @@ -775,7 +775,7 @@ void PartTest::testSaveAs() QCOMPARE( part.m_document->page( 0 )->annotations().size(), 1 ); QCOMPARE( part.m_document->page( 0 )->annotations().first()->uniqueName(), annotName ); - QVERIFY( part.saveAs( QUrl::fromLocalFile( nativeFromArchiveFile.fileName() ), saveAsNativeFlags ) ); + QVERIFY( part.saveAs( QUrl::fromLocalFile( nativeFromArchiveFile.fileName() ), extraSaveAsFlags ) ); part.closeUrl(); } diff --git a/part.cpp b/part.cpp index f7bf554fc..9d97fa646 100644 --- a/part.cpp +++ b/part.cpp @@ -2478,7 +2478,7 @@ bool Part::saveAs( const QUrl & saveUrl, SaveAsFlags flags ) // Does the user want a .okular archive? if ( flags & SaveAsOkularArchive ) { - if ( !hasUserAcceptedReload && !m_document->canSwapBackingFile() ) + if ( !hasUserAcceptedReload && !m_document->canSwapBackingFile() && !( flags & SaveAsDontShowWarning ) ) { const int res = KMessageBox::warningYesNo( widget(), i18n( "The current document format backend doesn't support internal reload on save so we will close and open the file again.
This means that the undo/redo stack will be lost.
Do you want to continue?" ),