| 14 | } |
| 15 | |
| 16 | void 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 | |
| 41 | QList<ComicItem *> *YACReader::ComicQueryResultProcessor::modelData(QSqlQuery &sqlquery) |
| 42 | { |
nothing calls this directly
no test coverage detected