Code style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37331 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+38
-38
@@ -18,52 +18,52 @@ 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);
|
||||||
BInvoker(BMessage* message, BMessenger target);
|
BInvoker(BMessage* message, BMessenger target);
|
||||||
virtual ~BInvoker();
|
virtual ~BInvoker();
|
||||||
|
|
||||||
virtual status_t SetMessage(BMessage *message);
|
virtual status_t SetMessage(BMessage *message);
|
||||||
BMessage* Message() const;
|
BMessage* Message() const;
|
||||||
uint32 Command() const;
|
uint32 Command() const;
|
||||||
|
|
||||||
virtual status_t SetTarget(const BHandler *handler,
|
virtual status_t SetTarget(const BHandler *handler,
|
||||||
const BLooper *looper = NULL);
|
const BLooper *looper = NULL);
|
||||||
virtual status_t SetTarget(BMessenger messenger);
|
virtual status_t SetTarget(BMessenger messenger);
|
||||||
bool IsTargetLocal() const;
|
bool IsTargetLocal() const;
|
||||||
BHandler* Target(BLooper** _looper = NULL) const;
|
BHandler* Target(BLooper** _looper = NULL) const;
|
||||||
BMessenger Messenger() const;
|
BMessenger Messenger() const;
|
||||||
|
|
||||||
virtual status_t SetHandlerForReply(BHandler* handler);
|
virtual status_t SetHandlerForReply(BHandler* handler);
|
||||||
BHandler* HandlerForReply() const;
|
BHandler* HandlerForReply() const;
|
||||||
|
|
||||||
virtual status_t Invoke(BMessage* message = NULL);
|
virtual status_t Invoke(BMessage* message = NULL);
|
||||||
status_t InvokeNotify(BMessage* message,
|
status_t InvokeNotify(BMessage* message,
|
||||||
uint32 kind = B_CONTROL_INVOKED);
|
uint32 kind = B_CONTROL_INVOKED);
|
||||||
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();
|
||||||
|
|
||||||
BInvoker(const BInvoker&);
|
BInvoker(const BInvoker&);
|
||||||
BInvoker& operator=(const BInvoker&);
|
BInvoker& operator=(const BInvoker&);
|
||||||
|
|
||||||
BMessage* fMessage;
|
BMessage* fMessage;
|
||||||
BMessenger fMessenger;
|
BMessenger fMessenger;
|
||||||
BHandler* fReplyTo;
|
BHandler* fReplyTo;
|
||||||
bigtime_t fTimeout;
|
bigtime_t fTimeout;
|
||||||
uint32 fNotifyKind;
|
uint32 fNotifyKind;
|
||||||
uint32 _reserved[1];
|
uint32 _reserved[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _INVOKER_H
|
#endif // _INVOKER_H
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
|
|
||||||
|
|
||||||
App::App()
|
App::App()
|
||||||
: BApplication(kAppSignature),
|
:
|
||||||
fResources(read_resources(kAppSignature)),
|
BApplication(kAppSignature),
|
||||||
fMainWindow(NULL),
|
fResources(read_resources(kAppSignature)),
|
||||||
fSavedRefsReceived(NULL)
|
fMainWindow(NULL), fSavedRefsReceived(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,4 +118,3 @@ App::QuitRequested()
|
|||||||
|
|
||||||
return BApplication::QuitRequested();
|
return BApplication::QuitRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -24,27 +26,28 @@
|
|||||||
|
|
||||||
class VolumeMenuItem: public BMenuItem {
|
class VolumeMenuItem: public BMenuItem {
|
||||||
public:
|
public:
|
||||||
VolumeMenuItem(BVolume* volume, BMessage* message);
|
VolumeMenuItem(BVolume* volume, BMessage* message);
|
||||||
virtual ~VolumeMenuItem();
|
virtual ~VolumeMenuItem();
|
||||||
|
|
||||||
virtual void GetContentSize(float* width, float* height);
|
virtual void GetContentSize(float* width, float* height);
|
||||||
virtual void DrawContent();
|
virtual void DrawContent();
|
||||||
|
|
||||||
BVolume* Volume() const
|
BVolume* Volume() const
|
||||||
{ return fVolume; }
|
{ return fVolume; }
|
||||||
status_t Invoke()
|
status_t Invoke()
|
||||||
{ return BMenuItem::Invoke(); }
|
{ return BMenuItem::Invoke(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BBitmap* fIcon;
|
BBitmap* fIcon;
|
||||||
BVolume* fVolume;
|
BVolume* fVolume;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
VolumeMenuItem::VolumeMenuItem(BVolume* volume, BMessage* message)
|
VolumeMenuItem::VolumeMenuItem(BVolume* volume, BMessage* message)
|
||||||
: BMenuItem(kEmptyStr, message),
|
:
|
||||||
fIcon(new BBitmap(BRect(0, 0, 15, 15), B_RGBA32)),
|
BMenuItem(kEmptyStr, message),
|
||||||
fVolume(volume)
|
fIcon(new BBitmap(BRect(0, 0, 15, 15), B_RGBA32)),
|
||||||
|
fVolume(volume)
|
||||||
{
|
{
|
||||||
char name[B_PATH_NAME_LENGTH];
|
char name[B_PATH_NAME_LENGTH];
|
||||||
fVolume->GetName(name);
|
fVolume->GetName(name);
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ public:
|
|||||||
bool invoke = false);
|
bool invoke = false);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class VolumePopup;
|
class VolumePopup;
|
||||||
|
|
||||||
VolumePopup* fVolumePopup;
|
VolumePopup* fVolumePopup;
|
||||||
BButton* fRescanButton;
|
BButton* fRescanButton;
|
||||||
@@ -35,4 +36,3 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
#endif // CONTROLS_VIEW_H
|
#endif // CONTROLS_VIEW_H
|
||||||
|
|
||||||
|
|||||||
@@ -16,4 +16,3 @@ main()
|
|||||||
app.Run();
|
app.Run();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,9 +27,11 @@ 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),
|
:
|
||||||
fIcon(icon)
|
BView(frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW),
|
||||||
|
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()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|
||||||
@@ -16,22 +17,21 @@ struct FileInfo;
|
|||||||
|
|
||||||
class LeftView: public BView {
|
class LeftView: public BView {
|
||||||
public:
|
public:
|
||||||
LeftView(BRect frame, BBitmap* icon);
|
LeftView(BRect frame, BBitmap* icon);
|
||||||
virtual ~LeftView();
|
virtual ~LeftView();
|
||||||
|
|
||||||
virtual void Draw(BRect updateRect);
|
virtual void Draw(BRect updateRect);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BBitmap* fIcon;
|
BBitmap* fIcon;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class InfoWin: public BWindow {
|
class InfoWin: public BWindow {
|
||||||
public:
|
public:
|
||||||
InfoWin(BPoint location, FileInfo* info,
|
InfoWin(BPoint location, FileInfo* info,
|
||||||
BWindow* parent);
|
BWindow* parent);
|
||||||
virtual ~InfoWin();
|
virtual ~InfoWin();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INFO_WINDOW_H
|
#endif // INFO_WINDOW_H
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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,14 +126,15 @@ 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(),
|
||||||
fCurrentVolume(NULL),
|
fCurrentVolume(NULL),
|
||||||
fMouseOverInfo(),
|
fMouseOverInfo(),
|
||||||
fClicked(false),
|
fClicked(false),
|
||||||
fDragging(false)
|
fDragging(false)
|
||||||
{
|
{
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewColor(B_TRANSPARENT_COLOR);
|
||||||
SetLowColor(kWindowColor);
|
SetLowColor(kWindowColor);
|
||||||
@@ -849,5 +856,3 @@ PieView::_OpenInfo(FileInfo* info, BPoint p)
|
|||||||
tracker.SendMessage(&message);
|
tracker.SendMessage(&message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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,18 +19,19 @@
|
|||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
Scanner::Scanner(BVolume *v, BHandler *handler)
|
|
||||||
: BLooper(),
|
|
||||||
fListener(handler),
|
|
||||||
fDoneMessage(kScanDone),
|
|
||||||
fProgressMessage(kScanProgress),
|
|
||||||
|
|
||||||
fVolume(v),
|
Scanner::Scanner(BVolume *v, BHandler *handler)
|
||||||
fSnapshot(NULL),
|
:
|
||||||
fDesiredPath(),
|
BLooper(),
|
||||||
fTask(),
|
fListener(handler),
|
||||||
fBusy(false),
|
fDoneMessage(kScanDone),
|
||||||
fQuitRequested(false)
|
fProgressMessage(kScanProgress),
|
||||||
|
fVolume(v),
|
||||||
|
fSnapshot(NULL),
|
||||||
|
fDesiredPath(),
|
||||||
|
fTask(),
|
||||||
|
fBusy(false),
|
||||||
|
fQuitRequested(false)
|
||||||
{
|
{
|
||||||
fDoneMessage.AddPointer(kNameVolPtr, fVolume);
|
fDoneMessage.AddPointer(kNameVolPtr, fVolume);
|
||||||
fProgressMessage.AddPointer(kNameVolPtr, fVolume);
|
fProgressMessage.AddPointer(kNameVolPtr, fVolume);
|
||||||
@@ -271,5 +274,3 @@ Scanner::_ChangeToDesired()
|
|||||||
free(workPath);
|
free(workPath);
|
||||||
fDesiredPath.erase();
|
fDesiredPath.erase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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,11 +26,12 @@ static const char* kVolumeType = "application/x-vnd.Be-volume";
|
|||||||
|
|
||||||
|
|
||||||
FileInfo::FileInfo()
|
FileInfo::FileInfo()
|
||||||
: pseudo(false),
|
:
|
||||||
size(0),
|
pseudo(false),
|
||||||
count(0),
|
size(0),
|
||||||
parent(NULL),
|
count(0),
|
||||||
children()
|
parent(NULL),
|
||||||
|
children()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,4 +127,3 @@ VolumeSnapshot::~VolumeSnapshot()
|
|||||||
delete rootDir;
|
delete rootDir;
|
||||||
delete freeSpace;
|
delete freeSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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,8 +23,9 @@
|
|||||||
|
|
||||||
|
|
||||||
StatusView::StatusView(BRect rect)
|
StatusView::StatusView(BRect rect)
|
||||||
: BView(rect, NULL, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW),
|
:
|
||||||
fCurrentFileInfo(NULL)
|
BView(rect, NULL, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW),
|
||||||
|
fCurrentFileInfo(NULL)
|
||||||
{
|
{
|
||||||
SetViewColor(kWindowColor);
|
SetViewColor(kWindowColor);
|
||||||
|
|
||||||
@@ -130,5 +133,3 @@ StatusView::Show(const FileInfo* info)
|
|||||||
fCountView->SetText(kEmptyStr);
|
fCountView->SetText(kEmptyStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user