Commit b2ba706f authored by Frank Reininghaus's avatar Frank Reininghaus
Browse files

Fix an issue which is similar to bug 160407: Splitting the first child of a...

Fix an issue which is similar to bug 160407: Splitting the first child of a KonqFrameContainer and then removing one of the grandchildren also resized the bottom child to zero size.

Fix will be in KDE 4.2.3.

CCBUG: 160407

svn path=/branches/KDE/4.2/kdebase/apps/; revision=961201
parent 6e95764c
......@@ -550,6 +550,15 @@ void KonqViewManager::removeView( KonqView *view )
static_cast<KonqFrameContainer*>(parentContainer)->setAboutToBeDeleted();
// If the grand parent is a KonqFrameContainer, we need the sizes of the views inside it to restore these after
// the parent is replaced. To access the sizes via QSplitter::sizes(), a pointer to a KonqFrameContainerBase
// is not sufficient. We need a pointer to a KonqFrameContainer which is derived from QSplitter.
KonqFrameContainer* grandParentKonqFrameContainer = dynamic_cast<KonqFrameContainer*> ( grandParentContainer );
QList<int> grandParentSplitterSizes;
if ( grandParentKonqFrameContainer ) {
grandParentSplitterSizes = grandParentKonqFrameContainer->sizes();
}
grandParentContainer->replaceChildFrame(parentContainer, otherFrame);
//kDebug(1202) << "--- Removing otherFrame from parentContainer";
......@@ -561,6 +570,10 @@ void KonqViewManager::removeView( KonqView *view )
delete parentContainer;
if ( grandParentKonqFrameContainer ) {
grandParentKonqFrameContainer->setSizes( grandParentSplitterSizes );
}
grandParentContainer->setActiveChild( otherFrame );
grandParentContainer->activateChild();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment