What is the proper way for an app to send a file to the trash can, instead of deleting it completely?
void
MainWindow::DeleteCurrentImage()
{
// Removed BAlert confirmation...
if (fFileList.empty() || fCurrentIndex < 0)
return;
entry_ref ref = fFileList[fCurrentIndex];
BEntry entry(&ref);
// TODO: Move to Trash
status_t result = entry.Remove();
if (result != B_OK) {
printf("Failed to delete image\n");
return;
}
}
My guess would be MoveTo(), but how do I get the path to the trash?