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

Method GetLeavesByKey

Src/Database/DatabaseTree.cpp:887–918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885}
886
887QList<TreeItem> CDatabaseTree::GetLeavesByKey(int key)
888{
889 QList<TreeItem> items;
890 QSqlQuery query(GetDatabase());
891 QString szSql;
892 szSql = "SELECT `id`, `name`, "
893 " `created_time`, `modified_time`, `last_visit_time`, `parent_id` "
894 " FROM `" + m_szTableName + "` "
895 " WHERE `key` = :key";
896 query.prepare(szSql);
897 query.bindValue(":key", key);
898 bool success = query.exec();
899 if (!success) {
900 SetError("Failed to get leaves by key: " + query.lastError().text()
901 + "; Sql: " + query.executedQuery()
902 + "; key: " + QString::number(key));
903 return items;
904 }
905 while(query.next()) {
906 TreeItem item(TreeItem::Leaf);
907 item.SetId(query.value(0).toInt());
908 item.SetName(query.value(1).toString());
909 item.SetKey(key);
910 item.SetCreateTime(query.value(2).toDateTime());
911 item.SetModifyTime(query.value(3).toDateTime());
912 item.SetLastVisitTime(query.value(4).toDateTime());
913 item.SetParentId(query.value(5).toInt());
914
915 items.append(item);
916 }
917 return items;
918}
919
920QList<TreeItem> CDatabaseTree::GetLeavesByKey(QList<int> key)
921{

Callers 2

getBookmarkByUrlMethod · 0.80
foreachFunction · 0.80

Calls 8

SetIdMethod · 0.80
SetKeyMethod · 0.80
SetModifyTimeMethod · 0.80
SetLastVisitTimeMethod · 0.80
SetParentIdMethod · 0.80
SetNameMethod · 0.45
SetCreateTimeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected