Tracker: obligatory round of style fixes

* Explicit NULL checks
* whitespace
* single line if gets no {}'s
*
This commit is contained in:
John Scipione 2014-07-18 10:42:06 -04:00
parent 61dec7d2ec
commit 6527415d5a
3 changed files with 6 additions and 8 deletions

View File

@ -2674,12 +2674,11 @@ BContainerWindow::ShowContextMenu(BPoint loc, const entry_ref* ref, BView*)
PoseView()->ConvertToScreen(&global); PoseView()->ConvertToScreen(&global);
PoseView()->CommitActivePose(); PoseView()->CommitActivePose();
if (ref) { if (ref != NULL) {
// clicked on a pose, show file or volume context menu // clicked on a pose, show file or volume context menu
Model model(ref); Model model(ref);
if (model.IsTrash()) { if (model.IsTrash()) {
if (fTrashContextMenu->Window() || Dragging()) if (fTrashContextMenu->Window() || Dragging())
return; return;
@ -2693,7 +2692,6 @@ BContainerWindow::ShowContextMenu(BPoint loc, const entry_ref* ref, BView*)
SetupNavigationMenu(ref, fTrashContextMenu); SetupNavigationMenu(ref, fTrashContextMenu);
fTrashContextMenu->Go(global, true, true, true); fTrashContextMenu->Go(global, true, true, true);
} else { } else {
bool showAsVolume = false; bool showAsVolume = false;
bool filePanel = PoseView()->IsFilePanel(); bool filePanel = PoseView()->IsFilePanel();
@ -3072,9 +3070,9 @@ BContainerWindow::BuildMimeTypeList(BObjectList<BString> &mimeTypes)
if (pose->TargetModel()->IsSymLink()) { if (pose->TargetModel()->IsSymLink()) {
Model* resolved = new Model( Model* resolved = new Model(
pose->TargetModel()->EntryRef(), true, true); pose->TargetModel()->EntryRef(), true, true);
if (resolved->InitCheck() == B_OK) { if (resolved->InitCheck() == B_OK)
AddMimeTypeString(mimeTypes, resolved); AddMimeTypeString(mimeTypes, resolved);
}
delete resolved; delete resolved;
} }
} }
@ -3096,7 +3094,7 @@ BContainerWindow::BuildAddOnMenu(BMenu* menu)
return; return;
menu = item->Submenu(); menu = item->Submenu();
if (!menu) if (menu == NULL)
return; return;
menu->SetFont(be_plain_font); menu->SetFont(be_plain_font);

View File

@ -184,7 +184,7 @@ OpenWithContainerWindow::NewPoseView(Model*, BRect rect, uint32)
OpenWithPoseView* OpenWithPoseView*
OpenWithContainerWindow::PoseView() const OpenWithContainerWindow::PoseView() const
{ {
ASSERT(dynamic_cast<OpenWithPoseView*>(fPoseView)); ASSERT(dynamic_cast<OpenWithPoseView*>(fPoseView) != NULL);
return static_cast<OpenWithPoseView*>(fPoseView); return static_cast<OpenWithPoseView*>(fPoseView);
} }

View File

@ -1030,7 +1030,7 @@ TTracker::OpenContainerWindow(Model* model, BMessage* originalRefsList,
if (originalRefsList == NULL) { if (originalRefsList == NULL) {
// when passing just a single model, stuff it's entry in a single // when passing just a single model, stuff it's entry in a single
// element list anyway // element list anyway
ASSERT(model); ASSERT(model != NULL);
refList = new BMessage; refList = new BMessage;
refList->AddRef("refs", model->EntryRef()); refList->AddRef("refs", model->EntryRef());
delete model; delete model;