| 253 | } |
| 254 | |
| 255 | void 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 | |
| 296 | void WizSearcher::searchByKeywordAndWhere(const QString& strKeywords, |
| 297 | const QString& strWhere, int nMaxSize, SearchScope scope) |
no test coverage detected