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;
|
bool moved_to_trash = false;
|
||||||
BPath trashPath;
|
BPath trashPath;
|
||||||
BEntry entry(&ref);
|
BEntry entry(&ref);
|
||||||
BVolumeRoster volumes;
|
BVolume volume(ref.device);
|
||||||
BVolume volume;
|
if (find_directory(B_TRASH_DIRECTORY, &trashPath,
|
||||||
while (volumes.GetNextVolume(&volume) == B_OK) {
|
false, &volume) == B_OK) {
|
||||||
BPath trashPath;
|
|
||||||
if (find_directory(B_TRASH_DIRECTORY, &trashPath,
|
|
||||||
false, &volume) != B_OK) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
BDirectory trash(trashPath.Path());
|
BDirectory trash(trashPath.Path());
|
||||||
if (trash.Contains(&entry)) {
|
moved_to_trash = trash.Contains(&entry);
|
||||||
moved_to_trash = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
messages_for_us += (moved_to_trash) ? 1 : -1;
|
messages_for_us += (moved_to_trash) ? 1 : -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user