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:
@@ -48,7 +48,7 @@ public:
|
|||||||
fFunctionName.String());
|
fFunctionName.String());
|
||||||
}
|
}
|
||||||
|
|
||||||
~FunctionTracer()
|
~FunctionTracer()
|
||||||
{
|
{
|
||||||
debug_printf("%p -> %s}\n", fPointer, fPrepend.String());
|
debug_printf("%p -> %s}\n", fPointer, fPrepend.String());
|
||||||
sFunctionDepth--;
|
sFunctionDepth--;
|
||||||
@@ -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()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_key(char *chars, int32 offset)
|
print_key(char* chars, int32 offset)
|
||||||
{
|
{
|
||||||
int size = chars[offset++];
|
int size = chars[offset++];
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ print_key(char *chars, int32 offset)
|
|||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
// 2-, 3-, or 4-byte UTF-8 character
|
// 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)
|
if (str == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -48,11 +48,11 @@ TeamListItem::~TeamListItem()
|
|||||||
|
|
||||||
|
|
||||||
void
|
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 kHighlight = { 140, 140, 140, 0 };
|
||||||
rgb_color kBlack = { 0,0,0,0 };
|
rgb_color kBlack = { 0, 0, 0, 0 };
|
||||||
rgb_color kBlue = { 0,0,255,0 };
|
rgb_color kBlue = { 0, 0, 255, 0 };
|
||||||
|
|
||||||
BRect r(frame);
|
BRect r(frame);
|
||||||
|
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -20,14 +20,15 @@ public:
|
|||||||
TeamListItem(team_info& info);
|
TeamListItem(team_info& info);
|
||||||
virtual ~TeamListItem();
|
virtual ~TeamListItem();
|
||||||
|
|
||||||
virtual void DrawItem(BView* owner, BRect frame,
|
virtual void DrawItem(BView* owner, BRect frame,
|
||||||
bool complete = false);
|
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 IsSystemServer();
|
||||||
bool IsApplication();
|
bool IsApplication();
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ TeamMonitorWindow::TeamMonitorWindow()
|
|||||||
fListView = new BListView("teams");
|
fListView = new BListView("teams");
|
||||||
fListView->SetSelectionMessage(new BMessage(TM_SELECTED_TEAM));
|
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);
|
0, B_SUPPORTS_LAYOUT, false, true, B_FANCY_BORDER);
|
||||||
layout->AddView(scrollView);
|
layout->AddView(scrollView);
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ TeamMonitorWindow::TeamMonitorWindow()
|
|||||||
groupView = new BGroupView(B_HORIZONTAL);
|
groupView = new BGroupView(B_HORIZONTAL);
|
||||||
layout->AddView(groupView);
|
layout->AddView(groupView);
|
||||||
|
|
||||||
BButton *forceReboot = new BButton("force", "Force Reboot",
|
BButton* forceReboot = new BButton("force", "Force Reboot",
|
||||||
new BMessage(TM_FORCE_REBOOT));
|
new BMessage(TM_FORCE_REBOOT));
|
||||||
groupView->GroupLayout()->AddView(forceReboot);
|
groupView->GroupLayout()->AddView(forceReboot);
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ TeamMonitorWindow::~TeamMonitorWindow()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TeamMonitorWindow::MessageReceived(BMessage *msg)
|
TeamMonitorWindow::MessageReceived(BMessage* msg)
|
||||||
{
|
{
|
||||||
switch (msg->what) {
|
switch (msg->what) {
|
||||||
case SYSTEM_SHUTTING_DOWN:
|
case SYSTEM_SHUTTING_DOWN:
|
||||||
@@ -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,8 +256,9 @@ 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));
|
||||||
item->SetFound(false);
|
if (item != NULL)
|
||||||
|
item->SetFound(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 cookie = 0;
|
int32 cookie = 0;
|
||||||
@@ -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);
|
||||||
@@ -472,7 +472,7 @@ TeamDescriptionView::Draw(BRect rect)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TeamDescriptionView::GetPreferredSize(float *_width, float *_height)
|
TeamDescriptionView::GetPreferredSize(float* _width, float* _height)
|
||||||
{
|
{
|
||||||
if (_width != NULL) {
|
if (_width != NULL) {
|
||||||
float width = 0;
|
float width = 0;
|
||||||
@@ -503,7 +503,7 @@ TeamDescriptionView::GetPreferredSize(float *_width, float *_height)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TeamDescriptionView::SetItem(TeamListItem *item)
|
TeamDescriptionView::SetItem(TeamListItem* item)
|
||||||
{
|
{
|
||||||
fItem = item;
|
fItem = item;
|
||||||
Invalidate();
|
Invalidate();
|
||||||
|
|||||||
Reference in New Issue
Block a user