void CDirstatDoc::OnUpdateCleanupDelete(CCmdUI *pCmdUI) { // FIXME: Multi-select CItem *item = GetSelection(0); pCmdUI->Enable( DirectoryListHasFocus() && item != NULL && (IT_DIRECTORY == item->GetType() || IT_FILE == item->GetType()) && !item->IsRootItem() ); }
void CDirstatDoc::OnCleanupDelete() { // FIXME: Multi-select CItem *item = GetSelection(0); if(NULL == item || item->GetType() != IT_DIRECTORY && item->GetType() != IT_FILE || item->IsRootItem()) { return; } if(DeletePhysicalItem(item, false)) { SetWorkingItem(GetRootItem()); UpdateAllViews(NULL); } }
void CDirstatDoc::OnCleanupDeletetotrashbin() { // FIXME: Multi-select CItem *item = GetSelection(0); if(NULL == item || item->GetType() != IT_DIRECTORY && item->GetType() != IT_FILE || item->IsRootItem()) { return; } if(DeletePhysicalItem(item, true)) { RefreshRecyclers(); UpdateAllViews(NULL); } }