* When launching an app by signature, check against the correct device trash when checking if an executable is in the trash.

When using find_directory(B_TRASH_DIRECTORY... to check if an entry is in the trash one should always pass the entry's volume otherwise you might be checking in the wrong trash.
Might happen elsewhere in the tree, will have an opengrok look.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35826 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner 2010-03-12 17:09:36 +00:00
parent 6daecfb154
commit cfbd755443
1 changed files with 4 additions and 1 deletions

View File

@ -142,8 +142,11 @@ can_app_be_used(const entry_ref* ref)
// check whether the file is in trash
BPath trashPath;
BDirectory directory;
BVolume volume;
if (error == B_OK
&& find_directory(B_TRASH_DIRECTORY, &trashPath) == B_OK
&& volume.SetTo(ref->device) == B_OK
&& find_directory(B_TRASH_DIRECTORY, &trashPath, false, &volume)
== B_OK
&& directory.SetTo(trashPath.Path()) == B_OK
&& directory.Contains(&entry)) {
error = B_LAUNCH_FAILED_APP_IN_TRASH;