Further cleanup of TrackerLoopControl. gStatusWindow is now nowhere used anymore
except inside TrackerLoopControl. The only expected change of behavior is when trying to copy something onto a read-only volume. AFAICS, it would previously prompt an alert and not already show the status window. Now it will show the status window and prompt an alert, like in all the other situations when the operation would be stopped before it even started by an alert. I was able to remove quite a few code duplications along the way. CopyLoopControl can be instantiated by itself and provides default implementations which could in turn be removed from TrackerLoopControl. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35115 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -727,7 +727,9 @@ BInfoWindow::CalcSize(void *castToWindow)
|
||||
off_t size = 0;
|
||||
int32 fileCount = 0;
|
||||
int32 dirCount = 0;
|
||||
FSRecursiveCalcSize(window, &dir, &size, &fileCount, &dirCount);
|
||||
CopyLoopControl loopControl;
|
||||
FSRecursiveCalcSize(window, &loopControl, &dir, &size, &fileCount,
|
||||
&dirCount);
|
||||
|
||||
// got the size value, update the size string
|
||||
GetSizeString(sizeString, size, fileCount);
|
||||
@@ -751,8 +753,9 @@ BInfoWindow::CalcSize(void *castToWindow)
|
||||
|
||||
BDirectory trashDir;
|
||||
if (FSGetTrashDir(&trashDir, volume.Device()) == B_OK) {
|
||||
FSRecursiveCalcSize(window, &trashDir, ¤tSize,
|
||||
¤tFileCount, ¤tDirCount);
|
||||
CopyLoopControl loopControl;
|
||||
FSRecursiveCalcSize(window, &loopControl, &trashDir,
|
||||
¤tSize, ¤tFileCount, ¤tDirCount);
|
||||
totalSize += currentSize;
|
||||
totalFileCount += currentFileCount;
|
||||
totalDirCount += currentDirCount;
|
||||
@@ -761,9 +764,10 @@ BInfoWindow::CalcSize(void *castToWindow)
|
||||
GetSizeString(sizeString, totalSize, totalFileCount);
|
||||
}
|
||||
|
||||
if (window->StopCalc())
|
||||
if (window->StopCalc()) {
|
||||
// window closed, bail
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
AutoLock<BWindow> lock(window);
|
||||
if (lock.IsLocked())
|
||||
|
||||
Reference in New Issue
Block a user