Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8d7ea894 authored by Albert Astals Cid's avatar Albert Astals Cid Committed by Albert Astals Cid

make parttest pass again

parent 0cb4ff7d
......@@ -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();
}
......
......@@ -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?" ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment