Fix problem of saving pdf switches from thumbnail view in sidebar to contents view
ClosedPublic

Authored by ahmadosama on Aug 11 2018, 9:41 AM.

Details

Summary

When save/save as functions are called they internally call the openFile() function, in the open file function the side bar item is set to Table of Contents (ToC) item

if ( m_document->metaData( QStringLiteral("OpenTOC") ).toBool() && m_sidebar->isItemEnabled( m_toc ) && !m_sidebar->isCollapsed() && m_sidebar->currentItem() != m_toc )
{
     m_sidebar->setCurrentItem( m_toc, Sidebar::DoNotUncollapseIfCollapsed );
}

so I just store the sidebar's item before saving and then set this item back if changed.

Bug: 389668

Diff Detail

Repository
R223 Okular
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahmadosama created this revision.Aug 11 2018, 9:41 AM
Restricted Application added a project: Okular. · View Herald TranscriptAug 11 2018, 9:41 AM
Restricted Application added a subscriber: okular-devel. · View Herald Transcript
ahmadosama requested review of this revision.Aug 11 2018, 9:41 AM
ahmadosama edited the summary of this revision. (Show Details)Aug 11 2018, 9:46 AM
ahmadosama edited the summary of this revision. (Show Details)
ahmadosama edited the summary of this revision. (Show Details)
ahmadosama edited the summary of this revision. (Show Details)Aug 11 2018, 10:21 AM
aacid added a subscriber: aacid.Aug 11 2018, 8:39 PM

Do you think you could work on an autotest for this?

ahmadosama updated this revision to Diff 39543.Aug 12 2018, 9:17 PM
This comment was removed by ahmadosama.
ahmadosama updated this revision to Diff 39544.Aug 12 2018, 9:21 PM
  • Adding a unit test to check that document doesnot go back to contents view after saving

I updated the parttest.cpp, the tocreload.pdf file in the data directory reproduced this bug so I used it for the unit test.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 13 2018, 9:14 AM
This revision was automatically updated to reflect the committed changes.