Patch by Takashi Murai: Style cleanup and fix an untranslated string in the navigation context menus.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38859 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent
2010-09-30 00:37:52 +00:00
parent 9cdd37b474
commit 7c8978a92c
+36 -23
View File
@@ -26,10 +26,10 @@ Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders.
All rights reserved.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
trademarks of Be Incorporated in the United States and other countries.
Other brand product names are registered trademarks or trademarks of
their respective holders. All rights reserved.
*/
// NavMenu is a hierarchical menu of volumes, folders, files and queries
@@ -77,7 +77,8 @@ enum nav_flags {
bool
SpringLoadedFolderCompareMessages(const BMessage *incoming, const BMessage *dragmessage)
SpringLoadedFolderCompareMessages(const BMessage* incoming,
const BMessage* dragmessage)
{
if (!dragmessage || !incoming)
return false;
@@ -91,7 +92,8 @@ SpringLoadedFolderCompareMessages(const BMessage *incoming, const BMessage *drag
}
bool inRefMatch = false;
for (int32 dragIndex=0; dragmessage->HasRef("refs", dragIndex); dragIndex++) {
for (int32 dragIndex = 0; dragmessage->HasRef("refs", dragIndex);
dragIndex++) {
entry_ref dragRef;
if (dragmessage->FindRef("refs", dragIndex, &dragRef) != B_OK) {
inRefMatch = false;
@@ -125,7 +127,8 @@ SpringLoadedFolderCompareMessages(const BMessage *incoming, const BMessage *drag
void
SpringLoadedFolderSetMenuStates(const BMenu* menu, const BObjectList<BString> *typeslist)
SpringLoadedFolderSetMenuStates(const BMenu* menu,
const BObjectList<BString> *typeslist)
{
if (!menu || !typeslist)
return;
@@ -173,7 +176,8 @@ SpringLoadedFolderSetMenuStates(const BMenu* menu, const BObjectList<BString> *t
void
SpringLoadedFolderAddUniqueTypeToList(entry_ref *ref, BObjectList<BString> *typeslist)
SpringLoadedFolderAddUniqueTypeToList(entry_ref* ref,
BObjectList<BString> *typeslist)
{
if (!ref || !typeslist)
return;
@@ -217,7 +221,8 @@ SpringLoadedFolderAddUniqueTypeToList(entry_ref *ref, BObjectList<BString> *type
void
SpringLoadedFolderCacheDragData(const BMessage *incoming, BMessage **message, BObjectList<BString> **typeslist)
SpringLoadedFolderCacheDragData(const BMessage* incoming, BMessage* *message,
BObjectList<BString> **typeslist)
{
if (!incoming)
return;
@@ -266,7 +271,8 @@ BNavMenu::BNavMenu(const char *title, uint32 message, const BHandler *target,
// add the parent window to the invocation message so that it
// can be closed if option modifier held down during invocation
BContainerWindow *originatingWindow = dynamic_cast<BContainerWindow *>(fParentWindow);
BContainerWindow* originatingWindow =
dynamic_cast<BContainerWindow *>(fParentWindow);
if (originatingWindow)
fMessage.AddData("nodeRefsToClose", B_RAW_TYPE,
originatingWindow->TargetModel()->NodeRef(), sizeof (node_ref));
@@ -276,8 +282,9 @@ BNavMenu::BNavMenu(const char *title, uint32 message, const BHandler *target,
}
BNavMenu::BNavMenu(const char *title, uint32 message, const BMessenger &messenger,
BWindow *parentWindow, const BObjectList<BString> *list)
BNavMenu::BNavMenu(const char* title, uint32 message,
const BMessenger& messenger, BWindow* parentWindow,
const BObjectList<BString> *list)
: BSlowMenu(title),
fMessage(message),
fMessenger(messenger),
@@ -293,7 +300,8 @@ BNavMenu::BNavMenu(const char *title, uint32 message, const BMessenger &messenge
// add the parent window to the invocation message so that it
// can be closed if option modifier held down during invocation
BContainerWindow *originatingWindow = dynamic_cast<BContainerWindow *>(fParentWindow);
BContainerWindow* originatingWindow =
dynamic_cast<BContainerWindow *>(fParentWindow);
if (originatingWindow)
fMessage.AddData("nodeRefsToClose", B_RAW_TYPE,
originatingWindow->TargetModel()->NodeRef(), sizeof (node_ref));
@@ -403,7 +411,8 @@ BNavMenu::StartBuildingItemList()
status_t status = entry.GetParent(&parent);
// if ref is the root item then build list of volume root dirs
fFlags = uint8((fFlags & ~kVolumesOnly) | (status == B_ENTRY_NOT_FOUND ? kVolumesOnly : 0));
fFlags = uint8((fFlags & ~kVolumesOnly)
| (status == B_ENTRY_NOT_FOUND ? kVolumesOnly : 0));
if (fFlags & kVolumesOnly)
return true;
@@ -415,7 +424,8 @@ BNavMenu::StartBuildingItemList()
fContainer = new QueryEntryListCollection(&startModel);
else if (startModel.IsDesktop()) {
fIteratingDesktop = true;
fContainer = DesktopPoseView::InitDesktopDirentIterator(0, startModel.EntryRef());
fContainer = DesktopPoseView::InitDesktopDirentIterator(
0, startModel.EntryRef());
AddRootItemsIfNeeded();
AddTrashItem();
} else if (startModel.IsTrash()) {
@@ -717,7 +727,8 @@ BNavMenu::DoneBuildingItemList()
&& entry.GetParent(&entry) == B_OK) {
Model model(&entry, true);
BLooper* looper;
AddNavParentDir(&model,fMessage.what,fMessenger.Target(&looper));
AddNavParentDir(&model, fMessage.what,
fMessenger.Target(&looper));
}
}
@@ -755,8 +766,8 @@ BNavMenu::AddNavDir(const Model *model, uint32 what, BHandler *target,
if (populateSubmenu) {
BNavMenu* navMenu = new BNavMenu(model->Name(), what, target);
navMenu->SetNavDir(model->EntryRef());
navMenu->InitTrackingHook(fTrackingHook.fTrackingHook, &(fTrackingHook.fTarget),
fTrackingHook.fDragMessage);
navMenu->InitTrackingHook(fTrackingHook.fTrackingHook,
&(fTrackingHook.fTarget), fTrackingHook.fDragMessage);
item = new ModelMenuItem(model, navMenu);
item->SetMessage(message);
} else
@@ -767,7 +778,8 @@ BNavMenu::AddNavDir(const Model *model, uint32 what, BHandler *target,
void
BNavMenu::AddNavParentDir(const char *name,const Model *model,uint32 what,BHandler *target)
BNavMenu::AddNavParentDir(const char* name,const Model* model,
uint32 what, BHandler* target)
{
BNavMenu* menu = new BNavMenu(name, what, target);
menu->SetNavDir(model->EntryRef());
@@ -788,7 +800,7 @@ BNavMenu::AddNavParentDir(const char *name,const Model *model,uint32 what,BHandl
void
BNavMenu::AddNavParentDir(const Model* model, uint32 what, BHandler* target)
{
AddNavParentDir("parent folder",model,what,target);
AddNavParentDir(B_TRANSLATE("parent folder"),model, what, target);
}
@@ -828,8 +840,8 @@ BNavMenu::Target()
TrackingHookData*
BNavMenu::InitTrackingHook(bool (*hook)(BMenu *, void *), const BMessenger *target,
const BMessage *dragMessage)
BNavMenu::InitTrackingHook(bool (*hook)(BMenu*, void*),
const BMessenger* target, const BMessage* dragMessage)
{
fTrackingHook.fTrackingHook = hook;
if (target)
@@ -841,7 +853,8 @@ BNavMenu::InitTrackingHook(bool (*hook)(BMenu *, void *), const BMessenger *targ
void
BNavMenu::SetTrackingHookDeep(BMenu *menu, bool (*func)(BMenu *, void *), void *state)
BNavMenu::SetTrackingHookDeep(BMenu* menu, bool (*func)(BMenu*, void*),
void* state)
{
menu->SetTrackingHook(func, state);
int32 count = menu->CountItems();