MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / searchBySQLWhere

Method searchBySQLWhere

src/share/WizSearch.cpp:255–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255void WizSearcher::searchBySQLWhere(const QString& strWhere, int nMaxSize, SearchScope scope)
256{
257 m_mapDocumentSearched.clear();
258 m_nMaxResult = nMaxSize;
259 m_scope = scope;
260 //
261 CWizDocumentDataArray arrayDocument;
262 CWizDocumentDataArray::const_iterator it;
263 if (Scope_AllNotes == m_scope || Scope_PersonalNotes == m_scope)
264 {
265 m_dbMgr.db().searchDocumentByWhere(strWhere, 5000, arrayDocument);
266
267 for (it = arrayDocument.begin(); it != arrayDocument.end(); it++) {
268
269 const WIZDOCUMENTDATAEX& doc = *it;
270 m_mapDocumentSearched[doc.strGUID] = doc;
271 m_nResults++;
272 }
273
274 arrayDocument.clear();
275 }
276 if (Scope_AllNotes == m_scope || Scope_GroupNotes == m_scope)
277 {
278 int nCount = m_dbMgr.count();
279 for (int i = 0; i < nCount; i++) {
280 m_dbMgr.at(i).searchDocumentByWhere(strWhere, 5000, arrayDocument);
281
282 for (it = arrayDocument.begin(); it != arrayDocument.end(); it++) {
283 const WIZDOCUMENTDATAEX& doc = *it;
284 m_mapDocumentSearched[doc.strGUID] = doc;
285 m_nResults++;
286 }
287
288 arrayDocument.clear();
289 }
290 }
291 qDebug() << QString("[Search]Find %1 results in database").arg(m_mapDocumentSearched.size());
292
293 emitSearchProcess("");
294}
295
296void WizSearcher::searchByKeywordAndWhere(const QString& strKeywords,
297 const QString& strWhere, int nMaxSize, SearchScope scope)

Callers 3

searchNotesBySQLMethod · 0.80

Calls 7

searchDocumentByWhereMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
sizeMethod · 0.80
QStringClass · 0.70
clearMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected