Style cleanup, no functional changes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38782 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin
2010-09-22 08:21:42 +00:00
parent 8f60d419c5
commit db2c7eeb49
5 changed files with 86 additions and 79 deletions
+5 -6
View File
@@ -165,7 +165,8 @@ parse_arguments(int argc, const char* const* argv, bool noOutput,
} }
// #pragma mark - // #pragma mark - Debugger application class
class Debugger : public BApplication, private TeamDebugger::Listener { class Debugger : public BApplication, private TeamDebugger::Listener {
public: public:
@@ -190,7 +191,8 @@ private:
TeamDebugger* _FindTeamDebugger(team_id teamID) const; TeamDebugger* _FindTeamDebugger(team_id teamID) const;
TeamDebugger* _StartTeamDebugger(team_id teamID, TeamDebugger* _StartTeamDebugger(team_id teamID,
thread_id threadID = -1, bool stopInMain = false); thread_id threadID = -1,
bool stopInMain = false);
private: private:
SettingsManager fSettingsManager; SettingsManager fSettingsManager;
TeamDebuggerList fTeamDebuggers; TeamDebuggerList fTeamDebuggers;
@@ -239,7 +241,7 @@ Debugger::MessageReceived(BMessage* message)
if (fTeamsWindow) if (fTeamsWindow)
fTeamsWindow->Activate(true); fTeamsWindow->Activate(true);
else { else {
fTeamsWindow = new TeamsWindow(); fTeamsWindow = new(std::nothrow) TeamsWindow(&fSettingsManager);
fTeamsWindow->Show(); fTeamsWindow->Show();
} }
break; break;
@@ -399,9 +401,6 @@ Debugger::QuitRequested()
void void
Debugger::Quit() Debugger::Quit()
{ {
printf("Debugger::Quit(): fRunningTeamDebuggers = %ld, fTeamsWindow = %p\n",
fRunningTeamDebuggers, fTeamsWindow);
// don't quit before all team debuggers have been quit // don't quit before all team debuggers have been quit
if (fRunningTeamDebuggers <= 0 && fTeamsWindow == NULL) if (fRunningTeamDebuggers <= 0 && fTeamsWindow == NULL)
BApplication::Quit(); BApplication::Quit();
@@ -21,7 +21,8 @@
TeamListItem::TeamListItem(team_info& info) TeamListItem::TeamListItem(team_info& info)
: BStringItem("", false), :
BStringItem("", false),
fIcon(NULL) fIcon(NULL)
{ {
_SetTo(info); _SetTo(info);
@@ -29,7 +30,8 @@ TeamListItem::TeamListItem(team_info & info)
TeamListItem::TeamListItem(team_id team) TeamListItem::TeamListItem(team_id team)
: BStringItem("", false), :
BStringItem("", false),
fIcon(NULL) fIcon(NULL)
{ {
team_info info; team_info info;
@@ -174,7 +176,8 @@ TeamListItem::_SetTo(team_info & info)
TeamsListView::TeamsListView(BRect frame, const char* name) TeamsListView::TeamsListView(BRect frame, const char* name)
: BListView(frame, name, B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL), :
BListView(frame, name, B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL),
fUpdateRunner(NULL) fUpdateRunner(NULL)
{ {
team_info tmi; team_info tmi;
@@ -310,7 +313,7 @@ TeamsListView::_UpdateList()
TeamListItem* item; TeamListItem* item;
int32 index = 0; int32 index = 0;
// NOTA: assuming get_next_team_info() returns team ordered by team ID... // NOTA: assuming get_next_team_info() returns teams ordered by team ID...
while (get_next_team_info(&tmi_cookie, &tmi) == B_OK) { while (get_next_team_info(&tmi_cookie, &tmi) == B_OK) {
item = (TeamListItem*) ItemAt(index); item = (TeamListItem*) ItemAt(index);
@@ -322,11 +325,11 @@ TeamsListView::_UpdateList()
if (!item || tmi.team != item->TeamID()) { if (!item || tmi.team != item->TeamID()) {
// Team not found in known teams list: insert an new item // Team not found in known teams list: insert an new item
TeamListItem * item = new TeamListItem(tmi); TeamListItem* newItem = new TeamListItem(tmi);
if (!item) if (!item)
index++; // No item with team id bigger found: insert at list end index++; // No item with team id bigger found: insert at list end
AddItem(item, index); AddItem(newItem, index);
} }
index++; // Move list sync head. index++; // Move list sync head.
} }
@@ -18,7 +18,6 @@ class TeamListItem : public BStringItem {
public: public:
TeamListItem(team_info & teamInfo); TeamListItem(team_info & teamInfo);
TeamListItem(team_id teamId); TeamListItem(team_id teamId);
virtual ~TeamListItem(); virtual ~TeamListItem();
public: public:
@@ -3,6 +3,7 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#include <new>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -16,13 +17,16 @@
#include <Path.h> #include <Path.h>
#include "MessageCodes.h" #include "MessageCodes.h"
#include "SettingsManager.h"
#include "TeamsWindow.h" #include "TeamsWindow.h"
#include "TeamsListView.h" #include "TeamsListView.h"
TeamsWindow::TeamsWindow() TeamsWindow::TeamsWindow(SettingsManager* settingsManager)
: BWindow(BRect(100, 100, 500, 250), "Teams", B_DOCUMENT_WINDOW, :
B_ASYNCHRONOUS_CONTROLS) BWindow(BRect(100, 100, 500, 250), "Teams", B_DOCUMENT_WINDOW,
B_ASYNCHRONOUS_CONTROLS),
fSettingsManager(settingsManager)
{ {
BMessage settings; BMessage settings;
_LoadSettings(settings); _LoadSettings(settings);
@@ -11,11 +11,12 @@
class BListView; class BListView;
class BFile; class BFile;
class BMessage; class BMessage;
class SettingsManager;
class TeamsWindow : public BWindow { class TeamsWindow : public BWindow {
public: public:
TeamsWindow(); TeamsWindow(SettingsManager* settingsManager);
virtual ~TeamsWindow(); virtual ~TeamsWindow();
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
@@ -29,6 +30,7 @@ private:
private: private:
BListView* fTeamsListView; BListView* fTeamsListView;
SettingsManager* fSettingsManager;
}; };