Code style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37331 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Wim van der Meer
2010-07-02 03:07:18 +00:00
parent afa4fdf51e
commit 15676f3a87
19 changed files with 139 additions and 119 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ class BMessage;
class BInvoker { class BInvoker {
public: public:
BInvoker(); BInvoker();
BInvoker(BMessage* message, const BHandler* handler, BInvoker(BMessage* message, const BHandler* handler,
const BLooper* looper = NULL); const BLooper* looper = NULL);
@@ -45,12 +45,12 @@ class BInvoker {
status_t SetTimeout(bigtime_t timeout); status_t SetTimeout(bigtime_t timeout);
bigtime_t Timeout() const; bigtime_t Timeout() const;
protected: protected:
uint32 InvokeKind(bool* _notify = NULL); uint32 InvokeKind(bool* _notify = NULL);
void BeginInvokeNotify(uint32 kind = B_CONTROL_INVOKED); void BeginInvokeNotify(uint32 kind = B_CONTROL_INVOKED);
void EndInvokeNotify(); void EndInvokeNotify();
private: private:
virtual void _ReservedInvoker1(); virtual void _ReservedInvoker1();
virtual void _ReservedInvoker2(); virtual void _ReservedInvoker2();
virtual void _ReservedInvoker3(); virtual void _ReservedInvoker3();
+3 -4
View File
@@ -22,10 +22,10 @@
App::App() App::App()
: BApplication(kAppSignature), :
BApplication(kAppSignature),
fResources(read_resources(kAppSignature)), fResources(read_resources(kAppSignature)),
fMainWindow(NULL), fMainWindow(NULL), fSavedRefsReceived(NULL)
fSavedRefsReceived(NULL)
{ {
} }
@@ -118,4 +118,3 @@ App::QuitRequested()
return BApplication::QuitRequested(); return BApplication::QuitRequested();
} }
+1 -1
View File
@@ -9,6 +9,7 @@
#ifndef APP_H #ifndef APP_H
#define APP_H #define APP_H
#include <Application.h> #include <Application.h>
@@ -32,4 +33,3 @@ private:
}; };
#endif // APP_H #endif // APP_H
+1 -1
View File
@@ -9,6 +9,7 @@
#ifndef COMMON_H #ifndef COMMON_H
#define COMMON_H #define COMMON_H
#include <Entry.h> #include <Entry.h>
#include <GraphicsDefs.h> #include <GraphicsDefs.h>
#include <Resources.h> #include <Resources.h>
@@ -100,4 +101,3 @@ BResources* read_resources(const char* appSignature);
void size_to_string(off_t byteCount, char* name); void size_to_string(off_t byteCount, char* name);
#endif // COMMON_H #endif // COMMON_H
+7 -5
View File
@@ -6,6 +6,8 @@
* as long as it is accompanied by it's documentation and this copyright notice. * as long as it is accompanied by it's documentation and this copyright notice.
* The software comes with no warranty, etc. * The software comes with no warranty, etc.
*/ */
#include "ControlsView.h" #include "ControlsView.h"
#include <Bitmap.h> #include <Bitmap.h>
@@ -42,7 +44,8 @@ private:
VolumeMenuItem::VolumeMenuItem(BVolume* volume, BMessage* message) VolumeMenuItem::VolumeMenuItem(BVolume* volume, BMessage* message)
: BMenuItem(kEmptyStr, message), :
BMenuItem(kEmptyStr, message),
fIcon(new BBitmap(BRect(0, 0, 15, 15), B_RGBA32)), fIcon(new BBitmap(BRect(0, 0, 15, 15), B_RGBA32)),
fVolume(volume) fVolume(volume)
{ {
@@ -117,8 +120,9 @@ private:
ControlsView::VolumePopup::VolumePopup(BRect r) ControlsView::VolumePopup::VolumePopup(BRect r)
: BMenuField(r, NULL, kVolMenuLabel, new BPopUpMenu(kVolMenuDefault), :
false, B_FOLLOW_LEFT) BMenuField(r, NULL, kVolMenuLabel, new BPopUpMenu(kVolMenuDefault), false,
B_FOLLOW_LEFT)
{ {
SetViewColor(kWindowColor); SetViewColor(kWindowColor);
SetLowColor(kWindowColor); SetLowColor(kWindowColor);
@@ -295,5 +299,3 @@ ControlsView::FindDeviceFor(dev_t device, bool invoke)
{ {
return fVolumePopup->FindDeviceFor(device, invoke); return fVolumePopup->FindDeviceFor(device, invoke);
} }
+1 -1
View File
@@ -9,6 +9,7 @@
#ifndef CONTROLS_VIEW_H #ifndef CONTROLS_VIEW_H
#define CONTROLS_VIEW_H #define CONTROLS_VIEW_H
#include <Button.h> #include <Button.h>
#include <View.h> #include <View.h>
@@ -35,4 +36,3 @@ private:
#endif // CONTROLS_VIEW_H #endif // CONTROLS_VIEW_H
-1
View File
@@ -16,4 +16,3 @@ main()
app.Run(); app.Run();
return 0; return 0;
} }
+5 -3
View File
@@ -6,6 +6,8 @@
* as long as it is accompanied by it's documentation and this copyright notice. * as long as it is accompanied by it's documentation and this copyright notice.
* The software comes with no warranty, etc. * The software comes with no warranty, etc.
*/ */
#include "InfoWindow.h" #include "InfoWindow.h"
#include <stdio.h> #include <stdio.h>
@@ -25,8 +27,10 @@ using std::string;
using std::vector; using std::vector;
using std::pair; using std::pair;
LeftView::LeftView(BRect frame, BBitmap* icon) LeftView::LeftView(BRect frame, BBitmap* icon)
: BView(frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW), :
BView(frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW),
fIcon(icon) fIcon(icon)
{ {
SetViewColor(tint_color(kWindowColor, B_LIGHTEN_1_TINT)); SetViewColor(tint_color(kWindowColor, B_LIGHTEN_1_TINT));
@@ -174,5 +178,3 @@ InfoWin::InfoWin(BPoint p, FileInfo *f, BWindow* parent)
InfoWin::~InfoWin() InfoWin::~InfoWin()
{ {
} }
+1 -1
View File
@@ -9,6 +9,7 @@
#ifndef INFO_WINDOW_H #ifndef INFO_WINDOW_H
#define INFO_WINDOW_H #define INFO_WINDOW_H
#include <Window.h> #include <Window.h>
@@ -34,4 +35,3 @@ public:
}; };
#endif // INFO_WINDOW_H #endif // INFO_WINDOW_H
+6 -2
View File
@@ -7,6 +7,8 @@
* as long as it is accompanied by it's documentation and this copyright notice. * as long as it is accompanied by it's documentation and this copyright notice.
* The software comes with no warranty, etc. * The software comes with no warranty, etc.
*/ */
#include "MainWindow.h" #include "MainWindow.h"
#include <Application.h> #include <Application.h>
@@ -24,7 +26,8 @@ const float kMinWinSize = 275.0;
MainWindow::MainWindow(BRect pieRect) MainWindow::MainWindow(BRect pieRect)
: BWindow(pieRect, "DiskUsage", B_TITLED_WINDOW, :
BWindow(pieRect, "DiskUsage", B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE) B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE)
{ {
BRect r = Bounds(); BRect r = Bounds();
@@ -57,7 +60,8 @@ MainWindow::MainWindow(BRect pieRect)
// this bug, and Be said it's not a bug -- the Matrox driver actually uses // this bug, and Be said it's not a bug -- the Matrox driver actually uses
// a resolution of 1152x900 in that mode. Oh well. // a resolution of 1152x900 in that mode. Oh well.
Lock(); Lock();
float extraHeight = fControlsView->Bounds().Height() + fStatusView->Bounds().Height(); float extraHeight = fControlsView->Bounds().Height()
+ fStatusView->Bounds().Height();
float minHeight = kMinWinSize + extraHeight; float minHeight = kMinWinSize + extraHeight;
float maxHeight = BScreen(this).Frame().Height(); float maxHeight = BScreen(this).Frame().Height();
float maxWidth = maxHeight - extraHeight; float maxWidth = maxHeight - extraHeight;
+2
View File
@@ -10,6 +10,7 @@
#ifndef MAIN_WINDOW_H #ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H #define MAIN_WINDOW_H
#include <Window.h> #include <Window.h>
@@ -19,6 +20,7 @@ struct FileInfo;
class PieView; class PieView;
class StatusView; class StatusView;
class MainWindow: public BWindow { class MainWindow: public BWindow {
public: public:
MainWindow(BRect pieRect); MainWindow(BRect pieRect);
+12 -7
View File
@@ -7,11 +7,14 @@
* as long as it is accompanied by it's documentation and this copyright notice. * as long as it is accompanied by it's documentation and this copyright notice.
* The software comes with no warranty, etc. * The software comes with no warranty, etc.
*/ */
#include "PieView.h" #include "PieView.h"
#include <fs_info.h> #include <fs_info.h>
#include <math.h> #include <math.h>
#include <Alert.h>
#include <AppFileInfo.h> #include <AppFileInfo.h>
#include <Bitmap.h> #include <Bitmap.h>
#include <Entry.h> #include <Entry.h>
@@ -23,7 +26,6 @@
#include <Roster.h> #include <Roster.h>
#include <String.h> #include <String.h>
#include <Volume.h> #include <Volume.h>
#include <Alert.h>
#include <tracker_private.h> #include <tracker_private.h>
@@ -42,7 +44,7 @@ static const int32 kIdxRescan = 3;
// TODO: It would be nice to make a common base class for AppMenuItem and // TODO: It would be nice to make a common base class for AppMenuItem and
// VolMenuItem (menu items that include an icon). // VolMenuItem (menu items that include an icon).
class AppMenuItem: public BMenuItem { class AppMenuItem : public BMenuItem {
public: public:
AppMenuItem(const char* appSig, int category); AppMenuItem(const char* appSig, int category);
virtual ~AppMenuItem(); virtual ~AppMenuItem();
@@ -65,8 +67,12 @@ private:
}; };
AppMenuItem::AppMenuItem(const char* appSig, int category): AppMenuItem::AppMenuItem(const char* appSig, int category)
BMenuItem(kEmptyStr, NULL), fCategory(category), fIcon(NULL), fIsValid(false) :
BMenuItem(kEmptyStr, NULL),
fCategory(category),
fIcon(NULL),
fIsValid(false)
{ {
if (be_roster->FindApp(appSig, &fAppRef) == B_NO_ERROR) { if (be_roster->FindApp(appSig, &fAppRef) == B_NO_ERROR) {
fIcon = new BBitmap(BRect(0.0, 0.0, 15.0, 15.0), B_RGBA32); fIcon = new BBitmap(BRect(0.0, 0.0, 15.0, 15.0), B_RGBA32);
@@ -120,7 +126,8 @@ AppMenuItem::DrawContent()
PieView::PieView(BRect frame, MainWindow* window) PieView::PieView(BRect frame, MainWindow* window)
: BView(frame, NULL, B_FOLLOW_ALL, :
BView(frame, NULL, B_FOLLOW_ALL,
B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_SUBPIXEL_PRECISE), B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_SUBPIXEL_PRECISE),
fWindow(window), fWindow(window),
fScanners(), fScanners(),
@@ -849,5 +856,3 @@ PieView::_OpenInfo(FileInfo* info, BPoint p)
tracker.SendMessage(&message); tracker.SendMessage(&message);
} }
} }
+2 -1
View File
@@ -10,6 +10,7 @@
#ifndef PIE_VIEW_H #ifndef PIE_VIEW_H
#define PIE_VIEW_H #define PIE_VIEW_H
#include <View.h> #include <View.h>
#include <map> #include <map>
@@ -29,6 +30,7 @@ class MainWindow;
using std::map; using std::map;
using std::vector; using std::vector;
class PieView: public BView { class PieView: public BView {
public: public:
PieView(BRect frame, MainWindow* window); PieView(BRect frame, MainWindow* window);
@@ -92,4 +94,3 @@ private:
}; };
#endif // PIE_VIEW_H #endif // PIE_VIEW_H
+5 -4
View File
@@ -6,6 +6,8 @@
* as long as it is accompanied by it's documentation and this copyright notice. * as long as it is accompanied by it's documentation and this copyright notice.
* The software comes with no warranty, etc. * The software comes with no warranty, etc.
*/ */
#include "Scanner.h" #include "Scanner.h"
#include <stdlib.h> #include <stdlib.h>
@@ -17,12 +19,13 @@
using std::vector; using std::vector;
Scanner::Scanner(BVolume *v, BHandler *handler) Scanner::Scanner(BVolume *v, BHandler *handler)
: BLooper(), :
BLooper(),
fListener(handler), fListener(handler),
fDoneMessage(kScanDone), fDoneMessage(kScanDone),
fProgressMessage(kScanProgress), fProgressMessage(kScanProgress),
fVolume(v), fVolume(v),
fSnapshot(NULL), fSnapshot(NULL),
fDesiredPath(), fDesiredPath(),
@@ -271,5 +274,3 @@ Scanner::_ChangeToDesired()
free(workPath); free(workPath);
fDesiredPath.erase(); fDesiredPath.erase();
} }
+2 -1
View File
@@ -9,6 +9,7 @@
#ifndef SCANNER_H #ifndef SCANNER_H
#define SCANNER_H #define SCANNER_H
#include <string> #include <string>
#include <Looper.h> #include <Looper.h>
@@ -23,6 +24,7 @@ class BDirectory;
using std::string; using std::string;
class Scanner: public BLooper { class Scanner: public BLooper {
public: public:
Scanner(BVolume* volume, BHandler* handler); Scanner(BVolume* volume, BHandler* handler);
@@ -70,4 +72,3 @@ private:
}; };
#endif // SCANNER_H #endif // SCANNER_H
+4 -2
View File
@@ -6,6 +6,8 @@
* as long as it is accompanied by it's documentation and this copyright notice. * as long as it is accompanied by it's documentation and this copyright notice.
* The software comes with no warranty, etc. * The software comes with no warranty, etc.
*/ */
#include "Snapshot.h" #include "Snapshot.h"
#include <stdio.h> #include <stdio.h>
@@ -24,7 +26,8 @@ static const char* kVolumeType = "application/x-vnd.Be-volume";
FileInfo::FileInfo() FileInfo::FileInfo()
: pseudo(false), :
pseudo(false),
size(0), size(0),
count(0), count(0),
parent(NULL), parent(NULL),
@@ -124,4 +127,3 @@ VolumeSnapshot::~VolumeSnapshot()
delete rootDir; delete rootDir;
delete freeSpace; delete freeSpace;
} }
+2 -1
View File
@@ -9,6 +9,7 @@
#ifndef SNAPSHOT_H #ifndef SNAPSHOT_H
#define SNAPSHOT_H #define SNAPSHOT_H
#include <string> #include <string>
#include <vector> #include <vector>
@@ -21,6 +22,7 @@ class BVolume;
using std::string; using std::string;
using std::vector; using std::vector;
struct FileInfo { struct FileInfo {
FileInfo(); FileInfo();
~FileInfo(); ~FileInfo();
@@ -53,4 +55,3 @@ struct VolumeSnapshot {
}; };
#endif // SNAPSHOT_H #endif // SNAPSHOT_H
+4 -3
View File
@@ -6,6 +6,8 @@
* as long as it is accompanied by it's documentation and this copyright notice. * as long as it is accompanied by it's documentation and this copyright notice.
* The software comes with no warranty, etc. * The software comes with no warranty, etc.
*/ */
#include "StatusView.h" #include "StatusView.h"
#include <math.h> #include <math.h>
@@ -21,7 +23,8 @@
StatusView::StatusView(BRect rect) StatusView::StatusView(BRect rect)
: BView(rect, NULL, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW), :
BView(rect, NULL, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW),
fCurrentFileInfo(NULL) fCurrentFileInfo(NULL)
{ {
SetViewColor(kWindowColor); SetViewColor(kWindowColor);
@@ -130,5 +133,3 @@ StatusView::Show(const FileInfo* info)
fCountView->SetText(kEmptyStr); fCountView->SetText(kEmptyStr);
} }
} }
+1 -1
View File
@@ -9,6 +9,7 @@
#ifndef STATUS_VIEW_H #ifndef STATUS_VIEW_H
#define STATUS_VIEW_H #define STATUS_VIEW_H
#include <View.h> #include <View.h>
#include <StringView.h> #include <StringView.h>
#include <Rect.h> #include <Rect.h>
@@ -32,4 +33,3 @@ private:
#endif // STATUS_VIEW_H #endif // STATUS_VIEW_H