In NotificationWindow, have AppGroupViews get deleted upon expiry.

I.e. once there are no more notifications in the AppGroupView, we get
the NotificationWindow to delete it. As a result of this change, we no
longer need the AppGroupView.cpp _ResizeViews() method.
This commit is contained in:
Alex Wilson 2012-01-14 21:31:02 +00:00
parent cbdd108a09
commit 80f96f761c
2 changed files with 14 additions and 33 deletions

View File

@ -203,17 +203,22 @@ AppGroupView::MessageReceived(BMessage* msg)
return;
infoview_t::iterator vIt = find(fInfo.begin(), fInfo.end(), view);
if (vIt == fInfo.end())
break;
if (vIt != fInfo.end()) {
fInfo.erase(vIt);
GetLayout()->RemoveView(view);
delete view;
fInfo.erase(vIt);
GetLayout()->RemoveView(view);
delete view;
fParent->PostMessage(msg);
if (!this->HasChildren()) {
Hide();
BMessage removeSelfMessage(kRemoveGroupView);
removeSelfMessage.AddPointer("view", this);
fParent->PostMessage(&removeSelfMessage);
}
_ResizeViews();
if (Window() != NULL)
Window()->PostMessage(msg);
break;
}
default:
@ -263,28 +268,6 @@ AppGroupView::Group() const
}
void
AppGroupView::_ResizeViews()
{
int32 children = fInfo.size();
if (!fCollapsed) {
for (int32 i = 0; i < children; i++) {
if (fInfo[i]->IsHidden())
fInfo[i]->Show();
}
} else {
for (int32 i = 0; i < children; i++)
if (!fInfo[i]->IsHidden())
fInfo[i]->Hide();
}
if (!IsHidden() && !HasChildren())
Hide();
fParent->Layout(true);
}
bool
AppGroupView::HasChildren()
{

View File

@ -35,8 +35,6 @@ public:
const BString& Group() const;
private:
void _ResizeViews();
BString fLabel;
NotificationWindow* fParent;
infoview_t fInfo;