summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <[email protected]>2017-10-26 21:24:09 +0200
committerAlbert Astals Cid <[email protected]>2017-10-26 21:24:09 +0200
commit8d7ea894f3d1ed6aba46f182aeaa20125f146bbb (patch)
treeaf440d69437554977e8be8c770876562fab7f70d
parent0cb4ff7dad74f5815efea62bc32a11f16efea38d (diff)
make parttest pass again
-rw-r--r--autotests/parttest.cpp8
-rw-r--r--part.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/autotests/parttest.cpp b/autotests/parttest.cpp
index 71cfac0..95b9070 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 f7bf554..9d97fa6 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.<br />This means that the undo/redo stack will be lost.<br />Do you want to continue?" ),