diff options
| author | Peter Penz <[email protected]> | 2007-06-27 15:15:29 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-06-27 15:15:29 +0000 |
| commit | afc732d220b66130e23faebdefb3d014ee474022 (patch) | |
| tree | d9c7ce67a10f41af8812e9623466ffbcc5114c81 | |
| parent | 4ad537ce4fccfb66d3de41fab1c6e68d2ae2a4b2 (diff) | |
Fix the following reproducible crash in a slightly different way (reported + initial fix done by Rafael):
* Open Dolphin. Enable categorization.
* Split the view. Disable categorization on the right one.
* Join the views.
CCMAIL: [email protected]
svn path=/trunk/KDE/kdebase/apps/; revision=680956
| -rw-r--r-- | src/dolphinmainwindow.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 98a91327f..3e22ba1d3 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -390,11 +390,17 @@ void DolphinMainWindow::openNewMainWindow() void DolphinMainWindow::toggleActiveView() { - if (m_activeViewContainer == m_viewContainer[PrimaryView]) { - setActiveViewContainer(m_viewContainer[SecondaryView]); - } else { - setActiveViewContainer(m_viewContainer[PrimaryView]); + if (m_viewContainer[SecondaryView] == 0) { + // only one view is available + return; } + + Q_ASSERT(m_activeViewContainer != 0); + Q_ASSERT(m_viewContainer[PrimaryView] != 0); + + DolphinViewContainer* left = m_viewContainer[PrimaryView]; + DolphinViewContainer* right = m_viewContainer[SecondaryView]; + setActiveViewContainer(m_activeViewContainer == right ? left : right); } void DolphinMainWindow::closeEvent(QCloseEvent* event) @@ -1040,8 +1046,9 @@ void DolphinMainWindow::init() void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* view) { + Q_ASSERT(view != 0); Q_ASSERT((view == m_viewContainer[PrimaryView]) || (view == m_viewContainer[SecondaryView])); - if (m_activeViewContainer == view || !view) { + if (m_activeViewContainer == view) { return; } |
