From acb73fef473ecfdfe4121b0f36234302cb03025c Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Fri, 10 Dec 2010 17:56:50 +0000 Subject: [PATCH] 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 --- src/kits/mail/MailProtocol.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/kits/mail/MailProtocol.cpp b/src/kits/mail/MailProtocol.cpp index a8fd5028b5..db81e908af 100644 --- a/src/kits/mail/MailProtocol.cpp +++ b/src/kits/mail/MailProtocol.cpp @@ -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;