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

View File

@ -48,7 +48,7 @@ public:
fFunctionName.String());
}
~FunctionTracer()
~FunctionTracer()
{
debug_printf("%p -> %s}\n", fPointer, fPrepend.String());
sFunctionDepth--;
@ -208,6 +208,7 @@ KeyboardDevice::Start()
return fFD >= 0 ? B_OK : B_ERROR;
}
void
KeyboardDevice::Stop()
{

View File

@ -23,7 +23,7 @@
static void
print_key(char *chars, int32 offset)
print_key(char* chars, int32 offset)
{
int size = chars[offset++];
@ -41,7 +41,7 @@ print_key(char *chars, int32 offset)
default:
{
// 2-, 3-, or 4-byte UTF-8 character
char *str = new (std::nothrow) char[size + 1];
char* str = new (std::nothrow) char[size + 1];
if (str == NULL)
break;

View File

@ -48,11 +48,11 @@ TeamListItem::~TeamListItem()
void
TeamListItem::DrawItem(BView *owner, BRect frame, bool complete)
TeamListItem::DrawItem(BView* owner, BRect frame, bool complete)
{
rgb_color kHighlight = { 140,140,140,0 };
rgb_color kBlack = { 0,0,0,0 };
rgb_color kBlue = { 0,0,255,0 };
rgb_color kHighlight = { 140, 140, 140, 0 };
rgb_color kBlack = { 0, 0, 0, 0 };
rgb_color kBlue = { 0, 0, 255, 0 };
BRect r(frame);
@ -139,7 +139,8 @@ TeamListItem::IsSystemServer()
firstCall = false;
}
if (strncmp(systemServersPath.Path(), fInfo.args, strlen(systemServersPath.Path())) == 0)
if (strncmp(systemServersPath.Path(), fInfo.args,
strlen(systemServersPath.Path())) == 0)
return true;
if (strncmp(trackerPath.Path(), fInfo.args, strlen(trackerPath.Path())) == 0)

View File

@ -20,14 +20,15 @@ public:
TeamListItem(team_info& info);
virtual ~TeamListItem();
virtual void DrawItem(BView* owner, BRect frame,
virtual void DrawItem(BView* owner, BRect frame,
bool complete = false);
virtual void Update(BView* owner, const BFont* font);
virtual void Update(BView* owner, const BFont* font);
const team_info* GetInfo();
const BBitmap* LargeIcon() { return &fLargeIcon; };
const BPath* Path() { return &fPath; };
const BString* AppSignature() { return &fAppSignature; };
const team_info* GetInfo();
const BBitmap* LargeIcon() { return &fLargeIcon; };
const BPath* Path() { return &fPath; };
const BString* AppSignature() { return &fAppSignature; };
bool IsSystemServer();
bool IsApplication();

View File

@ -86,7 +86,7 @@ TeamMonitorWindow::TeamMonitorWindow()
fListView = new BListView("teams");
fListView->SetSelectionMessage(new BMessage(TM_SELECTED_TEAM));
BScrollView *scrollView = new BScrollView("scroll_teams", fListView,
BScrollView* scrollView = new BScrollView("scroll_teams", fListView,
0, B_SUPPORTS_LAYOUT, false, true, B_FANCY_BORDER);
layout->AddView(scrollView);
@ -111,7 +111,7 @@ TeamMonitorWindow::TeamMonitorWindow()
groupView = new BGroupView(B_HORIZONTAL);
layout->AddView(groupView);
BButton *forceReboot = new BButton("force", "Force Reboot",
BButton* forceReboot = new BButton("force", "Force Reboot",
new BMessage(TM_FORCE_REBOOT));
groupView->GroupLayout()->AddView(forceReboot);
@ -164,7 +164,7 @@ TeamMonitorWindow::~TeamMonitorWindow()
void
TeamMonitorWindow::MessageReceived(BMessage *msg)
TeamMonitorWindow::MessageReceived(BMessage* msg)
{
switch (msg->what) {
case SYSTEM_SHUTTING_DOWN:
@ -193,8 +193,8 @@ TeamMonitorWindow::MessageReceived(BMessage *msg)
case TM_KILL_APPLICATION:
{
TeamListItem* item = (TeamListItem*)fListView->ItemAt(
fListView->CurrentSelection());
TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(
fListView->CurrentSelection()));
if (item != NULL) {
kill_team(item->GetInfo()->team);
UpdateList();
@ -209,7 +209,6 @@ TeamMonitorWindow::MessageReceived(BMessage *msg)
BMessenger messenger(item->AppSignature()->String(),
item->GetInfo()->team);
messenger.SendMessage(B_QUIT_REQUESTED);
UpdateList();
}
break;
}
@ -226,10 +225,10 @@ TeamMonitorWindow::MessageReceived(BMessage *msg)
case TM_SELECTED_TEAM:
{
fKillButton->SetEnabled(fListView->CurrentSelection() >= 0);
TeamListItem* item = (TeamListItem*)fListView->ItemAt(
fListView->CurrentSelection());
TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(
fListView->CurrentSelection()));
fDescriptionView->SetItem(item);
fQuitButton->SetEnabled(item && item->IsApplication());
fQuitButton->SetEnabled(item != NULL && item->IsApplication());
break;
}
case TM_CANCEL:
@ -257,8 +256,9 @@ TeamMonitorWindow::UpdateList()
bool changed = false;
for (int32 i = 0; i < fListView->CountItems(); i++) {
TeamListItem *item = (TeamListItem*)fListView->ItemAt(i);
item->SetFound(false);
TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(i));
if (item != NULL)
item->SetFound(false);
}
int32 cookie = 0;
@ -269,8 +269,8 @@ TeamMonitorWindow::UpdateList()
bool found = false;
for (int32 i = 0; i < fListView->CountItems(); i++) {
TeamListItem *item = (TeamListItem*)fListView->ItemAt(i);
if (item->GetInfo()->team == info.team) {
TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(i));
if (item != NULL && item->GetInfo()->team == info.team) {
item->SetFound(true);
found = true;
}
@ -287,8 +287,8 @@ TeamMonitorWindow::UpdateList()
}
for (int32 i = fListView->CountItems() - 1; i >= 0; i--) {
TeamListItem *item = (TeamListItem*)fListView->ItemAt(i);
if (!item->Found()) {
TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(i));
if (item != NULL && !item->Found()) {
if (item == fDescriptionView->Item()) {
fDescriptionView->SetItem(NULL);
fKillButton->SetEnabled(false);
@ -472,7 +472,7 @@ TeamDescriptionView::Draw(BRect rect)
void
TeamDescriptionView::GetPreferredSize(float *_width, float *_height)
TeamDescriptionView::GetPreferredSize(float* _width, float* _height)
{
if (_width != NULL) {
float width = 0;
@ -503,7 +503,7 @@ TeamDescriptionView::GetPreferredSize(float *_width, float *_height)
void
TeamDescriptionView::SetItem(TeamListItem *item)
TeamDescriptionView::SetItem(TeamListItem* item)
{
fItem = item;
Invalidate();