MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / slotDelete

Method slotDelete

App/Client/Favorite/FavoriteView.cpp:409–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409void CFavoriteView::slotDelete()
410{
411 auto lstIndex = m_pTreeView->selectionModel()->selectedIndexes();
412 if(1 == lstIndex.size()) {
413 CFavoriteDatabase::Item item =
414 m_pModel->data(lstIndex.at(0), CFavoriteModel::RoleItem)
415 .value<CFavoriteDatabase::Item>();
416 if(0 < item.id) {
417 int ret = QMessageBox::warning(
418 nullptr, tr("Delete"), tr("Will be delete \"%1\"").arg(item.szName),
419 QMessageBox::Ok|QMessageBox::No);
420 if(QMessageBox::Ok != ret)
421 return;
422 }
423 }
424 foreach(auto index, lstIndex)
425 m_pModel->removeRow(index.row(), index.parent());
426}
427
428void CFavoriteView::slotNewGroup()
429{

Callers

nothing calls this directly

Calls 2

dataMethod · 0.45
parentMethod · 0.45

Tested by

no test coverage detected