Even more style clean up patches by John Scipione from bug 7052.

(I modified BeMenu.h to have consistent style for pointer variables.)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40817 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Fredrik Holmqvist 2011-03-05 16:22:42 +00:00
parent a2dc49b516
commit c562239723
5 changed files with 38 additions and 36 deletions

View File

@ -26,9 +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 used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
of Be Incorporated in the United States and other countries. Other brand product trademarks of Be Incorporated in the United States and other countries. Other
names are registered trademarks or trademarks of their respective holders. brand product names are registered trademarks or trademarks of their respective
holders.
All rights reserved. All rights reserved.
*/ */
@ -42,7 +43,7 @@ All rights reserved.
class TBarView; class TBarView;
enum recent_type { enum recent_type {
kRecentDocuments = 0, kRecentDocuments = 0,
kRecentApplications, kRecentApplications,
kRecentFolders, kRecentFolders,
kRecentAppDocuments kRecentAppDocuments
@ -69,15 +70,15 @@ class TRecentsMenu : public BNavMenu {
private: private:
int32 fWhich; int32 fWhich;
entry_ref *fAppRef; entry_ref* fAppRef;
char *fSignature; char* fSignature;
int32 fRecentsCount; int32 fRecentsCount;
bool fRecentsEnabled; bool fRecentsEnabled;
int32 fItemIndex; int32 fItemIndex;
BMessage fRecentList; BMessage fRecentList;
TBarView *fBarView; TBarView* fBarView;
}; };
@ -102,7 +103,7 @@ class TBeMenu : public BNavMenu {
void AttachedToWindow(); void AttachedToWindow();
void DetachedFromWindow(); void DetachedFromWindow();
void ResetTargets(); void ResetTargets();
static BMessenger DefaultTarget(); static BMessenger DefaultTarget();
@ -118,15 +119,15 @@ class TBeMenu : public BNavMenu {
bool AddStandardBeMenuItems(); bool AddStandardBeMenuItems();
private: private:
virtual bool StartBuildingItemList(); virtual bool StartBuildingItemList();
virtual void DoneBuildingItemList(); virtual void DoneBuildingItemList();
virtual bool AddNextItem(); virtual bool AddNextItem();
virtual void ClearMenuBuildingState(); virtual void ClearMenuBuildingState();
// to keep track of the menu building state // to keep track of the menu building state
State fAddState; State fAddState;
TBarView *fBarView; TBarView* fBarView;
}; };
#endif /* _BE_MENU_H_ */ #endif /* _BE_MENU_H_ */

View File

@ -24,7 +24,7 @@ using BPrivate::B_WEEK_START_SUNDAY;
using BPrivate::B_WEEK_START_MONDAY; using BPrivate::B_WEEK_START_MONDAY;
// #pragma mark -- FlatButton // #pragma mark -- FlatButton
class FlatButton : public BButton { class FlatButton : public BButton {
@ -66,7 +66,7 @@ FlatButton::Draw(BRect updateRect)
} }
// #pragma mark -- CalendarMenuWindow // #pragma mark -- CalendarMenuWindow
enum { enum {

View File

@ -17,7 +17,8 @@ class BStringView;
namespace BPrivate { namespace BPrivate {
class BCalendarView; class BCalendarView;
} }
using BPrivate::BCalendarView;
using BPrivate::BCalendarView;
class CalendarMenuWindow : public BWindow { class CalendarMenuWindow : public BWindow {
@ -25,9 +26,9 @@ public:
CalendarMenuWindow(BPoint where); CalendarMenuWindow(BPoint where);
virtual ~CalendarMenuWindow(); virtual ~CalendarMenuWindow();
virtual void Show(); virtual void Show();
virtual void WindowActivated(bool active); virtual void WindowActivated(bool active);
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
private: private:
void _UpdateUI(const BDate& date); void _UpdateUI(const BDate& date);

View File

@ -26,9 +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 used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
of Be Incorporated in the United States and other countries. Other brand product trademarks of Be Incorporated in the United States and other countries. Other
names are registered trademarks or trademarks of their respective holders. brand product names are registered trademarks or trademarks of their respective
holders.
All rights reserved. All rights reserved.
*/ */
@ -60,11 +61,11 @@ AddRefsToBeMenu(const BMessage* m, entry_ref* subdirectory)
int32 count = 0; int32 count = 0;
uint32 type = 0; uint32 type = 0;
entry_ref ref; entry_ref ref;
m->GetInfo("refs", &type, &count); m->GetInfo("refs", &type, &count);
if (count <= 0) if (count <= 0)
return; return;
BPath path; BPath path;
BSymLink link; BSymLink link;
BDirectory dir; BDirectory dir;
@ -72,8 +73,7 @@ AddRefsToBeMenu(const BMessage* m, entry_ref* subdirectory)
ref = *subdirectory; ref = *subdirectory;
BEntry entry(&ref); BEntry entry(&ref);
if (entry.Exists()) { if (entry.Exists()) {
// if the ref is a file // if the ref is a file get the parent and convert it to a ref
// get the parent and convert it to a ref
if (entry.IsFile()) { if (entry.IsFile()) {
BEntry parent; BEntry parent;
entry.GetParent(&parent); entry.GetParent(&parent);
@ -81,7 +81,7 @@ AddRefsToBeMenu(const BMessage* m, entry_ref* subdirectory)
} }
} else } else
return; return;
dir.SetTo(&ref); dir.SetTo(&ref);
} else { } else {
if (find_directory(B_USER_DESKBAR_DIRECTORY, &path) == B_OK) if (find_directory(B_USER_DESKBAR_DIRECTORY, &path) == B_OK)
@ -89,13 +89,12 @@ AddRefsToBeMenu(const BMessage* m, entry_ref* subdirectory)
else else
return; return;
} }
for (long i = 0; i < count; i++) { for (long i = 0; i < count; i++) {
if (m->FindRef("refs", i, &ref) == B_NO_ERROR) { if (m->FindRef("refs", i, &ref) == B_NO_ERROR) {
BEntry entry(&ref); BEntry entry(&ref);
entry.GetPath(&path); entry.GetPath(&path);
dir.CreateSymLink(ref.name, path.Path(), &link); dir.CreateSymLink(ref.name, path.Path(), &link);
} }
} }

View File

@ -26,9 +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 used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
of Be Incorporated in the United States and other countries. Other brand product trademarks of Be Incorporated in the United States and other countries. Other
names are registered trademarks or trademarks of their respective holders. brand product names are registered trademarks or trademarks of their respective
holders.
All rights reserved. All rights reserved.
*/ */