A bit of cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25718 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-05-30 09:07:06 +00:00
parent e4d2f9ba4f
commit 873066a8e1
1 changed files with 374 additions and 391 deletions

View File

@ -102,7 +102,7 @@ const int32 kMaxAddPosesChunk = 10;
namespace BPrivate {
extern bool delete_point(void *);
// ToDo: exterminate this
// TODO: exterminate this
}
const float kSlowScrollBucket = 30;
@ -364,8 +364,8 @@ BPoseView::RestoreColumnState(AttributeStreamNode *node)
// Clear old column list if neccessary
// Put items in the list in order so they can be checked
// for overlaps below.
// Put items in the list in order so they can be checked
// for overlaps below.
BObjectList<BColumn> tempSortedList;
for (;;) {
BColumn *column = BColumn::InstantiateFromStream(&stream,
@ -767,8 +767,7 @@ BPoseView::SavePoseLocations(BRect *frameIfDesktop)
}
delete [] (char *)extendedPoseInfo;
// ToDo:
// fix up this mess
// TODO: fix up this mess
}
}
}
@ -1324,9 +1323,9 @@ BPoseView::AddPosesTask(void *castToParams)
delete model;
continue;
}
// ToDo:
// we are only watching nodes that are visible and not zombies
// EntryCreated watches everything, which is probably more correct
// TODO: we are only watching nodes that are visible and
// not zombies. EntryCreated watches everything, which is
// probably more correct.
// clean this up
modelChunkIndex++;
@ -1823,8 +1822,7 @@ BPoseView::InsertPoseAfter(BPose *pose, int32 *index, int32 orientation,
BRect *invalidRect)
{
if (orientation == kInsertAfter) {
// ToDo:
// get rid of this
// TODO: get rid of this
(*index)++;
}
@ -3236,8 +3234,7 @@ BPoseView::CheckPoseVisibility(BRect *newFrame)
}
}
delete [] (char *)info;
// ToDo:
// fix up this mess
// TODO: fix up this mess
}
BRect rect(pose->CalcRect(this));
@ -3503,8 +3500,7 @@ BPoseView::SelectPose(BPose *pose, int32 index, bool scrollIntoView)
void
BPoseView::AddPoseToSelection(BPose *pose, int32 index, bool scrollIntoView)
{
// ToDo:
// need to check if pose is member of selection list
// TODO: need to check if pose is member of selection list
if (pose && !pose->IsSelected()) {
pose->Select(true);
fSelectionList->AddItem(pose);
@ -3531,9 +3527,8 @@ BPoseView::RemovePoseFromSelection(BPose *pose)
pose->Select(false);
if (ViewMode() == kListMode) {
// ToDo:
// need a simple call to CalcRect that works both in listView and icon view modes
// without the need for an index/pos
// TODO: need a simple call to CalcRect that works both in listView and
// icon view modes without the need for an index/pos
int32 count = fPoseList->CountItems();
BPoint loc(0, 0);
for (int32 index = 0; index < count; index++) {
@ -3673,8 +3668,7 @@ BPoseView::CanHandleDragSelection(const Model *target, const BMessage *dragMessa
if (CanCopyOrMoveForeignDrag(target, dragMessage))
return true;
// ToDo:
// collect all mime types here and pass into
// TODO: collect all mime types here and pass into
// target->IsDropTargetForList(mimeTypeList);
}
@ -3693,9 +3687,8 @@ BPoseView::CanHandleDragSelection(const Model *target, const BMessage *dragMessa
|| dragMessage->HasData(kMiniIconType, B_MESSAGE_TYPE)))
return true;
// ToDo:
// check for a drag message full of refs, feed a list of their types to
// target->IsDropTargetForList(mimeTypeList);
// TODO: check for a drag message full of refs, feed a list of their
// types to target->IsDropTargetForList(mimeTypeList);
return false;
}
@ -4045,8 +4038,7 @@ BPoseView::HandleDropCommon(BMessage *message, Model *targetModel, BPose *target
}
if (message->HasRef("refs")) {
// ToDo:
// decide here on copy, move or create symlink
// TODO: decide here on copy, move or create symlink
// look for specific command or bring up popup
// Unify this with local drag&drop
@ -4254,8 +4246,7 @@ BPoseView::HandleDropCommon(BMessage *message, Model *targetModel, BPose *target
bool ignoreTypes = (modifiers() & B_CONTROL_KEY) != 0;
if (targetModel) {
// ToDo:
// pick files to drop/launch on a case by case basis
// TODO: pick files to drop/launch on a case by case basis
if (targetModel->IsDirectory()) {
MoveSelectionInto(targetModel, srcWindow, containerWindow, buttons, dropPt,
false);
@ -4268,9 +4259,8 @@ BPoseView::HandleDropCommon(BMessage *message, Model *targetModel, BPose *target
if (poseView && !wasHandled) {
BPoint clickPt = message->FindPoint("click_pt");
// ToDo:
// removed check for root here need to do that, possibly at a different
// level
// TODO: removed check for root here need to do that, possibly at a
// different level
poseView->MoveSelectionTo(dropPt, clickPt, srcWindow);
}
@ -4672,8 +4662,7 @@ OneMetaMimeChanged(BPose *pose, Model *model, int32 index,
if (model->IconFrom() != kNode
&& model->IconFrom() != kUnknownSource
&& model->IconFrom() != kUnknownNotFromNode
// ToDo:
// add supertype compare
// TODO: add supertype compare
&& strcasecmp(model->MimeType(), type) == 0) {
// metamime change very likely affected the documents icon
@ -5244,8 +5233,7 @@ BPoseView::ConvertZombieToPose(Model *zombie, int32 index)
ReadPoseInfo(zombie, &poseInfo);
if (ShouldShowPose(zombie, &poseInfo))
// ToDo:
// handle symlinks here
// TODO: handle symlinks here
return CreatePose(zombie, &poseInfo);
delete zombie;
@ -6215,10 +6203,9 @@ BPoseView::ShowContextMenu(BPoint where)
void
BPoseView::MouseDown(BPoint where)
{
// ToDo:
// add asynch mouse tracking
//
// handle disposing of drag data lazily
// TODO: add asynch mouse tracking
// handle disposing of drag data lazily
DragStop();
BContainerWindow *window = ContainerWindow();
if (!window)
@ -6857,8 +6844,8 @@ BPoseView::DragSelectionRect(BPoint startPoint, bool shouldExtend)
fRealPivotPose = NULL;
}
// ToDo:
// SelectPosesListMode and SelectPosesIconMode are terrible and share most code
// TODO: SelectPosesListMode and SelectPosesIconMode are terrible and share
// most code
void
BPoseView::SelectPosesListMode(BRect selectionRect, BList **oldList)
@ -7951,8 +7938,7 @@ BPoseView::PinPointToValidRange(BPoint& origin)
void
BPoseView::UpdateScrollRange()
{
// ToDo:
// some calls to UpdateScrollRange don't do the right thing because
// TODO: some calls to UpdateScrollRange don't do the right thing because
// Extent doesn't return the right value (too early in PoseView lifetime??)
//
// This happened most with file panels, when opening a parent - added
@ -8649,10 +8635,10 @@ BPoseView::MouseMoved(BPoint mouseLoc, uint32 moveCode, const BMessage *message)
break;
}
// handle drag and drop
// handle drag and drop
bigtime_t now = system_time();
// use shift key to get around over-loading of Control key
// for context menus and auto-dnd menu
// use shift key to get around over-loading of Control key
// for context menus and auto-dnd menu
if (((modifiers() & B_SHIFT_KEY) && (now - clickTime) > 200000)
|| now - clickTime > dropActionDelay) {
// let go of button or pressing for a while, show menu now
@ -8672,8 +8658,7 @@ BPoseView::MouseMoved(BPoint mouseLoc, uint32 moveCode, const BMessage *message)
}
case B_EXITED_VIEW:
// ToDo:
// autoscroll here
// TODO: autoscroll here
if (!window->ContextMenu()) {
HiliteDropTarget(false);
fDropTarget = NULL;
@ -8776,7 +8761,7 @@ const int32 kMenuTrackMargin = 20;
bool
BPoseView::MenuTrackingHook(BMenu *menu, void *)
{
// return true if the menu should go away
// return true if the menu should go away
if (!menu->LockLooper())
return false;
@ -8785,8 +8770,8 @@ BPoseView::MenuTrackingHook(BMenu *menu, void *)
menu->GetMouse(&location, &buttons);
bool returnvalue = true;
// don't test for buttons up here and try to circumvent messaging
// lest you miss an invoke that will happen after the window goes away
// don't test for buttons up here and try to circumvent messaging
// lest you miss an invoke that will happen after the window goes away
BRect bounds(menu->Bounds());
bounds.InsetBy(-kMenuTrackMargin, -kMenuTrackMargin);
@ -8799,9 +8784,8 @@ BPoseView::MenuTrackingHook(BMenu *menu, void *)
menu->ConvertToScreen(&location);
int32 count = menu->CountItems();
for (int32 index = 0 ; index < count; index++) {
// iterate through all of the items in the menu
// if the submenu is showing,
// see if the mouse is in the submenu
// iterate through all of the items in the menu
// if the submenu is showing, see if the mouse is in the submenu
BMenuItem *item = menu->ItemAt(index);
if (item && item->Submenu()) {
BWindow *window = item->Submenu()->Window();
@ -8815,8 +8799,7 @@ BPoseView::MenuTrackingHook(BMenu *menu, void *)
}
window->Unlock();
if (inSubmenu) {
// only one menu can have its window open
// bail now
// only one menu can have its window open bail now
returnvalue = false;
break;
}