No need to iterate volumes's trash folders: we knows on which
device/volume the entry was moved, checking if it's in this volume trash folder is enough. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39807 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -180,20 +180,11 @@ class TrashMonitor : public BHandler {
|
||||
bool moved_to_trash = false;
|
||||
BPath trashPath;
|
||||
BEntry entry(&ref);
|
||||
BVolumeRoster volumes;
|
||||
BVolume volume;
|
||||
while (volumes.GetNextVolume(&volume) == B_OK) {
|
||||
BPath trashPath;
|
||||
if (find_directory(B_TRASH_DIRECTORY, &trashPath,
|
||||
false, &volume) != B_OK) {
|
||||
continue;
|
||||
}
|
||||
|
||||
BVolume volume(ref.device);
|
||||
if (find_directory(B_TRASH_DIRECTORY, &trashPath,
|
||||
false, &volume) == B_OK) {
|
||||
BDirectory trash(trashPath.Path());
|
||||
if (trash.Contains(&entry)) {
|
||||
moved_to_trash = true;
|
||||
break;
|
||||
}
|
||||
moved_to_trash = trash.Contains(&entry);
|
||||
}
|
||||
|
||||
messages_for_us += (moved_to_trash) ? 1 : -1;
|
||||
|
||||
Reference in New Issue
Block a user