Tracker: init member vars, CID 991720

This commit is contained in:
John Scipione 2014-07-23 00:51:27 -04:00
parent a45f995d3c
commit ec23596a73

View File

@ -432,8 +432,11 @@ BStatusWindow::WindowActivated(bool state)
BStatusView::BStatusView(BRect bounds, thread_id thread, StatusWindowState type) BStatusView::BStatusView(BRect bounds, thread_id thread, StatusWindowState type)
: :
BView(bounds, "StatusView", B_FOLLOW_NONE, B_WILL_DRAW), BView(bounds, "StatusView", B_FOLLOW_NONE, B_WILL_DRAW),
fStatusBar(NULL),
fType(type), fType(type),
fBitmap(NULL), fBitmap(NULL),
fStopButton(NULL),
fPauseButton(NULL),
fThread(thread) fThread(thread)
{ {
Init(); Init();
@ -549,23 +552,20 @@ BStatusView::~BStatusView()
void void
BStatusView::Init() BStatusView::Init()
{ {
fDestDir = ""; fTotalSize = fItemSize = fSizeProcessed = fLastSpeedReferenceSize
= fEstimatedFinishReferenceSize = 0;
fCurItem = 0; fCurItem = 0;
fPendingStatusString[0] = '\0'; fLastUpdateTime = fLastSpeedReferenceTime = fProcessStartTime
fWasCanceled = false; = fLastSpeedUpdateTime = fEstimatedFinishReferenceTime
fIsPaused = false; = system_time();
fLastUpdateTime = 0; fCurrentBytesPerSecondSlot = 0;
fBytesPerSecond = 0.0;
for (size_t i = 0; i < kBytesPerSecondSlots; i++) for (size_t i = 0; i < kBytesPerSecondSlots; i++)
fBytesPerSecondSlot[i] = 0.0; fBytesPerSecondSlot[i] = 0.0;
fCurrentBytesPerSecondSlot = 0;
fItemSize = 0;
fSizeProcessed = 0;
fLastSpeedReferenceSize = 0;
fEstimatedFinishReferenceSize = 0;
fProcessStartTime = fLastSpeedReferenceTime fBytesPerSecond = 0.0;
= fEstimatedFinishReferenceTime = system_time(); fShowCount = fWasCanceled = fIsPaused = false;
fDestDir.SetTo("");
fPendingStatusString[0] = '\0';
} }
@ -579,9 +579,9 @@ BStatusView::InitStatus(int32 totalItems, off_t totalSize,
BEntry entry; BEntry entry;
char name[B_FILE_NAME_LENGTH]; char name[B_FILE_NAME_LENGTH];
if (destDir && (entry.SetTo(destDir) == B_OK)) { if (destDir != NULL && entry.SetTo(destDir) == B_OK) {
entry.GetName(name); entry.GetName(name);
fDestDir = name; fDestDir.SetTo(name);
} }
BString buffer; BString buffer;
@ -630,7 +630,7 @@ BStatusView::InitStatus(int32 totalItems, off_t totalSize,
void void
BStatusView::Draw(BRect updateRect) BStatusView::Draw(BRect updateRect)
{ {
if (fBitmap) { if (fBitmap != NULL) {
BPoint location; BPoint location;
location.x = (fStatusBar->Frame().left location.x = (fStatusBar->Frame().left
- fBitmap->Bounds().Width()) / 2; - fBitmap->Bounds().Width()) / 2;