[haiku-commits] r35826 - haiku/trunk/src/kits/app

  • From: alex@xxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 12 Mar 2010 18:09:36 +0100 (CET)

Author: aldeck
Date: 2010-03-12 18:09:36 +0100 (Fri, 12 Mar 2010)
New Revision: 35826
Changeset: http://dev.haiku-os.org/changeset/35826/haiku

Modified:
   haiku/trunk/src/kits/app/Roster.cpp
Log:
* 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.


Modified: haiku/trunk/src/kits/app/Roster.cpp
===================================================================
--- haiku/trunk/src/kits/app/Roster.cpp 2010-03-12 16:59:26 UTC (rev 35825)
+++ haiku/trunk/src/kits/app/Roster.cpp 2010-03-12 17:09:36 UTC (rev 35826)
@@ -142,8 +142,11 @@
        // 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;


Other related posts:

  • » [haiku-commits] r35826 - haiku/trunk/src/kits/app - alex