mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 03:30:20 +00:00
Fix properties dialog path not being correct on Save As
We need to clear DocumentInfo because otherwise it is cached and refers to the old file BUGS: 397039
This commit is contained in:
parent
e0907726d6
commit
4f06f742f9
|
@ -831,6 +831,7 @@ void PartTest::testSaveAs()
|
|||
{
|
||||
Okular::Part part(nullptr, nullptr, QVariantList());
|
||||
part.openDocument( file );
|
||||
part.m_document->documentInfo();
|
||||
|
||||
QCOMPARE(part.m_document->canSwapBackingFile(), canSwapBackingFile);
|
||||
|
||||
|
@ -867,6 +868,7 @@ void PartTest::testSaveAs()
|
|||
QVERIFY( part.saveAs( QUrl::fromLocalFile( nativeDirectSave.fileName() ), Part::NoSaveAsFlags ) );
|
||||
}
|
||||
|
||||
QCOMPARE( part.m_document->documentInfo().get( Okular::DocumentInfo::FilePath ), part.m_document->currentDocument().toDisplayString() );
|
||||
part.closeUrl();
|
||||
}
|
||||
|
||||
|
@ -874,6 +876,7 @@ void PartTest::testSaveAs()
|
|||
{
|
||||
Okular::Part part(nullptr, nullptr, QVariantList());
|
||||
part.openDocument( archiveSave.fileName() );
|
||||
part.m_document->documentInfo();
|
||||
|
||||
QCOMPARE( part.m_document->page( 0 )->annotations().size(), 1 );
|
||||
QCOMPARE( part.m_document->page( 0 )->annotations().first()->uniqueName(), annotName );
|
||||
|
@ -892,6 +895,7 @@ void PartTest::testSaveAs()
|
|||
closeDialogHelper.reset(new CloseDialogHelper( &part, QDialogButtonBox::No )); // this is the "do you want to save or discard" dialog
|
||||
}
|
||||
|
||||
QCOMPARE( part.m_document->documentInfo().get( Okular::DocumentInfo::FilePath ), part.m_document->currentDocument().toDisplayString() );
|
||||
part.closeUrl();
|
||||
}
|
||||
|
||||
|
|
|
@ -4635,6 +4635,8 @@ bool Document::swapBackingFile( const QString &newFileName, const QUrl &url )
|
|||
d->m_docFileName = newFileName;
|
||||
d->updateMetadataXmlNameAndDocSize();
|
||||
d->m_bookmarkManager->setUrl( d->m_url );
|
||||
d->m_documentInfo = DocumentInfo();
|
||||
d->m_documentInfoAskedKeys.clear();
|
||||
|
||||
if ( d->m_synctex_scanner )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue