diff --git a/src/apps/diskusage/DiskUsage.h b/src/apps/diskusage/DiskUsage.h index d3559d1baa..77330fccc6 100644 --- a/src/apps/diskusage/DiskUsage.h +++ b/src/apps/diskusage/DiskUsage.h @@ -61,7 +61,6 @@ extern bool helpFileWasFound; #define kScanRefresh 'gSRF' #define kScanProgress 'gSPR' #define kScanDone 'gSDN' -#define kOutdatedMsg 'gOUT' #define deg2rad(x) (2.0 * M_PI * (x) / 360.0) #define rad2deg(x) (360.0 * (x) / (2.0 * M_PI)) diff --git a/src/apps/diskusage/PieView.cpp b/src/apps/diskusage/PieView.cpp index 0151eeb597..5d770fa341 100644 --- a/src/apps/diskusage/PieView.cpp +++ b/src/apps/diskusage/PieView.cpp @@ -135,8 +135,7 @@ PieView::PieView(BVolume* volume) fVolume(volume), fMouseOverInfo(), fClicked(false), - fDragging(false), - fOutdated(false) + fDragging(false) { fMouseOverMenu = new BPopUpMenu(kEmptyStr, false, false); fMouseOverMenu->AddItem(new BMenuItem(B_TRANSLATE("Get Info"), NULL), @@ -188,7 +187,6 @@ PieView::MessageReceived(BMessage* message) else _ShowVolume(fVolume); - fOutdated = false; Invalidate(); } break; @@ -200,15 +198,6 @@ PieView::MessageReceived(BMessage* message) break; } - case kOutdatedMsg: - { - if (!fScanner->IsBusy()) { - fOutdated = true; - Invalidate(); - } - break; - } - default: BView::MessageReceived(message); break; @@ -250,11 +239,9 @@ PieView::MouseUp(BPoint where) if (info != NULL) { if (info == fScanner->CurrentDir()) { fScanner->ChangeDir(info->parent); - fOutdated = fScanner->IsOutdated(); Invalidate(); } else if (info->children.size() > 0) { fScanner->ChangeDir(info); - fOutdated = fScanner->IsOutdated(); Invalidate(); } } @@ -415,21 +402,6 @@ PieView::_DrawPieChart(BRect updateRect) } _DrawDirectory(pieRect, currentDir, 0.0, 0.0, colorIdx % kBasePieColorCount, 0); - - if (fOutdated) { - - BRect b = Bounds(); - - float strWidth = StringWidth(B_TRANSLATE("Outdated view")); - float bx = (b.Width() - strWidth - kSmallHMargin); - - struct font_height fh; - be_plain_font->GetHeight(&fh); - - float by = (b.Height() - ceil(fh.descent) - kSmallVMargin); - SetHighColor(0x00, 0x00, 0x00); - DrawString(B_TRANSLATE("Outdated view"), BPoint(bx, by)); - } } diff --git a/src/apps/diskusage/PieView.h b/src/apps/diskusage/PieView.h index 9e0d5e3bee..12dd5e3540 100644 --- a/src/apps/diskusage/PieView.h +++ b/src/apps/diskusage/PieView.h @@ -91,8 +91,7 @@ private: bool fClicked; bool fDragging; BPoint fDragStart; - FileInfo* fClickedFile; - bool fOutdated; + FileInfo* fClickedFile; }; #endif // PIE_VIEW_H diff --git a/src/apps/diskusage/Scanner.cpp b/src/apps/diskusage/Scanner.cpp index 9ed5078083..59384e2235 100644 --- a/src/apps/diskusage/Scanner.cpp +++ b/src/apps/diskusage/Scanner.cpp @@ -15,7 +15,6 @@ #include #include -#include #include "DiskUsage.h" @@ -36,9 +35,7 @@ Scanner::Scanner(BVolume *v, BHandler *handler) fDesiredPath(), fTask(), fBusy(false), - fQuitRequested(false), - fIsWatching(false), - fModifiedEntries() + fQuitRequested(false) { Run(); } @@ -46,17 +43,7 @@ Scanner::Scanner(BVolume *v, BHandler *handler) Scanner::~Scanner() { - if (fIsWatching) { - BPrivate::BPathMonitor::StopWatching(BMessenger(this, this)); - fIsWatching = false; - } delete fSnapshot; - - while (fModifiedEntries.size() != 0) { - entry_ref* entry = *fModifiedEntries.begin(); - delete entry; - fModifiedEntries.erase(fModifiedEntries.begin()); - } } @@ -73,38 +60,6 @@ Scanner::MessageReceived(BMessage* message) break; } - case B_PATH_MONITOR: - { - dev_t device; - ino_t directory; - const char* name = ""; - const char* path; - - if (((message->FindInt32("device", &device) != B_OK) - || (message->FindInt64("directory", &directory) != B_OK) - || (message->FindString("name", &name) != B_OK)) - && ((message->FindString("path", &path) != B_OK) - || (message->FindInt32("device", &device) != B_OK))) - return; - - entry_ref* reportedEntry; - if (strlen(name) > 0) - reportedEntry = new entry_ref(device, directory, name); - else { - BEntry entry(path); - reportedEntry = new entry_ref(); - entry.GetRef(reportedEntry); - } - - fModifiedEntries.push_back(reportedEntry); - - if (IsOutdated()) { - BMessage msg(kOutdatedMsg); - fListener.SendMessage(&msg); - } - break; - } - default: BLooper::MessageReceived(message); break; @@ -120,12 +75,6 @@ Scanner::Refresh(FileInfo* startInfo) fBusy = true; - while (fModifiedEntries.size() != 0) { - entry_ref* entry = *fModifiedEntries.begin(); - delete entry; - fModifiedEntries.erase(fModifiedEntries.begin()); - } - // Remember the current directory, if any, so we can return to it after // the scanning is done. if (fSnapshot != NULL && fSnapshot->currentDir != NULL) @@ -165,27 +114,6 @@ Scanner::RequestQuit() } -bool -Scanner::IsOutdated() -{ - FileInfo* currentDir = (fSnapshot->currentDir != NULL ? - fSnapshot->currentDir : fSnapshot->rootDir); - - BDirectory currentDirectory(&(currentDir->ref)); - - bool isOutdated = currentDirectory.InitCheck() != B_OK; - - vector::iterator i = fModifiedEntries.begin(); - while (!isOutdated && i != fModifiedEntries.end()) { - BEntry entry(*i); - isOutdated = _DirectoryContains(currentDir, *i) - || currentDirectory.Contains(&entry); - i++; - } - return isOutdated; -} - - // #pragma mark - private @@ -260,16 +188,6 @@ Scanner::_RunScan(FileInfo* startInfo) } } - if (!fIsWatching) { - string path; - fSnapshot->rootDir->GetPath(path); - - BPrivate::BPathMonitor::StartWatching(path.c_str(), - B_WATCH_ALL | B_WATCH_RECURSIVELY, BMessenger(this, this)); - - fIsWatching = true; - } - fBusy = false; _ChangeToDesired(); fListener.SendMessage(&fDoneMessage); diff --git a/src/apps/diskusage/Scanner.h b/src/apps/diskusage/Scanner.h index bfc92221d1..57904b0f28 100644 --- a/src/apps/diskusage/Scanner.h +++ b/src/apps/diskusage/Scanner.h @@ -11,7 +11,6 @@ #include -#include #include #include @@ -50,7 +49,6 @@ public: dev_t Device() const { return fVolume->Device(); } void RequestQuit(); - bool IsOutdated(); private: void _RunScan(FileInfo *startInfo); @@ -73,10 +71,6 @@ private: string fTask; bool fBusy; bool fQuitRequested; - - bool fIsWatching; - - std::vector fModifiedEntries; }; #endif // SCANNER_H