MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / loadData

Method loadData

gui/nsearchview.cpp:141–156  ·  view source on GitHub ↗

Load up the data from the database

Source from the content-addressed store, hash-verified

139
140// Load up the data from the database
141void NSearchView::loadData() {
142 NSqlQuery query(global.db);
143 query.exec("Select lid, name from SearchModel order by name");
144 while (query.next()) {
145 qint32 lid = query.value(0).toInt();
146 SearchTable table(global.db);
147 if (!table.isDeleted(lid)) {
148 NSearchViewItem *newWidget = new NSearchViewItem();
149 newWidget->setData(NAME_POSITION, Qt::DisplayRole, query.value(1).toString());
150 newWidget->setData(NAME_POSITION, Qt::UserRole, lid);
151 this->dataStore.insert(query.value(0).toInt(), newWidget);
152 root->addChild(newWidget);
153 }
154 }
155 query.finish();
156}
157
158
159//*************************************************************

Callers 1

NSearchViewMethod · 0.95

Calls 6

valueMethod · 0.80
setDataMethod · 0.80
insertMethod · 0.80
execMethod · 0.45
isDeletedMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected