* In single window navigation mode, when navigating into a directory which had no viewstate yet (new folder) or if

fViewState didn't change, fTitleView wouldn't be reset and updated to the new column set. (unfortunately the column
 state is managed separately from the rest of the view state). That would cause crashes for example when switching
 to a directory with fewer columns and triggering a redraw of a column that shouldn't be there anymore. 
 Fixes #3710.

* TitleView::Reset didn't invalidate the view and would leave the old columns there until a redraw was
 triggered externally.

* Minor cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31378 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner 2009-07-03 00:11:19 +00:00
parent deb0a3ed2f
commit f207162e07
2 changed files with 6 additions and 4 deletions

View File

@ -7662,10 +7662,10 @@ BPoseView::SwitchDir(const entry_ref *newDirRef, AttributeStreamNode *node)
viewStateRestored = (fViewState != previousState);
}
if (viewStateRestored) {
// Make sure the title view reset its items
fTitleView->Reset();
// Make sure fTitleView is rebuilt, as fColumnList might have changed
fTitleView->Reset();
if (viewStateRestored) {
if (ViewMode() == kListMode && oldMode != kListMode) {
MoveBy(0, kTitleViewHeight + 1);
@ -7720,7 +7720,8 @@ BPoseView::SwitchDir(const entry_ref *newDirRef, AttributeStreamNode *node)
if (ContainerWindow()->IsTrash())
AddTrashPoses();
else AddPoses(TargetModel());
else
AddPoses(TargetModel());
TargetModel()->CloseNode();
Invalidate();

View File

@ -153,6 +153,7 @@ BTitleView::Reset()
break;
fTitleList.AddItem(new BColumnTitle(this, column));
}
Invalidate();
}