Cleanup. Removal of superfluous UpdateList() call.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41216 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström
2011-04-11 16:55:56 +00:00
parent 4787e491e6
commit fcde0c6292
5 changed files with 34 additions and 31 deletions
@@ -208,6 +208,7 @@ KeyboardDevice::Start()
return fFD >= 0 ? B_OK : B_ERROR; return fFD >= 0 ? B_OK : B_ERROR;
} }
void void
KeyboardDevice::Stop() KeyboardDevice::Stop()
{ {
@@ -139,7 +139,8 @@ TeamListItem::IsSystemServer()
firstCall = false; firstCall = false;
} }
if (strncmp(systemServersPath.Path(), fInfo.args, strlen(systemServersPath.Path())) == 0) if (strncmp(systemServersPath.Path(), fInfo.args,
strlen(systemServersPath.Path())) == 0)
return true; return true;
if (strncmp(trackerPath.Path(), fInfo.args, strlen(trackerPath.Path())) == 0) if (strncmp(trackerPath.Path(), fInfo.args, strlen(trackerPath.Path())) == 0)
@@ -28,6 +28,7 @@ public:
const BBitmap* LargeIcon() { return &fLargeIcon; }; const BBitmap* LargeIcon() { return &fLargeIcon; };
const BPath* Path() { return &fPath; }; const BPath* Path() { return &fPath; };
const BString* AppSignature() { return &fAppSignature; }; const BString* AppSignature() { return &fAppSignature; };
bool IsSystemServer(); bool IsSystemServer();
bool IsApplication(); bool IsApplication();
@@ -193,8 +193,8 @@ TeamMonitorWindow::MessageReceived(BMessage *msg)
case TM_KILL_APPLICATION: case TM_KILL_APPLICATION:
{ {
TeamListItem* item = (TeamListItem*)fListView->ItemAt( TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(
fListView->CurrentSelection()); fListView->CurrentSelection()));
if (item != NULL) { if (item != NULL) {
kill_team(item->GetInfo()->team); kill_team(item->GetInfo()->team);
UpdateList(); UpdateList();
@@ -209,7 +209,6 @@ TeamMonitorWindow::MessageReceived(BMessage *msg)
BMessenger messenger(item->AppSignature()->String(), BMessenger messenger(item->AppSignature()->String(),
item->GetInfo()->team); item->GetInfo()->team);
messenger.SendMessage(B_QUIT_REQUESTED); messenger.SendMessage(B_QUIT_REQUESTED);
UpdateList();
} }
break; break;
} }
@@ -226,10 +225,10 @@ TeamMonitorWindow::MessageReceived(BMessage *msg)
case TM_SELECTED_TEAM: case TM_SELECTED_TEAM:
{ {
fKillButton->SetEnabled(fListView->CurrentSelection() >= 0); fKillButton->SetEnabled(fListView->CurrentSelection() >= 0);
TeamListItem* item = (TeamListItem*)fListView->ItemAt( TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(
fListView->CurrentSelection()); fListView->CurrentSelection()));
fDescriptionView->SetItem(item); fDescriptionView->SetItem(item);
fQuitButton->SetEnabled(item && item->IsApplication()); fQuitButton->SetEnabled(item != NULL && item->IsApplication());
break; break;
} }
case TM_CANCEL: case TM_CANCEL:
@@ -257,7 +256,8 @@ TeamMonitorWindow::UpdateList()
bool changed = false; bool changed = false;
for (int32 i = 0; i < fListView->CountItems(); i++) { for (int32 i = 0; i < fListView->CountItems(); i++) {
TeamListItem *item = (TeamListItem*)fListView->ItemAt(i); TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(i));
if (item != NULL)
item->SetFound(false); item->SetFound(false);
} }
@@ -269,8 +269,8 @@ TeamMonitorWindow::UpdateList()
bool found = false; bool found = false;
for (int32 i = 0; i < fListView->CountItems(); i++) { for (int32 i = 0; i < fListView->CountItems(); i++) {
TeamListItem *item = (TeamListItem*)fListView->ItemAt(i); TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(i));
if (item->GetInfo()->team == info.team) { if (item != NULL && item->GetInfo()->team == info.team) {
item->SetFound(true); item->SetFound(true);
found = true; found = true;
} }
@@ -287,8 +287,8 @@ TeamMonitorWindow::UpdateList()
} }
for (int32 i = fListView->CountItems() - 1; i >= 0; i--) { for (int32 i = fListView->CountItems() - 1; i >= 0; i--) {
TeamListItem *item = (TeamListItem*)fListView->ItemAt(i); TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(i));
if (!item->Found()) { if (item != NULL && !item->Found()) {
if (item == fDescriptionView->Item()) { if (item == fDescriptionView->Item()) {
fDescriptionView->SetItem(NULL); fDescriptionView->SetItem(NULL);
fKillButton->SetEnabled(false); fKillButton->SetEnabled(false);