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

Method onAddFolder

Plugins/WebBrowser/Bookmark/FrmBookmark.cpp:301–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301void CFrmBookmark::onAddFolder()
302{
303 bool ok;
304 QString name = QInputDialog::getText(this, tr("Add folder"),
305 tr("Folder name:"), QLineEdit::Normal,
306 "", &ok);
307 if (!ok || name.isEmpty()) return;
308
309 int parentId = 0;
310 QModelIndex currentIndex = m_pTreeView->currentIndex();
311 if (currentIndex.isValid()) {
312 int type = currentIndex.data(Type).toInt();
313 if (BookmarkType_Folder == type) {
314 parentId = currentIndex.data(Qt::UserRole).toInt();
315 }
316 }
317
318 if (m_pDatabase->addFolder(name, parentId)) {
319 refresh();
320 }
321}
322
323void CFrmBookmark::onEditBookmark()
324{

Callers

nothing calls this directly

Calls 4

isValidMethod · 0.80
addFolderMethod · 0.80
isEmptyMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected