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

Authored by ahmadosama on Aug 13 2018, 8:44 AM.

Description

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

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

Reviewers: Okular

Subscribers: aacid, okular-devel

Tags: Okular

Differential Revision: https://phabricator.kde.org/D14740