If moved to Trash, close window.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32972 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström 2009-09-06 20:42:23 +00:00
parent bd7b0937db
commit 3360020ab0
1 changed files with 15 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include <TextView.h>
#include <NodeMonitor.h>
#include <String.h>
#include <Volume.h>
#include "PeopleApp.h"
#include "PeopleView.h"
@ -223,6 +224,20 @@ TPeopleWindow::MessageReceived(BMessage* msg)
// And our window title.
SetTitle(name);
// If moved to Trash, close window.
BVolume volume(device);
BPath trash;
find_directory(B_TRASH_DIRECTORY, &trash, false,
&volume);
BPath folder(fRef);
folder.GetParent(&folder);
if (folder == trash) {
delete fRef;
fRef = NULL;
PostMessage(B_QUIT_REQUESTED);
}
break;
}