MCPcopy Create free account
hub / github.com/YACReader/yacreader / createModelData

Method createModelData

YACReaderLibrary/db/comic_query_result_processor.cpp:16–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16void YACReader::ComicQueryResultProcessor::createModelData(const QString &filter, const QString &databasePath)
17{
18 querySearchQueue.cancelPending();
19
20 querySearchQueue.enqueue([=] {
21 QString connectionName = "";
22 {
23 QSqlDatabase db = DataBaseManagement::loadDatabase(databasePath);
24 try {
25 auto query = comicsSearchQuery(db, filter);
26
27 auto data = modelData(query);
28
29 emit newData(data, databasePath);
30 } catch (const std::exception &e) {
31 // Do nothing, uncomplete search string will end here and it is part of how the QueryParser works
32 // I don't like the idea of using exceptions for this though
33 }
34
35 connectionName = db.connectionName();
36 }
37 QSqlDatabase::removeDatabase(connectionName);
38 });
39}
40
41QList<ComicItem *> *YACReader::ComicQueryResultProcessor::modelData(QSqlQuery &sqlquery)
42{

Callers

nothing calls this directly

Calls 3

comicsSearchQueryFunction · 0.85
cancelPendingMethod · 0.80
enqueueMethod · 0.45

Tested by

no test coverage detected