File 2003-fix-sidebar.patch of Package okular

diff --git a/shell/shell.cpp b/shell/shell.cpp
index fd441c82c8a9c0b9b786bebb8c92c8e7d8bbed3b..f4c90d5475dbd3a8324ddd31136d4224402f45eb 100644
--- a/shell/shell.cpp
+++ b/shell/shell.cpp
@@ -229,6 +229,7 @@ Shell::Shell(const QString &serializedOptions)
         connect(m_sidebar, &QDockWidget::visibilityChanged, this, [this](bool visible) {
             // sync sidebar visibility with the m_showSidebarAction only if welcome screen is hidden
             if (m_showSidebarAction && m_centralStackedWidget->currentWidget() != m_welcomeScreen) {
+                const QSignalBlocker blocker(m_showSidebarAction);
                 m_showSidebarAction->setChecked(visible);
             }
         });
@@ -910,7 +911,7 @@ void Shell::setActiveTab(int tab)
     Q_ASSERT(m_showSidebarAction);
     m_showSidebarAction->disconnect();
     m_showSidebarAction->setChecked(m_sidebar->isVisibleTo(this));
-    connect(m_showSidebarAction, &QAction::triggered, m_sidebar, &Sidebar::setVisible);
+    connect(m_showSidebarAction, &QAction::toggled, m_sidebar, &Sidebar::setVisible);
 
     m_printAction->setEnabled(m_tabs[tab].printEnabled);
     m_closeAction->setEnabled(m_tabs[tab].closeEnabled);
openSUSE Build Service is sponsored by