┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2014-08-27 22:40:06 +0200
committerEmmanuel Pescosta <[email protected]>2014-08-31 17:00:10 +0200
commitdc378935d3f92c45a48349d08f96cac63411fd50 (patch)
tree9419b285d9b58edc435d897aa0f00f3644519f53
parent4290827540d88829d3d06f828a11ac2c3df00d54 (diff)
Only keep the active view container connected with the main window, all inactive
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
-rw-r--r--src/dolphinmainwindow.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index db4ad0765..a4e43a983 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -409,14 +409,6 @@ void DolphinMainWindow::openNewTab(const KUrl& primaryUrl, const KUrl& secondary
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)),
@@ -701,10 +693,6 @@ void DolphinMainWindow::toggleSplitView()
DolphinTabPage* tabPage = m_viewTab.at(m_tabIndex);
tabPage->setSplitViewEnabled(!tabPage->splitViewEnabled());
- if (tabPage->splitViewEnabled()) {
- connectViewSignals(tabPage->secondaryViewContainer());
- }
-
updateViewActions();
}
@@ -1260,7 +1248,17 @@ void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContain
return;
}
+ 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;
+ connectViewSignals(viewContainer);
+
m_actionHandler->setCurrentView(viewContainer->view());
updateHistory();