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:
Philippe Houdoin
2010-12-10 17:56:50 +00:00
parent fda6d9ab6f
commit acb73fef47
+4 -13
View File
@@ -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;