view containers are disconnected. Changing the connections is done whenever the
active view has been changed, so we can always guarantee that the active view is
connected.
The problem with restoring saved sessions is, that we create a new view container
in DolphinTabPage::restoreState() when split view was used in the previous session,
but this view container isn't connected to the main window slots because
DolphinMainWindow::connectViewSignals() is not called for this container. This leads
to these strange problems: no context menu, ...
BUG: 338549
REVIEW: 119961
FIXED-IN: 4.14.1
const bool placesSelectorVisible = !placesDock || !placesDock->isVisible();
tabPage->setPlacesSelectorVisible(placesSelectorVisible);
const bool placesSelectorVisible = !placesDock || !placesDock->isVisible();
tabPage->setPlacesSelectorVisible(placesSelectorVisible);
- DolphinViewContainer* primaryContainer = tabPage->primaryViewContainer();
- connectViewSignals(primaryContainer);
-
- if (tabPage->splitViewEnabled()) {
- DolphinViewContainer* secondaryContainer = tabPage->secondaryViewContainer();
- connectViewSignals(secondaryContainer);
- }
-
tabPage->hide();
m_tabBar->addTab(KIcon(KMimeType::iconNameForUrl(primaryUrl)),
tabPage->hide();
m_tabBar->addTab(KIcon(KMimeType::iconNameForUrl(primaryUrl)),
DolphinTabPage* tabPage = m_viewTab.at(m_tabIndex);
tabPage->setSplitViewEnabled(!tabPage->splitViewEnabled());
DolphinTabPage* tabPage = m_viewTab.at(m_tabIndex);
tabPage->setSplitViewEnabled(!tabPage->splitViewEnabled());
- if (tabPage->splitViewEnabled()) {
- connectViewSignals(tabPage->secondaryViewContainer());
- }
-
+ if (m_activeViewContainer) {
+ // Disconnect all signals between the old view container (container,
+ // view and url navigator) and main window.
+ m_activeViewContainer->disconnect(this);
+ m_activeViewContainer->view()->disconnect(this);
+ m_activeViewContainer->urlNavigator()->disconnect(this);
+ }
+
m_activeViewContainer = viewContainer;
m_activeViewContainer = viewContainer;
+ connectViewSignals(viewContainer);
+
m_actionHandler->setCurrentView(viewContainer->view());
updateHistory();
m_actionHandler->setCurrentView(viewContainer->view());
updateHistory();