Extract subchild cleanup to a function.
* No functional change intended.
This commit is contained in:
@@ -391,18 +391,7 @@ int YabInterface::CloseWindow(const char* view)
|
|||||||
yabcanvas->RemoveItem(child);
|
yabcanvas->RemoveItem(child);
|
||||||
|
|
||||||
// viewList->PrintOut();
|
// viewList->PrintOut();
|
||||||
BView *subchild;
|
CleanupSubchildView(child->ChildAt(0));
|
||||||
if(subchild = child->ChildAt(0))
|
|
||||||
while(subchild)
|
|
||||||
{
|
|
||||||
CleanupYabTabView(subchild);
|
|
||||||
if(viewList->GetView(subchild->Name()))
|
|
||||||
{
|
|
||||||
RemoveView(subchild);
|
|
||||||
viewList->DelView(subchild->Name());
|
|
||||||
}
|
|
||||||
subchild = subchild->NextSibling();
|
|
||||||
}
|
|
||||||
if(viewList->GetView(child->Name()))
|
if(viewList->GetView(child->Name()))
|
||||||
{
|
{
|
||||||
RemoveView(child);
|
RemoveView(child);
|
||||||
@@ -3366,18 +3355,7 @@ void YabInterface::WindowClear(const char* window)
|
|||||||
CleanupYabTabView(child);
|
CleanupYabTabView(child);
|
||||||
if(is_kind_of(child, YabBitmapView))
|
if(is_kind_of(child, YabBitmapView))
|
||||||
yabcanvas->RemoveItem(child);
|
yabcanvas->RemoveItem(child);
|
||||||
BView *subchild;
|
CleanupSubchildView(child->ChildAt(0));
|
||||||
if(subchild = child->ChildAt(0))
|
|
||||||
while(subchild)
|
|
||||||
{
|
|
||||||
CleanupYabTabView(subchild);
|
|
||||||
if(viewList->GetView(subchild->Name()))
|
|
||||||
{
|
|
||||||
RemoveView(subchild);
|
|
||||||
viewList->DelView(subchild->Name());
|
|
||||||
}
|
|
||||||
subchild = subchild->NextSibling();
|
|
||||||
}
|
|
||||||
if(viewList->GetView(child->Name()))
|
if(viewList->GetView(child->Name()))
|
||||||
{
|
{
|
||||||
RemoveView(child);
|
RemoveView(child);
|
||||||
@@ -3429,18 +3407,7 @@ void YabInterface::RemoveView(BView *myView)
|
|||||||
CleanupYabTabView(child);
|
CleanupYabTabView(child);
|
||||||
if(is_kind_of(child, YabBitmapView))
|
if(is_kind_of(child, YabBitmapView))
|
||||||
yabcanvas->RemoveItem(child);
|
yabcanvas->RemoveItem(child);
|
||||||
BView *subchild;
|
CleanupSubchildView(child->ChildAt(0));
|
||||||
if(subchild = child->ChildAt(0))
|
|
||||||
while(subchild)
|
|
||||||
{
|
|
||||||
CleanupYabTabView(subchild);
|
|
||||||
if(viewList->GetView(subchild->Name()))
|
|
||||||
{
|
|
||||||
RemoveView(subchild);
|
|
||||||
viewList->DelView(subchild->Name());
|
|
||||||
}
|
|
||||||
subchild = subchild->NextSibling();
|
|
||||||
}
|
|
||||||
if(viewList->GetView(child->Name()))
|
if(viewList->GetView(child->Name()))
|
||||||
{
|
{
|
||||||
RemoveView(child);
|
RemoveView(child);
|
||||||
@@ -3493,6 +3460,22 @@ void YabInterface::CleanupYabTabView(BView* view)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void YabInterface::CleanupSubchildView(BView* view)
|
||||||
|
{
|
||||||
|
if(view == NULL || viewList == NULL) return;
|
||||||
|
|
||||||
|
while(view)
|
||||||
|
{
|
||||||
|
CleanupYabTabView(view);
|
||||||
|
if(viewList->GetView(view->Name()))
|
||||||
|
{
|
||||||
|
RemoveView(view);
|
||||||
|
viewList->DelView(view->Name());
|
||||||
|
}
|
||||||
|
view = view->NextSibling();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void YabInterface::TextEdit(BRect frame, const char* title, int scrollbar, const char* window)
|
void YabInterface::TextEdit(BRect frame, const char* title, int scrollbar, const char* window)
|
||||||
{
|
{
|
||||||
YabView *myView = cast_as((BView*)viewList->GetView(window), YabView);
|
YabView *myView = cast_as((BView*)viewList->GetView(window), YabView);
|
||||||
|
|||||||
@@ -249,6 +249,7 @@
|
|||||||
BBitmap* loadImage(const char* name);
|
BBitmap* loadImage(const char* name);
|
||||||
static int compare(BListItem **firstArg, BListItem **secondArg);
|
static int compare(BListItem **firstArg, BListItem **secondArg);
|
||||||
void CleanupYabTabView(BView* view);
|
void CleanupYabTabView(BView* view);
|
||||||
|
void CleanupSubchildView(BView* view);
|
||||||
|
|
||||||
BTranslatorRoster *Roster;
|
BTranslatorRoster *Roster;
|
||||||
char ApplicationDirectory[1024];
|
char ApplicationDirectory[1024];
|
||||||
|
|||||||
Reference in New Issue
Block a user