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

Method slotNewGroup

App/Client/Favorite/FavoriteView.cpp:428–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426}
427
428void CFavoriteView::slotNewGroup()
429{
430 if(!m_pModel) return;
431 QString szGroup = QInputDialog::getText(
432 this, tr("New group"), tr("Input group name"));
433 if(szGroup.isEmpty()) return;
434
435 int parentId = 0;
436 auto lstIndex = m_pTreeView->selectionModel()->selectedIndexes();
437 if(!lstIndex.isEmpty())
438 {
439 CFavoriteDatabase::Item item =
440 m_pModel->data(lstIndex.at(0), CFavoriteModel::RoleItem)
441 .value<CFavoriteDatabase::Item>();
442 if(0 < item.id && item.isFolder())
443 parentId = item.id;
444 }
445
446 m_pModel->AddNode(szGroup, parentId);
447}
448
449void CFavoriteView::slotRefresh()
450{

Callers

nothing calls this directly

Calls 4

isEmptyMethod · 0.45
dataMethod · 0.45
isFolderMethod · 0.45
AddNodeMethod · 0.45

Tested by

no test coverage detected