| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/database/databasequeries.cpp`/ |
| 2 | |
| 3 | #include "database/databasequeries.h"cxx . . $ `<file>/src/librssguard/database/databasequeries.h`/ |
| 4 | |
| 5 | #include "3rd-party/boolinq/boolinq.h"cxx . . $ `<file>/src/librssguard/3rd-party/boolinq/boolinq.h`/ |
| 6 | #include "definitions/globals.h"cxx . . $ `<file>/src/librssguard/definitions/globals.h`/ |
| 7 | #include "exceptions/applicationexception.h"cxx . . $ `<file>/src/librssguard/exceptions/applicationexception.h`/ |
| 8 | #include "miscellaneous/application.h"cxx . . $ `<file>/src/librssguard/miscellaneous/application.h`/ |
| 9 | #include "miscellaneous/iconfactory.h"cxx . . $ `<file>/src/librssguard/miscellaneous/iconfactory.h`/ |
| 10 | #include "miscellaneous/settings.h"cxx . . $ `<file>/src/librssguard/miscellaneous/settings.h`/ |
| 11 | #include "services/abstract/category.h"cxx . . $ `<file>/src/librssguard/services/abstract/category.h`/ |
| 12 | |
| 13 | #include <QSqlDriver> |
| 14 | #include <QUrl> |
| 15 | #include <QVariant> |
| 16 | |
| 17 | QMapcxx . . $ QMap#<int, QStringcxx . . $ QString#> DatabaseQueriescxx . . $ DatabaseQueries#::messageTableAttributescxx . . $ DatabaseQueries#messageTableAttributes(dd908507b11f616c).(bool only_msg_table, bool is_sqlite) { |
| 18 | QMapcxx . . $ QMap#<int, QStringcxx . . $ QString#> field_namescxx . . $ QMap#QMap(49f6e7a06ebc5aa8).; |
| 19 | |
| 20 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_ID_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:279:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.id"); |
| 21 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_READ_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:280:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.is_read"); |
| 22 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_IMPORTANT_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:281:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.is_important"); |
| 23 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_DELETED_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:282:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.is_deleted"); |
| 24 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_PDELETED_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:283:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.is_pdeleted"); |
| 25 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_FEED_CUSTOM_ID_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:284:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.feed"); |
| 26 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_TITLE_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:285:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.title"); |
| 27 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_URL_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:286:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.url"); |
| 28 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_AUTHOR_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:287:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.author"); |
| 29 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_DCREATED_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:288:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.date_created"); |
| 30 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_CONTENTS_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:289:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.contents"); |
| 31 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_ENCLOSURES_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:290:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.enclosures"); |
| 32 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_SCORE_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:291:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.score"); |
| 33 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_ACCOUNT_ID_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:292:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.account_id"); |
| 34 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_CUSTOM_ID_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:293:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.custom_id"); |
| 35 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_CUSTOM_HASH_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:294:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.custom_hash"); |
| 36 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_FEED_TITLE_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:295:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). only_msg_table ? QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.feed") : QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Feeds.title"); |
| 37 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_FEED_IS_RTL_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:296:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). only_msg_table ? QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("0") : QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Feeds.is_rtl"); |
| 38 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_HAS_ENCLOSUREScxx . . $ `src/librssguard/definitions/definitions.h:297:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("CASE WHEN LENGTH(Messages.enclosures) > 10 " |
| 39 | "THEN 'true' " |
| 40 | "ELSE 'false' " |
| 41 | "END AS has_enclosures"); |
| 42 | |
| 43 | if (is_sqlite) { |
| 44 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_LABELScxx . . $ `src/librssguard/definitions/definitions.h:298:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("(SELECT GROUP_CONCAT(Labels.name) FROM Labels WHERE Messages.labels LIKE '%.' || " |
| 45 | "Labels.custom_id || '.%') as msg_labels"); |
| 46 | } |
| 47 | else { |
| 48 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_LABELScxx . . $ `src/librssguard/definitions/definitions.h:298:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). |
| 49 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("(SELECT GROUP_CONCAT(Labels.name) FROM Labels WHERE Messages.labels LIKE CONCAT('%.', " |
| 50 | "Labels.custom_id, '.%')) as msg_labels"); |
| 51 | } |
| 52 | |
| 53 | field_names[cxx . . $ QMap#`operator[]`(bbd415b616967878).MSG_DB_LABELS_IDScxx . . $ `src/librssguard/definitions/definitions.h:299:9`!] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.labels"); |
| 54 | |
| 55 | // TODO: zpomaluje zobrazenàseznamu zpráv |
| 56 | /* |
| 57 | field_names[MSG_DB_LABELS] = |
| 58 | QSL("(SELECT GROUP_CONCAT(Labels.name) FROM Labels WHERE Labels.custom_id IN (SELECT " |
| 59 | "LabelsInMessages.label FROM LabelsInMessages WHERE LabelsInMessages.account_id = " |
| 60 | "Messages.account_id AND LabelsInMessages.message = Messages.custom_id)) as msg_labels"); |
| 61 | */ |
| 62 | |
| 63 | return field_names; |
| 64 | } |
| 65 | |
| 66 | QStringcxx . . $ QString# DatabaseQueriescxx . . $ DatabaseQueries#::serializeCustomDatacxx . . $ DatabaseQueries#serializeCustomData(f70f12fa894c0ae9).(const QVariantHashcxx . . $ QVariantHash#& data) { |
| 67 | if (!data.isEmptycxx . . $ QHash#isEmpty(3482b152b9333168).()) { |
| 68 | return QStringcxx . . $ QString#::fromUtf8cxx . . $ QString#fromUtf8(4e15edac36d215be).(QJsonDocumentcxx . . $ QJsonDocument#::fromVariantcxx . . $ QJsonDocument#fromVariant(ee761c0132155d43).(datacxx . . $ QVariant#QVariant(5dc15d17ab1234bb).).toJsoncxx . . $ QJsonDocument#toJson(6b49539da79a45f0).(QJsonDocumentcxx . . $ QJsonDocument#::JsonFormatcxx . . $ QJsonDocument#JsonFormat#::Indentedcxx . . $ QJsonDocument#Indented.)); |
| 69 | } |
| 70 | else { |
| 71 | return QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | QVariantHashcxx . . $ QVariantHash# DatabaseQueriescxx . . $ DatabaseQueries#::deserializeCustomDatacxx . . $ DatabaseQueries#deserializeCustomData(6be01bf7236fd155).(const QStringcxx . . $ QString#& data) { |
| 76 | if (data.isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 77 | return QVariantHashcxx . . $ QHash#QHash(ced63f7c635d850d).(); |
| 78 | } |
| 79 | else { |
| 80 | auto json = QJsonDocumentcxx . . $ QJsonDocument#::fromJsoncxx . . $ QJsonDocument#fromJson(731a4d2b2d08d93c).(data.toUtf8cxx . . $ QString#toUtf8(ef52b713090bc85a).()); |
| 81 | |
| 82 | return json.objectcxx . . $ QJsonDocument#object(ac8af9874357714b).().toVariantHashcxx . . $ QJsonObject#toVariantHash(556033a494fe4eb9).(); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | bool DatabaseQueriescxx . . $ DatabaseQueries#::isLabelAssignedToMessagecxx . . $ DatabaseQueries#isLabelAssignedToMessage(61d006bee2b57e7a).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Labelcxx . . $ Label#* label, const Messagecxx . . $ Message#& msg) { |
| 87 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 88 | |
| 89 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 90 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT COUNT(*) FROM Messages " |
| 91 | "WHERE " |
| 92 | " Messages.labels LIKE :label AND " |
| 93 | " Messages.custom_id = :message AND " |
| 94 | " account_id = :account_id;")); |
| 95 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":label"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("%.%1.%").argcxx . . $ QString#arg(ad0bca07273edcc2).(label->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).())); |
| 96 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":message"), msgcxx . . $ QVariant#QVariant(132dd6869045752b)..m_customIdcxx . . $ Message#m_customId.); |
| 97 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 98 | |
| 99 | q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).(); |
| 100 | |
| 101 | return q.recordcxx . . $ QSqlQuery#record(bb20731da56c592d).().valuecxx . . $ QSqlRecord#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).() > 0; |
| 102 | } |
| 103 | |
| 104 | bool DatabaseQueriescxx . . $ DatabaseQueries#::deassignLabelFromMessagecxx . . $ DatabaseQueries#deassignLabelFromMessage(61d006bee2b57e7a).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Labelcxx . . $ Label#* label, const Messagecxx . . $ Message#& msg) { |
| 105 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 106 | |
| 107 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 108 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages " |
| 109 | "SET labels = REPLACE(Messages.labels, :label, \".\") " |
| 110 | "WHERE Messages.custom_id = :message AND account_id = :account_id;")); |
| 111 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":label"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(".%1.").argcxx . . $ QString#arg(ad0bca07273edcc2).(label->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).())); |
| 112 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":message"), msgcxx . . $ QVariant#QVariant(132dd6869045752b)..m_customIdcxx . . $ Message#m_customId..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).() ? QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(msg.m_idcxx . . $ Message#m_id.) : msgcxx . . $ QString#QString(132dd6869045752b)..m_customIdcxx . . $ Message#m_customId.); |
| 113 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 114 | |
| 115 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 116 | } |
| 117 | |
| 118 | bool DatabaseQueriescxx . . $ DatabaseQueries#::assignLabelToMessagecxx . . $ DatabaseQueries#assignLabelToMessage(61d006bee2b57e7a).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Labelcxx . . $ Label#* label, const Messagecxx . . $ Message#& msg) { |
| 119 | deassignLabelFromMessagecxx . . $ DatabaseQueries#deassignLabelFromMessage(61d006bee2b57e7a).(db, label, msg); |
| 120 | |
| 121 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 122 | |
| 123 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 124 | |
| 125 | if (db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_MYSQL_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:222:9`!)) { |
| 126 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages " |
| 127 | "SET labels = CONCAT(Messages.labels, :label) " |
| 128 | "WHERE Messages.custom_id = :message AND account_id = :account_id;")); |
| 129 | } |
| 130 | else { |
| 131 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages " |
| 132 | "SET labels = Messages.labels || :label " |
| 133 | "WHERE Messages.custom_id = :message AND account_id = :account_id;")); |
| 134 | } |
| 135 | |
| 136 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":label"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("%1.").argcxx . . $ QString#arg(ad0bca07273edcc2).(label->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).())); |
| 137 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":message"), msgcxx . . $ QVariant#QVariant(132dd6869045752b)..m_customIdcxx . . $ Message#m_customId..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).() ? QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(msg.m_idcxx . . $ Message#m_id.) : msgcxx . . $ QString#QString(132dd6869045752b)..m_customIdcxx . . $ Message#m_customId.); |
| 138 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 139 | |
| 140 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 141 | } |
| 142 | |
| 143 | bool DatabaseQueriescxx . . $ DatabaseQueries#::setLabelsForMessagecxx . . $ DatabaseQueries#setLabelsForMessage(f076d2b59f25de51).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, const QListcxx . . $ QList#<Labelcxx . . $ Label#*>& labels, const Messagecxx . . $ Message#& msg) { |
| 144 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 145 | |
| 146 | auto std_lbls = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(labels) |
| 147 | .selectcxx . . $ boolinq/Linq#select(a3f5bd4cd382e0ee).([](Labelcxx . . $ Label#* lbl) { |
| 148 | return lbl->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).(); |
| 149 | }) |
| 150 | .toStdListcxx . . $ boolinq/Linq#toStdList(2989115be80c3067).(); |
| 151 | |
| 152 | QStringListcxx . . $ QStringList# lbls = FROM_STD_LISTcxx . . $ `src/librssguard/definitions/definitions.h:405:9`!(QStringList, std_lbls); |
| 153 | QStringcxx . . $ QString# lblss = QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(".") + lbls.joincxx . . $ QListSpecialMethods#join(227e33e1a3bf1f91).('.'cxx . . $ QChar#QChar(93d577a3e9528307).) + QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("."); |
| 154 | |
| 155 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 156 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages " |
| 157 | "SET labels = :labels " |
| 158 | "WHERE Messages.custom_id = :message AND account_id = :account_id;")); |
| 159 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":labels"), lblsscxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 160 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":message"), msgcxx . . $ QVariant#QVariant(132dd6869045752b)..m_customIdcxx . . $ Message#m_customId..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).() ? QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(msg.m_idcxx . . $ Message#m_id.) : msgcxx . . $ QString#QString(132dd6869045752b)..m_customIdcxx . . $ Message#m_customId.); |
| 161 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), msgcxx . . $ QVariant#QVariant(f349c77f591a7878)..m_accountIdcxx . . $ Message#m_accountId.); |
| 162 | |
| 163 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 164 | } |
| 165 | |
| 166 | QListcxx . . $ QList#<Labelcxx . . $ Label#*> DatabaseQueriescxx . . $ DatabaseQueries#::getLabelsForAccountcxx . . $ DatabaseQueries#getLabelsForAccount(8ede74a3bf231afd).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id) { |
| 167 | QListcxx . . $ QList#<Labelcxx . . $ Label#*> labelscxx . . $ QList#QList(ced63f7c635d850d).; |
| 168 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 169 | |
| 170 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 171 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT * FROM Labels WHERE account_id = :account_id;")); |
| 172 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 173 | |
| 174 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 175 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 176 | Labelcxx . . $ Label#* lbl = new Labelcxx . . $ Label#Label(db702bf7f1dcf973).(q.valuecxx . . $ QSqlQuery#value(d37d495c0a7682cc).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("name")).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(), QColorcxx . . $ QColor#QColor(3520e46b33348bf6).(q.valuecxx . . $ QSqlQuery#value(d37d495c0a7682cc).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("color")).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).())); |
| 177 | |
| 178 | lbl->setIdcxx . . $ RootItem#setId(d4f767463ce0a6b3).(q.valuecxx . . $ QSqlQuery#value(d37d495c0a7682cc).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("id")).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 179 | lbl->setCustomIdcxx . . $ RootItem#setCustomId(3520e46b33348bf6).(q.valuecxx . . $ QSqlQuery#value(d37d495c0a7682cc).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("custom_id")).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 180 | |
| 181 | labels <<cxx . . $ QList#`operator<<`(ddd37d5bfdbbfc74). lbl; |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | return labels; |
| 186 | } |
| 187 | |
| 188 | QListcxx . . $ QList#<Labelcxx . . $ Label#*> DatabaseQueriescxx . . $ DatabaseQueries#::getLabelsForMessagecxx . . $ DatabaseQueries#getLabelsForMessage(7b3b62390eac5a2c).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 189 | const Messagecxx . . $ Message#& msg, |
| 190 | const QListcxx . . $ QList#<Labelcxx . . $ Label#*>& installed_labels) { |
| 191 | QListcxx . . $ QList#<Labelcxx . . $ Label#*> labelscxx . . $ QList#QList(ced63f7c635d850d).; |
| 192 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 193 | |
| 194 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 195 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT labels FROM Messages WHERE custom_id = :message AND account_id = :account_id;")); |
| 196 | |
| 197 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), msgcxx . . $ QVariant#QVariant(f349c77f591a7878)..m_accountIdcxx . . $ Message#m_accountId.); |
| 198 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":message"), msgcxx . . $ QVariant#QVariant(132dd6869045752b)..m_customIdcxx . . $ Message#m_customId..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).() ? QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(msg.m_idcxx . . $ Message#m_id.) : msgcxx . . $ QString#QString(132dd6869045752b)..m_customIdcxx . . $ Message#m_customId.); |
| 199 | |
| 200 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 201 | auto label_ids = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).().splitcxx . . $ QString#split(4e27fcb098d1f780).('.'cxx . . $ QChar#QChar(93d577a3e9528307)., |
| 202 | #if QT_VERSIONcxx . . $ `<external>/3898848398875472725/qtversionchecks.h:17:9`! >= 0x050F00 // Qt >= 5.15.0 |
| 203 | Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::SplitBehaviorFlagscxx . . $ Qt/SplitBehaviorFlags#::SkipEmptyPartscxx . . $ Qt/SkipEmptyParts.); |
| 204 | #else |
| 205 | QString::SplitBehavior::SkipEmptyParts); |
| 206 | #endif |
| 207 | |
| 208 | auto iter = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(installed_labels); |
| 209 | |
| 210 | for (const QStringcxx . . $ QString#& lbl_id : label_ids) { |
| 211 | Labelcxx . . $ Label#* candidate_label = iter.firstOrDefaultcxx . . $ boolinq/Linq#firstOrDefault(72be2761f3eff290).([cxx . . $ std/function#function(bdc3712e480e4d04).&](const Labelcxx . . $ Label#* lbl) { |
| 212 | return lbl->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). lbl_id; |
| 213 | }); |
| 214 | |
| 215 | if (candidate_label != nullptr) { |
| 216 | labels <<cxx . . $ QList#`operator<<`(ddd37d5bfdbbfc74). candidate_label; |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | return labels; |
| 222 | } |
| 223 | |
| 224 | bool DatabaseQueriescxx . . $ DatabaseQueries#::updateLabelcxx . . $ DatabaseQueries#updateLabel(a7855bcaaeb22eb).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Labelcxx . . $ Label#* label) { |
| 225 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 226 | |
| 227 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 228 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Labels SET name = :name, color = :color " |
| 229 | "WHERE id = :id AND account_id = :account_id;")); |
| 230 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":name"), labelcxx . . $ QVariant#QVariant(132dd6869045752b).->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).()); |
| 231 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":color"), labelcxx . . $ QVariant#QVariant(132dd6869045752b).->colorcxx . . $ Label#color(6d62b116d5d1b12f).().namecxx . . $ QColor#name(f2bb36c0a1d70d89).()); |
| 232 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 233 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 234 | |
| 235 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 236 | } |
| 237 | |
| 238 | bool DatabaseQueriescxx . . $ DatabaseQueries#::deleteLabelcxx . . $ DatabaseQueries#deleteLabel(a7855bcaaeb22eb).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Labelcxx . . $ Label#* label) { |
| 239 | // NOTE: All dependecies are done via SQL foreign cascaded keys, so no |
| 240 | // extra removals are needed. |
| 241 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 242 | |
| 243 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 244 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Labels WHERE id = :id AND account_id = :account_id;")); |
| 245 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 246 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 247 | |
| 248 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 249 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages " |
| 250 | "SET labels = REPLACE(Messages.labels, :label, \".\") " |
| 251 | "WHERE account_id = :account_id;")); |
| 252 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":label"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(".%1.").argcxx . . $ QString#arg(ad0bca07273edcc2).(label->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).())); |
| 253 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 254 | |
| 255 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 256 | } |
| 257 | else { |
| 258 | return false; |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | bool DatabaseQueriescxx . . $ DatabaseQueries#::createLabelcxx . . $ DatabaseQueries#createLabel(73c307d30be60cd2).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Labelcxx . . $ Label#* label, int account_id) { |
| 263 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 264 | |
| 265 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 266 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("INSERT INTO Labels (name, color, custom_id, account_id) " |
| 267 | "VALUES (:name, :color, :custom_id, :account_id);")); |
| 268 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":name"), labelcxx . . $ QVariant#QVariant(132dd6869045752b).->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).()); |
| 269 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":color"), labelcxx . . $ QVariant#QVariant(132dd6869045752b).->colorcxx . . $ Label#color(6d62b116d5d1b12f).().namecxx . . $ QColor#name(f2bb36c0a1d70d89).()); |
| 270 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":custom_id"), labelcxx . . $ QVariant#QVariant(132dd6869045752b).->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).()); |
| 271 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 272 | |
| 273 | auto res = q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 274 | |
| 275 | if (res && q.lastInsertIdcxx . . $ QSqlQuery#lastInsertId(23280f95d1ccaa1f).().isValidcxx . . $ QVariant#isValid(50ce9a9e25b4a850).()) { |
| 276 | label->setIdcxx . . $ RootItem#setId(d4f767463ce0a6b3).(q.lastInsertIdcxx . . $ QSqlQuery#lastInsertId(23280f95d1ccaa1f).().toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 277 | |
| 278 | // NOTE: This custom ID in this object will be probably |
| 279 | // overwritten in online-synchronized labels. |
| 280 | if (label->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 281 | label->setCustomIdcxx . . $ RootItem#setCustomId(3520e46b33348bf6).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(label->idcxx . . $ RootItem#id(455f465bc33b4cdf).())); |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | // Fixup missing custom IDs. |
| 286 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Labels SET custom_id = id WHERE custom_id IS NULL OR custom_id = '';")); |
| 287 | |
| 288 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && res; |
| 289 | } |
| 290 | |
| 291 | void DatabaseQueriescxx . . $ DatabaseQueries#::updateProbecxx . . $ DatabaseQueries#updateProbe(fa2550e03bfb9411).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Searchcxx . . $ Search#* probe) { |
| 292 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 293 | |
| 294 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 295 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Probes SET name = :name, fltr = :fltr, color = :color " |
| 296 | "WHERE id = :id AND account_id = :account_id;")); |
| 297 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":name"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).()); |
| 298 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":fltr"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->filtercxx . . $ Search#filter(6ef7b6c27b00b43d).()); |
| 299 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":color"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->colorcxx . . $ Search#color(6d62b116d5d1b12f).().namecxx . . $ QColor#name(f2bb36c0a1d70d89).()); |
| 300 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), probecxx . . $ QVariant#QVariant(f349c77f591a7878).->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 301 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), probecxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 302 | |
| 303 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 304 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | void DatabaseQueriescxx . . $ DatabaseQueries#::createProbecxx . . $ DatabaseQueries#createProbe(d7d88ad6777f6b46).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Searchcxx . . $ Search#* probe, int account_id) { |
| 309 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 310 | |
| 311 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 312 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("INSERT INTO Probes (name, color, fltr, account_id) " |
| 313 | "VALUES (:name, :color, :fltr, :account_id);")); |
| 314 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":name"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).()); |
| 315 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":fltr"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->filtercxx . . $ Search#filter(6ef7b6c27b00b43d).()); |
| 316 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":color"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->colorcxx . . $ Search#color(6d62b116d5d1b12f).().namecxx . . $ QColor#name(f2bb36c0a1d70d89).()); |
| 317 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 318 | |
| 319 | auto res = q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 320 | |
| 321 | if (res && q.lastInsertIdcxx . . $ QSqlQuery#lastInsertId(23280f95d1ccaa1f).().isValidcxx . . $ QVariant#isValid(50ce9a9e25b4a850).()) { |
| 322 | probe->setIdcxx . . $ RootItem#setId(d4f767463ce0a6b3).(q.lastInsertIdcxx . . $ QSqlQuery#lastInsertId(23280f95d1ccaa1f).().toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 323 | probe->setCustomIdcxx . . $ RootItem#setCustomId(3520e46b33348bf6).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(probe->idcxx . . $ RootItem#id(455f465bc33b4cdf).())); |
| 324 | } |
| 325 | else { |
| 326 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | QListcxx . . $ QList#<Searchcxx . . $ Search#*> DatabaseQueriescxx . . $ DatabaseQueries#::getProbesForAccountcxx . . $ DatabaseQueries#getProbesForAccount(5b3ed83d3c41d7a8).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id) { |
| 331 | QListcxx . . $ QList#<Searchcxx . . $ Search#*> probescxx . . $ QList#QList(ced63f7c635d850d).; |
| 332 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 333 | |
| 334 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 335 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT * FROM Probes WHERE account_id = :account_id;")); |
| 336 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 337 | |
| 338 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 339 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 340 | Searchcxx . . $ Search#* prob = new Searchcxx . . $ Search#Search(f041c5f58b9268d).(q.valuecxx . . $ QSqlQuery#value(d37d495c0a7682cc).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("name")).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(), |
| 341 | q.valuecxx . . $ QSqlQuery#value(d37d495c0a7682cc).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("fltr")).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(), |
| 342 | QColorcxx . . $ QColor#QColor(3520e46b33348bf6).(q.valuecxx . . $ QSqlQuery#value(d37d495c0a7682cc).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("color")).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).())); |
| 343 | |
| 344 | prob->setIdcxx . . $ RootItem#setId(d4f767463ce0a6b3).(q.valuecxx . . $ QSqlQuery#value(d37d495c0a7682cc).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("id")).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 345 | prob->setCustomIdcxx . . $ RootItem#setCustomId(3520e46b33348bf6).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(prob->idcxx . . $ RootItem#id(455f465bc33b4cdf).())); |
| 346 | |
| 347 | probes <<cxx . . $ QList#`operator<<`(ddd37d5bfdbbfc74). prob; |
| 348 | } |
| 349 | } |
| 350 | else { |
| 351 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 352 | } |
| 353 | |
| 354 | return probes; |
| 355 | } |
| 356 | |
| 357 | void DatabaseQueriescxx . . $ DatabaseQueries#::deleteProbecxx . . $ DatabaseQueries#deleteProbe(fa2550e03bfb9411).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Searchcxx . . $ Search#* probe) { |
| 358 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 359 | |
| 360 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 361 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Probes WHERE id = :id AND account_id = :account_id;")); |
| 362 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), probecxx . . $ QVariant#QVariant(f349c77f591a7878).->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 363 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), probecxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 364 | |
| 365 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 366 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | bool DatabaseQueriescxx . . $ DatabaseQueries#::markLabelledMessagesReadUnreadcxx . . $ DatabaseQueries#markLabelledMessagesReadUnread(4b562595980e6cc6).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Labelcxx . . $ Label#* label, RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# read) { |
| 371 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 372 | |
| 373 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 374 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_read = :read " |
| 375 | "WHERE " |
| 376 | " is_deleted = 0 AND " |
| 377 | " is_pdeleted = 0 AND " |
| 378 | " account_id = :account_id AND " |
| 379 | " labels LIKE :label;")); |
| 380 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 1 : 0); |
| 381 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 382 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":label"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("%.%1.%").argcxx . . $ QString#arg(ad0bca07273edcc2).(label->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).())); |
| 383 | |
| 384 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 385 | } |
| 386 | |
| 387 | bool DatabaseQueriescxx . . $ DatabaseQueries#::markImportantMessagesReadUnreadcxx . . $ DatabaseQueries#markImportantMessagesReadUnread(a6849f7a0a1d92ee).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 388 | int account_id, |
| 389 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# read) { |
| 390 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 391 | |
| 392 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 393 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_read = :read " |
| 394 | "WHERE is_important = 1 AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 395 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 1 : 0); |
| 396 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 397 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 398 | } |
| 399 | |
| 400 | bool DatabaseQueriescxx . . $ DatabaseQueries#::markUnreadMessagesReadcxx . . $ DatabaseQueries#markUnreadMessagesRead(d8032dc71cca56cc).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id) { |
| 401 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 402 | |
| 403 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 404 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_read = :read " |
| 405 | "WHERE is_read = 0 AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 406 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), 1cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 407 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 408 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 409 | } |
| 410 | |
| 411 | bool DatabaseQueriescxx . . $ DatabaseQueries#::markMessagesReadUnreadcxx . . $ DatabaseQueries#markMessagesReadUnread(4554379270358a8).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 412 | const QStringListcxx . . $ QStringList#& ids, |
| 413 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# read) { |
| 414 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 415 | |
| 416 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 417 | return q.execcxx . . $ QSqlQuery#exec(e1defb592416720d).(QStringcxx . . $ QString#(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_read = %2 WHERE id IN (%1);")) |
| 418 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(ids.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")), read == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("1") : QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("0"))); |
| 419 | } |
| 420 | |
| 421 | void DatabaseQueriescxx . . $ DatabaseQueries#::markMessagesReadUnreadImportantcxx . . $ DatabaseQueries#markMessagesReadUnreadImportant(29e762a1ad0fa08d).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 422 | int account_id, |
| 423 | const QStringListcxx . . $ QStringList#& custom_ids, |
| 424 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# read, |
| 425 | RootItemcxx . . $ RootItem#::Importancecxx . . $ RootItem#Importance# important) { |
| 426 | auto stringed_ids = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(b7d1e764049f5e37).(custom_ids.begincxx . . $ QList#begin(84b7b73c4fb47a00).(), custom_ids.endcxx . . $ QList#end(84b7b73c4fb47a00).()) |
| 427 | .selectcxx . . $ boolinq/Linq#select(a3f5bd4cd382e0ee).([](const QStringcxx . . $ QString#& id) { |
| 428 | return QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("'%1'").argcxx . . $ QString#arg(ad0bca07273edcc2).(id); |
| 429 | }) |
| 430 | .toStdListcxx . . $ boolinq/Linq#toStdList(2989115be80c3067).(); |
| 431 | |
| 432 | QStringListcxx . . $ QStringList# textual_ids = FROM_STD_LISTcxx . . $ `src/librssguard/definitions/definitions.h:405:9`!(QStringList, stringed_ids); |
| 433 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 434 | QStringListcxx . . $ QStringList# setterscxx . . $ QList#QList(ced63f7c635d850d).; |
| 435 | |
| 436 | if (read != RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Unknowncxx . . $ RootItem#ReadStatus#Unknown.) { |
| 437 | setters.appendcxx . . $ QList#append(1262c8661f7a27a7).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("is_read = :read")); |
| 438 | } |
| 439 | |
| 440 | if (important != RootItemcxx . . $ RootItem#::Importancecxx . . $ RootItem#Importance#::Unknowncxx . . $ RootItem#Importance#Unknown.) { |
| 441 | setters.appendcxx . . $ QList#append(1262c8661f7a27a7).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("is_important = :important")); |
| 442 | } |
| 443 | |
| 444 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 445 | |
| 446 | QStringcxx . . $ QString# statement = QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET %1 " |
| 447 | " WHERE account_id = :account_id AND custom_id in (%2);") |
| 448 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(setters.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(", "cxx . . $ QString#QString(85c52e162fed56f9).), textual_ids.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(", "cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 449 | |
| 450 | if (!q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(statement)) { |
| 451 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 452 | } |
| 453 | |
| 454 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), intcxx . . $ QVariant#QVariant(f349c77f591a7878).(read)); |
| 455 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":important"), intcxx . . $ QVariant#QVariant(f349c77f591a7878).(important)); |
| 456 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 457 | |
| 458 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 459 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | bool DatabaseQueriescxx . . $ DatabaseQueries#::markMessageImportantcxx . . $ DatabaseQueries#markMessageImportant(a3904fcd587d1933).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int id, RootItemcxx . . $ RootItem#::Importancecxx . . $ RootItem#Importance# importance) { |
| 464 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 465 | |
| 466 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 467 | |
| 468 | if (!q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_important = :important WHERE id = :id;"))) { |
| 469 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Query preparation failed for message importance switch."; |
| 470 | return false; |
| 471 | } |
| 472 | |
| 473 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 474 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":important"), (cxx . . $ QVariant#QVariant(f349c77f591a7878).int)importance); |
| 475 | |
| 476 | // Commit changes. |
| 477 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 478 | } |
| 479 | |
| 480 | bool DatabaseQueriescxx . . $ DatabaseQueries#::markFeedsReadUnreadcxx . . $ DatabaseQueries#markFeedsReadUnread(1d4cb37e97857cd1).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 481 | const QStringListcxx . . $ QStringList#& ids, |
| 482 | int account_id, |
| 483 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# read) { |
| 484 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 485 | |
| 486 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 487 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_read = :read " |
| 488 | "WHERE feed IN (%1) AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;") |
| 489 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(ids.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 490 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 1 : 0); |
| 491 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 492 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 493 | } |
| 494 | |
| 495 | bool DatabaseQueriescxx . . $ DatabaseQueries#::markBinReadUnreadcxx . . $ DatabaseQueries#markBinReadUnread(a6849f7a0a1d92ee).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# read) { |
| 496 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 497 | |
| 498 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 499 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_read = :read " |
| 500 | "WHERE is_deleted = 1 AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 501 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 1 : 0); |
| 502 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 503 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 504 | } |
| 505 | |
| 506 | bool DatabaseQueriescxx . . $ DatabaseQueries#::markAccountReadUnreadcxx . . $ DatabaseQueries#markAccountReadUnread(a6849f7a0a1d92ee).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# read) { |
| 507 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 508 | |
| 509 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 510 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_read = :read WHERE is_pdeleted = 0 AND account_id = :account_id;")); |
| 511 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 512 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 1 : 0); |
| 513 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 514 | } |
| 515 | |
| 516 | bool DatabaseQueriescxx . . $ DatabaseQueries#::switchMessagesImportancecxx . . $ DatabaseQueries#switchMessagesImportance(59fcf4db2fbeb461).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, const QStringListcxx . . $ QStringList#& ids) { |
| 517 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 518 | |
| 519 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 520 | return q.execcxx . . $ QSqlQuery#exec(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_important = NOT is_important WHERE id IN (%1);").argcxx . . $ QString#arg(ad0bca07273edcc2).(ids.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 521 | } |
| 522 | |
| 523 | bool DatabaseQueriescxx . . $ DatabaseQueries#::permanentlyDeleteMessagescxx . . $ DatabaseQueries#permanentlyDeleteMessages(59fcf4db2fbeb461).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, const QStringListcxx . . $ QStringList#& ids) { |
| 524 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 525 | |
| 526 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 527 | return q.execcxx . . $ QSqlQuery#exec(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_pdeleted = 1 WHERE id IN (%1);").argcxx . . $ QString#arg(ad0bca07273edcc2).(ids.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 528 | } |
| 529 | |
| 530 | bool DatabaseQueriescxx . . $ DatabaseQueries#::deleteOrRestoreMessagesToFromBincxx . . $ DatabaseQueries#deleteOrRestoreMessagesToFromBin(168f965d3558a7f8).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, const QStringListcxx . . $ QStringList#& ids, bool deleted) { |
| 531 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 532 | |
| 533 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 534 | return q.execcxx . . $ QSqlQuery#exec(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_deleted = %2, is_pdeleted = %3 WHERE id IN (%1);") |
| 535 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(ids.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")), QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(deleted ? 1 : 0), QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(0))); |
| 536 | } |
| 537 | |
| 538 | bool DatabaseQueriescxx . . $ DatabaseQueries#::restoreBincxx . . $ DatabaseQueries#restoreBin(d8032dc71cca56cc).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id) { |
| 539 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 540 | |
| 541 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 542 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_deleted = 0 " |
| 543 | "WHERE is_deleted = 1 AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 544 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 545 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 546 | } |
| 547 | |
| 548 | bool DatabaseQueriescxx . . $ DatabaseQueries#::removeUnwantedArticlesFromFeedcxx . . $ DatabaseQueries#removeUnwantedArticlesFromFeed(327d2d92bc5b0542).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 549 | const Feedcxx . . $ Feed#* feed, |
| 550 | const Feedcxx . . $ Feed#::ArticleIgnoreLimitcxx . . $ Feed#ArticleIgnoreLimit#& feed_setup, |
| 551 | const Feedcxx . . $ Feed#::ArticleIgnoreLimitcxx . . $ Feed#ArticleIgnoreLimit#& app_setup) { |
| 552 | // Feed setup has higher preference. |
| 553 | int amount_to_keep = |
| 554 | feed_setup.m_customizeLimittingcxx . . $ Feed#ArticleIgnoreLimit#m_customizeLimitting. ? feed_setup.m_keepCountOfArticlescxx . . $ Feed#ArticleIgnoreLimit#m_keepCountOfArticles. : app_setup.m_keepCountOfArticlescxx . . $ Feed#ArticleIgnoreLimit#m_keepCountOfArticles.; |
| 555 | bool dont_remove_unread = |
| 556 | feed_setup.m_customizeLimittingcxx . . $ Feed#ArticleIgnoreLimit#m_customizeLimitting. ? feed_setup.m_doNotRemoveUnreadcxx . . $ Feed#ArticleIgnoreLimit#m_doNotRemoveUnread. : app_setup.m_doNotRemoveUnreadcxx . . $ Feed#ArticleIgnoreLimit#m_doNotRemoveUnread.; |
| 557 | bool dont_remove_starred = |
| 558 | feed_setup.m_customizeLimittingcxx . . $ Feed#ArticleIgnoreLimit#m_customizeLimitting. ? feed_setup.m_doNotRemoveStarredcxx . . $ Feed#ArticleIgnoreLimit#m_doNotRemoveStarred. : app_setup.m_doNotRemoveStarredcxx . . $ Feed#ArticleIgnoreLimit#m_doNotRemoveStarred.; |
| 559 | bool recycle_dont_purge = |
| 560 | feed_setup.m_customizeLimittingcxx . . $ Feed#ArticleIgnoreLimit#m_customizeLimitting. ? feed_setup.m_moveToBinDontPurgecxx . . $ Feed#ArticleIgnoreLimit#m_moveToBinDontPurge. : app_setup.m_moveToBinDontPurgecxx . . $ Feed#ArticleIgnoreLimit#m_moveToBinDontPurge.; |
| 561 | |
| 562 | if (amount_to_keep <= 0) { |
| 563 | // No articles will be removed, quitting. |
| 564 | return false; |
| 565 | } |
| 566 | |
| 567 | // We find datetime stamp of oldest article which will be NOT moved/removed. |
| 568 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 569 | |
| 570 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 571 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT Messages.date_created " |
| 572 | "FROM Messages " |
| 573 | "WHERE " |
| 574 | " Messages.account_id = :account_id AND " |
| 575 | " Messages.feed = :feed AND " |
| 576 | " Messages.is_deleted = 0 AND " |
| 577 | " Messages.is_pdeleted = 0 " |
| 578 | "ORDER BY Messages.date_created DESC " |
| 579 | "LIMIT 1 OFFSET :offset;")); |
| 580 | |
| 581 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":offset"), amount_to_keepcxx . . $ QVariant#QVariant(f349c77f591a7878). - 1); |
| 582 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), feedcxx . . $ QVariant#QVariant(132dd6869045752b).->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).()); |
| 583 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), feedcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 584 | |
| 585 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 586 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 587 | } |
| 588 | |
| 589 | if (!q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 590 | return false; |
| 591 | } |
| 592 | |
| 593 | qlonglongcxx . . $ qlonglong# last_kept_stamp = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toLongLongcxx . . $ QVariant#toLongLong(4afa307e6140ced).(); |
| 594 | |
| 595 | if (recycle_dont_purge) { |
| 596 | // We mark all older articles as deleted. |
| 597 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages " |
| 598 | "SET is_deleted = 1 " |
| 599 | "WHERE " |
| 600 | " Messages.account_id = :account_id AND " |
| 601 | " Messages.feed = :feed AND " |
| 602 | " Messages.is_deleted = 0 AND " |
| 603 | " Messages.is_pdeleted = 0 AND " |
| 604 | " Messages.is_important != :is_important AND " |
| 605 | " Messages.is_read != :is_read AND " |
| 606 | " Messages.date_created < :stamp")); |
| 607 | } |
| 608 | else { |
| 609 | // We purge all older articles. |
| 610 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages " |
| 611 | "WHERE " |
| 612 | " Messages.account_id = :account_id AND " |
| 613 | " Messages.feed = :feed AND " |
| 614 | " (Messages.is_deleted = 1 OR Messages.is_important != :is_important) AND " |
| 615 | " (Messages.is_deleted = 1 OR Messages.is_read != :is_read) AND " |
| 616 | " Messages.date_created < :stamp")); |
| 617 | } |
| 618 | |
| 619 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_important"), dont_remove_starredcxx . . $ QVariant#QVariant(f349c77f591a7878). ? 1 : 2); |
| 620 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_read"), dont_remove_unreadcxx . . $ QVariant#QVariant(f349c77f591a7878). ? 0 : 2); |
| 621 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), feedcxx . . $ QVariant#QVariant(132dd6869045752b).->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).()); |
| 622 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":stamp"), last_kept_stampcxx . . $ QVariant#QVariant(1ca78f0f7b9b0ce5).); |
| 623 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), feedcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 624 | |
| 625 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 626 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 627 | } |
| 628 | |
| 629 | int rows_deleted = q.numRowsAffectedcxx . . $ QSqlQuery#numRowsAffected(455f465bc33b4cdf).(); |
| 630 | |
| 631 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Feed cleanup has recycled/purged" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). NONQUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:429:9`!(rows_deleted) |
| 632 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "old articles from feed" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(feed->customId()); |
| 633 | |
| 634 | return rows_deleted > 0; |
| 635 | } |
| 636 | |
| 637 | bool DatabaseQueriescxx . . $ DatabaseQueries#::purgeFeedArticlescxx . . $ DatabaseQueries#purgeFeedArticles(c2e7f2e2d78ac7b1).(const QSqlDatabasecxx . . $ QSqlDatabase#& database, const QListcxx . . $ QList#<Feedcxx . . $ Feed#*>& feeds) { |
| 638 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(database); |
| 639 | |
| 640 | auto feed_clauses = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(feeds) |
| 641 | .selectcxx . . $ boolinq/Linq#select(a3f5bd4cd382e0ee).([](Feedcxx . . $ Feed#* feed) { |
| 642 | return QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("(" |
| 643 | "Messages.feed = '%1' AND " |
| 644 | "Messages.account_id = %2 AND " |
| 645 | "Messages.is_important = 0" |
| 646 | ")") |
| 647 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(feed->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).(), QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(feed->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).())); |
| 648 | }) |
| 649 | .toStdListcxx . . $ boolinq/Linq#toStdList(2989115be80c3067).(); |
| 650 | |
| 651 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ `operator<<`(1030d5f4384a4f12). feed_clauses; |
| 652 | |
| 653 | QStringListcxx . . $ QStringList# feed_str_clauses = FROM_STD_LISTcxx . . $ `src/librssguard/definitions/definitions.h:405:9`!(QStringList, feed_clauses); |
| 654 | QStringcxx . . $ QString# feed_clause = feed_str_clauses.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(" OR ")); |
| 655 | |
| 656 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 657 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages WHERE %1;").argcxx . . $ QString#arg(ad0bca07273edcc2).(feed_clause)); |
| 658 | |
| 659 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 660 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 661 | } |
| 662 | else { |
| 663 | return q.numRowsAffectedcxx . . $ QSqlQuery#numRowsAffected(455f465bc33b4cdf).() > 0; |
| 664 | } |
| 665 | } |
| 666 | |
| 667 | bool DatabaseQueriescxx . . $ DatabaseQueries#::purgeMessagecxx . . $ DatabaseQueries#purgeMessage(d8032dc71cca56cc).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int message_id) { |
| 668 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 669 | |
| 670 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 671 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages WHERE id = :id;")); |
| 672 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), message_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 673 | |
| 674 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 675 | } |
| 676 | |
| 677 | bool DatabaseQueriescxx . . $ DatabaseQueries#::purgeImportantMessagescxx . . $ DatabaseQueries#purgeImportantMessages(3c705936300d7182).(const QSqlDatabasecxx . . $ QSqlDatabase#& db) { |
| 678 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 679 | |
| 680 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 681 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages WHERE is_important = 1 AND is_deleted = :is_deleted;")); |
| 682 | |
| 683 | // Remove only messages which are NOT in recycle bin. |
| 684 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_deleted"), 0cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 685 | |
| 686 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 687 | } |
| 688 | |
| 689 | bool DatabaseQueriescxx . . $ DatabaseQueries#::purgeReadMessagescxx . . $ DatabaseQueries#purgeReadMessages(3c705936300d7182).(const QSqlDatabasecxx . . $ QSqlDatabase#& db) { |
| 690 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 691 | |
| 692 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 693 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages " |
| 694 | "WHERE is_important = :is_important AND is_deleted = :is_deleted AND is_read = :is_read;")); |
| 695 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_read"), 1cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 696 | |
| 697 | // Remove only messages which are NOT in recycle bin. |
| 698 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_deleted"), 0cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 699 | |
| 700 | // Remove only messages which are NOT starred. |
| 701 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_important"), 0cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 702 | |
| 703 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 704 | } |
| 705 | |
| 706 | bool DatabaseQueriescxx . . $ DatabaseQueries#::purgeOldMessagescxx . . $ DatabaseQueries#purgeOldMessages(d8032dc71cca56cc).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int older_than_days) { |
| 707 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 708 | const qint64cxx . . $ qint64# since_epoch = older_than_days == 0 |
| 709 | ? QDateTimecxx . . $ QDateTime#::currentDateTimeUtccxx . . $ QDateTime#currentDateTimeUtc(bf5129c8228c71c0).().addYearscxx . . $ QDateTime#addYears(8aa73c77f8b59554).(10).toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).() |
| 710 | : QDateTimecxx . . $ QDateTime#::currentDateTimeUtccxx . . $ QDateTime#currentDateTimeUtc(bf5129c8228c71c0).().addDayscxx . . $ QDateTime#addDays(95f9ba7c82d0c5e8).(-older_than_days).toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).(); |
| 711 | |
| 712 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 713 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages WHERE is_important = :is_important AND date_created < :date_created;")); |
| 714 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":date_created"), since_epochcxx . . $ QVariant#QVariant(1ca78f0f7b9b0ce5).); |
| 715 | |
| 716 | // Remove only messages which are NOT starred. |
| 717 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_important"), 0cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 718 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 719 | } |
| 720 | |
| 721 | bool DatabaseQueriescxx . . $ DatabaseQueries#::purgeRecycleBincxx . . $ DatabaseQueries#purgeRecycleBin(3c705936300d7182).(const QSqlDatabasecxx . . $ QSqlDatabase#& db) { |
| 722 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 723 | |
| 724 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 725 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages WHERE is_important = :is_important AND is_deleted = :is_deleted;")); |
| 726 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_deleted"), 1cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 727 | |
| 728 | // Remove only messages which are NOT starred. |
| 729 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_important"), 0cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 730 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 731 | } |
| 732 | |
| 733 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, ArticleCountscxx . . $ ArticleCounts#> DatabaseQueriescxx . . $ DatabaseQueries#::getMessageCountsForCategorycxx . . $ DatabaseQueries#getMessageCountsForCategory(b20aeb44528a646c).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 734 | const QStringcxx . . $ QString#& custom_id, |
| 735 | int account_id, |
| 736 | bool include_total_counts, |
| 737 | bool* ok) { |
| 738 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, ArticleCountscxx . . $ ArticleCounts#> countscxx . . $ QMap#QMap(49f6e7a06ebc5aa8).; |
| 739 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 740 | |
| 741 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 742 | |
| 743 | if (include_total_counts) { |
| 744 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT feed, SUM((is_read + 1) % 2), COUNT(*) FROM Messages " |
| 745 | "WHERE feed IN (SELECT custom_id FROM Feeds WHERE category = :category AND account_id = :account_id) " |
| 746 | "AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id " |
| 747 | "GROUP BY feed;")); |
| 748 | } |
| 749 | else { |
| 750 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT feed, SUM((is_read + 1) % 2) FROM Messages " |
| 751 | "WHERE feed IN (SELECT custom_id FROM Feeds WHERE category = :category AND account_id = :account_id) " |
| 752 | "AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id " |
| 753 | "GROUP BY feed;")); |
| 754 | } |
| 755 | |
| 756 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":category"), custom_idcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 757 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 758 | |
| 759 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 760 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 761 | QStringcxx . . $ QString# feed_custom_id = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 762 | ArticleCountscxx . . $ ArticleCounts# ac; |
| 763 | |
| 764 | ac.m_unreadcxx . . $ ArticleCounts#m_unread. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 765 | |
| 766 | if (include_total_counts) { |
| 767 | ac.m_totalcxx . . $ ArticleCounts#m_total. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(2).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 768 | } |
| 769 | |
| 770 | counts.insertcxx . . $ QMap#insert(929a1ed410fe8423).(feed_custom_id, ac); |
| 771 | } |
| 772 | |
| 773 | if (ok != nullptr) { |
| 774 | *ok = true; |
| 775 | } |
| 776 | } |
| 777 | else { |
| 778 | if (ok != nullptr) { |
| 779 | *ok = false; |
| 780 | } |
| 781 | } |
| 782 | |
| 783 | return counts; |
| 784 | } |
| 785 | |
| 786 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, ArticleCountscxx . . $ ArticleCounts#> DatabaseQueriescxx . . $ DatabaseQueries#::getMessageCountsForAccountcxx . . $ DatabaseQueries#getMessageCountsForAccount(3410d90e01f07fe7).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 787 | int account_id, |
| 788 | bool include_total_counts, |
| 789 | bool* ok) { |
| 790 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, ArticleCountscxx . . $ ArticleCounts#> countscxx . . $ QMap#QMap(49f6e7a06ebc5aa8).; |
| 791 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 792 | |
| 793 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 794 | |
| 795 | if (include_total_counts) { |
| 796 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT feed, SUM((is_read + 1) % 2), COUNT(*) FROM Messages " |
| 797 | "WHERE is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id " |
| 798 | "GROUP BY feed;")); |
| 799 | } |
| 800 | else { |
| 801 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT feed, SUM((is_read + 1) % 2) FROM Messages " |
| 802 | "WHERE is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id " |
| 803 | "GROUP BY feed;")); |
| 804 | } |
| 805 | |
| 806 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 807 | |
| 808 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 809 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 810 | QStringcxx . . $ QString# feed_id = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 811 | ArticleCountscxx . . $ ArticleCounts# ac; |
| 812 | |
| 813 | ac.m_unreadcxx . . $ ArticleCounts#m_unread. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 814 | |
| 815 | if (include_total_counts) { |
| 816 | ac.m_totalcxx . . $ ArticleCounts#m_total. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(2).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 817 | } |
| 818 | |
| 819 | counts.insertcxx . . $ QMap#insert(929a1ed410fe8423).(feed_id, ac); |
| 820 | } |
| 821 | |
| 822 | if (ok != nullptr) { |
| 823 | *ok = true; |
| 824 | } |
| 825 | } |
| 826 | else { |
| 827 | if (ok != nullptr) { |
| 828 | *ok = false; |
| 829 | } |
| 830 | } |
| 831 | |
| 832 | return counts; |
| 833 | } |
| 834 | |
| 835 | ArticleCountscxx . . $ ArticleCounts# DatabaseQueriescxx . . $ DatabaseQueries#::getMessageCountsForFeedcxx . . $ DatabaseQueries#getMessageCountsForFeed(ec4e5aceab213f40).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 836 | const QStringcxx . . $ QString#& feed_custom_id, |
| 837 | int account_id, |
| 838 | bool* ok) { |
| 839 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 840 | |
| 841 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 842 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT COUNT(*), SUM(is_read) FROM Messages " |
| 843 | "WHERE feed = :feed AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 844 | |
| 845 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), feed_custom_idcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 846 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 847 | |
| 848 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 849 | if (ok != nullptr) { |
| 850 | *ok = true; |
| 851 | } |
| 852 | |
| 853 | ArticleCountscxx . . $ ArticleCounts# ac; |
| 854 | |
| 855 | ac.m_totalcxx . . $ ArticleCounts#m_total. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 856 | ac.m_unreadcxx . . $ ArticleCounts#m_unread. = ac.m_totalcxx . . $ ArticleCounts#m_total. - q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 857 | |
| 858 | return ac; |
| 859 | } |
| 860 | else { |
| 861 | if (ok != nullptr) { |
| 862 | *ok = false; |
| 863 | } |
| 864 | |
| 865 | return {}; |
| 866 | } |
| 867 | } |
| 868 | |
| 869 | ArticleCountscxx . . $ ArticleCounts# DatabaseQueriescxx . . $ DatabaseQueries#::getMessageCountsForLabelcxx . . $ DatabaseQueries#getMessageCountsForLabel(3768de87b62ffc36).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 870 | Labelcxx . . $ Label#* label, |
| 871 | int account_id, |
| 872 | bool* ok) { |
| 873 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 874 | |
| 875 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 876 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT COUNT(*), SUM(is_read) FROM Messages " |
| 877 | "WHERE " |
| 878 | " is_deleted = 0 AND " |
| 879 | " is_pdeleted = 0 AND " |
| 880 | " account_id = :account_id AND " |
| 881 | " labels LIKE :label;")); |
| 882 | |
| 883 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 884 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":label"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("%.%1.%").argcxx . . $ QString#arg(ad0bca07273edcc2).(label->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).())); |
| 885 | |
| 886 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 887 | if (ok != nullptr) { |
| 888 | *ok = true; |
| 889 | } |
| 890 | |
| 891 | ArticleCountscxx . . $ ArticleCounts# ac; |
| 892 | |
| 893 | ac.m_totalcxx . . $ ArticleCounts#m_total. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 894 | ac.m_unreadcxx . . $ ArticleCounts#m_unread. = ac.m_totalcxx . . $ ArticleCounts#m_total. - q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 895 | |
| 896 | return ac; |
| 897 | } |
| 898 | else { |
| 899 | if (ok != nullptr) { |
| 900 | *ok = false; |
| 901 | } |
| 902 | |
| 903 | return {}; |
| 904 | } |
| 905 | } |
| 906 | |
| 907 | ArticleCountscxx . . $ ArticleCounts# DatabaseQueriescxx . . $ DatabaseQueries#::getMessageCountsForProbecxx . . $ DatabaseQueries#getMessageCountsForProbe(e79300d572642315).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Searchcxx . . $ Search#* probe, int account_id) { |
| 908 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 909 | |
| 910 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 911 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT COUNT(*), SUM(is_read) FROM Messages " |
| 912 | "WHERE " |
| 913 | " is_deleted = 0 AND " |
| 914 | " is_pdeleted = 0 AND " |
| 915 | " account_id = :account_id AND " |
| 916 | " (title REGEXP :fltr OR contents REGEXP :fltr);")); |
| 917 | |
| 918 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 919 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":fltr"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->filtercxx . . $ Search#filter(6ef7b6c27b00b43d).()); |
| 920 | |
| 921 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 922 | ArticleCountscxx . . $ ArticleCounts# ac; |
| 923 | |
| 924 | ac.m_totalcxx . . $ ArticleCounts#m_total. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 925 | ac.m_unreadcxx . . $ ArticleCounts#m_unread. = ac.m_totalcxx . . $ ArticleCounts#m_total. - q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 926 | |
| 927 | return ac; |
| 928 | } |
| 929 | else { |
| 930 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 931 | } |
| 932 | } |
| 933 | |
| 934 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, ArticleCountscxx . . $ ArticleCounts#> DatabaseQueriescxx . . $ DatabaseQueries#::getMessageCountsForAllLabelscxx . . $ DatabaseQueries#getMessageCountsForAllLabels(cf849f4456795efd).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 935 | int account_id, |
| 936 | bool* ok) { |
| 937 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, ArticleCountscxx . . $ ArticleCounts#> countscxx . . $ QMap#QMap(49f6e7a06ebc5aa8).; |
| 938 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 939 | |
| 940 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 941 | |
| 942 | if (db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_MYSQL_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:222:9`!)) { |
| 943 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT l.custom_id, CONCAT('%.', l.custom_id,'.%') pid, SUM(m.is_read), COUNT(*) FROM Labels l " |
| 944 | "INNER JOIN Messages m " |
| 945 | " ON m.account_id = l.account_id AND m.labels LIKE pid " |
| 946 | "WHERE " |
| 947 | " m.is_deleted = 0 AND " |
| 948 | " m.is_pdeleted = 0 AND " |
| 949 | " m.account_id = :account_id " |
| 950 | "GROUP BY pid;")); |
| 951 | } |
| 952 | else { |
| 953 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT l.custom_id, ('%.' || l.custom_id || '.%') pid, SUM(m.is_read), COUNT(*) FROM Labels l " |
| 954 | "INNER JOIN Messages m " |
| 955 | " ON m.account_id = l.account_id AND m.labels LIKE pid " |
| 956 | "WHERE " |
| 957 | " m.is_deleted = 0 AND " |
| 958 | " m.is_pdeleted = 0 AND " |
| 959 | " m.account_id = :account_id " |
| 960 | "GROUP BY pid;")); |
| 961 | } |
| 962 | |
| 963 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 964 | |
| 965 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 966 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 967 | QStringcxx . . $ QString# lbl_custom_id = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 968 | ArticleCountscxx . . $ ArticleCounts# ac; |
| 969 | |
| 970 | ac.m_totalcxx . . $ ArticleCounts#m_total. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(3).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 971 | ac.m_unreadcxx . . $ ArticleCounts#m_unread. = ac.m_totalcxx . . $ ArticleCounts#m_total. - q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(2).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 972 | |
| 973 | counts.insertcxx . . $ QMap#insert(929a1ed410fe8423).(lbl_custom_id, ac); |
| 974 | } |
| 975 | |
| 976 | if (ok != nullptr) { |
| 977 | *ok = true; |
| 978 | } |
| 979 | } |
| 980 | else { |
| 981 | if (ok != nullptr) { |
| 982 | *ok = false; |
| 983 | } |
| 984 | } |
| 985 | |
| 986 | return counts; |
| 987 | } |
| 988 | |
| 989 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, ArticleCountscxx . . $ ArticleCounts#> DatabaseQueriescxx . . $ DatabaseQueries#::getCountOfAssignedLabelsToMessagescxx . . $ DatabaseQueries#getCountOfAssignedLabelsToMessages(e044d6b22064745c).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 990 | const QListcxx . . $ QList#<Messagecxx . . $ Message#>& messages, |
| 991 | int account_id, |
| 992 | bool* ok) { |
| 993 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, ArticleCountscxx . . $ ArticleCounts#> countscxx . . $ QMap#QMap(49f6e7a06ebc5aa8).; |
| 994 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 995 | |
| 996 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 997 | |
| 998 | auto msgs_std = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(messages) |
| 999 | .selectcxx . . $ boolinq/Linq#select(a3f5bd4cd382e0ee).([](const Messagecxx . . $ Message#& msg) { |
| 1000 | return QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("m.custom_id = '%1'").argcxx . . $ QString#arg(ad0bca07273edcc2).(msg.m_customIdcxx . . $ Message#m_customId.); |
| 1001 | }) |
| 1002 | .toStdListcxx . . $ boolinq/Linq#toStdList(2989115be80c3067).(); |
| 1003 | |
| 1004 | QStringListcxx . . $ QStringList# msgs_lst = FROM_STD_LISTcxx . . $ `src/librssguard/definitions/definitions.h:405:9`!(QStringList, msgs_std); |
| 1005 | auto msgs = msgs_lst.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(" OR ")); |
| 1006 | |
| 1007 | if (db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_MYSQL_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:222:9`!)) { |
| 1008 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT l.custom_id, CONCAT('%.', l.custom_id,'.%') pid, SUM(m.is_read), COUNT(*) FROM Labels l " |
| 1009 | "INNER JOIN Messages m " |
| 1010 | " ON m.account_id = l.account_id AND m.labels LIKE pid " |
| 1011 | "WHERE " |
| 1012 | " m.is_deleted = 0 AND " |
| 1013 | " m.is_pdeleted = 0 AND " |
| 1014 | " m.account_id = :account_id AND " |
| 1015 | " (%1) " |
| 1016 | "GROUP BY pid;") |
| 1017 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(msgs)); |
| 1018 | } |
| 1019 | else { |
| 1020 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT l.custom_id, ('%.' || l.custom_id || '.%') pid, SUM(m.is_read), COUNT(*) FROM Labels l " |
| 1021 | "INNER JOIN Messages m " |
| 1022 | " ON m.account_id = l.account_id AND m.labels LIKE pid " |
| 1023 | "WHERE " |
| 1024 | " m.is_deleted = 0 AND " |
| 1025 | " m.is_pdeleted = 0 AND " |
| 1026 | " m.account_id = :account_id AND " |
| 1027 | " (%1) " |
| 1028 | "GROUP BY pid;") |
| 1029 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(msgs)); |
| 1030 | } |
| 1031 | |
| 1032 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1033 | |
| 1034 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1035 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1036 | QStringcxx . . $ QString# lbl_custom_id = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1037 | ArticleCountscxx . . $ ArticleCounts# ac; |
| 1038 | |
| 1039 | ac.m_totalcxx . . $ ArticleCounts#m_total. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(3).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1040 | ac.m_unreadcxx . . $ ArticleCounts#m_unread. = ac.m_totalcxx . . $ ArticleCounts#m_total. - q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(2).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1041 | |
| 1042 | counts.insertcxx . . $ QMap#insert(929a1ed410fe8423).(lbl_custom_id, ac); |
| 1043 | } |
| 1044 | |
| 1045 | if (ok != nullptr) { |
| 1046 | *ok = true; |
| 1047 | } |
| 1048 | } |
| 1049 | else { |
| 1050 | if (ok != nullptr) { |
| 1051 | *ok = false; |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | return counts; |
| 1056 | } |
| 1057 | |
| 1058 | ArticleCountscxx . . $ ArticleCounts# DatabaseQueriescxx . . $ DatabaseQueries#::getImportantMessageCountscxx . . $ DatabaseQueries#getImportantMessageCounts(133d0ce429650026).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, bool* ok) { |
| 1059 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1060 | |
| 1061 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1062 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT COUNT(*), SUM(is_read) FROM Messages " |
| 1063 | "WHERE is_important = 1 AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = " |
| 1064 | ":account_id;")); |
| 1065 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1066 | |
| 1067 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1068 | if (ok != nullptr) { |
| 1069 | *ok = true; |
| 1070 | } |
| 1071 | |
| 1072 | ArticleCountscxx . . $ ArticleCounts# ac; |
| 1073 | |
| 1074 | ac.m_totalcxx . . $ ArticleCounts#m_total. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1075 | ac.m_unreadcxx . . $ ArticleCounts#m_unread. = ac.m_totalcxx . . $ ArticleCounts#m_total. - q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1076 | |
| 1077 | return ac; |
| 1078 | } |
| 1079 | else { |
| 1080 | if (ok != nullptr) { |
| 1081 | *ok = false; |
| 1082 | } |
| 1083 | |
| 1084 | return {}; |
| 1085 | } |
| 1086 | } |
| 1087 | |
| 1088 | int DatabaseQueriescxx . . $ DatabaseQueries#::getUnreadMessageCountscxx . . $ DatabaseQueries#getUnreadMessageCounts(d1e9ebcaa61d1ff7).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, bool* ok) { |
| 1089 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1090 | |
| 1091 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1092 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT COUNT(*) FROM Messages " |
| 1093 | "WHERE is_read = 0 AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 1094 | |
| 1095 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1096 | |
| 1097 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1098 | if (ok != nullptr) { |
| 1099 | *ok = true; |
| 1100 | } |
| 1101 | |
| 1102 | return q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1103 | } |
| 1104 | else { |
| 1105 | if (ok != nullptr) { |
| 1106 | *ok = false; |
| 1107 | } |
| 1108 | |
| 1109 | return 0; |
| 1110 | } |
| 1111 | } |
| 1112 | |
| 1113 | ArticleCountscxx . . $ ArticleCounts# DatabaseQueriescxx . . $ DatabaseQueries#::getMessageCountsForBincxx . . $ DatabaseQueries#getMessageCountsForBin(133d0ce429650026).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, bool* ok) { |
| 1114 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1115 | |
| 1116 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1117 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT COUNT(*), SUM(is_read) FROM Messages " |
| 1118 | "WHERE is_deleted = 1 AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 1119 | |
| 1120 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1121 | |
| 1122 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1123 | if (ok != nullptr) { |
| 1124 | *ok = true; |
| 1125 | } |
| 1126 | |
| 1127 | ArticleCountscxx . . $ ArticleCounts# ac; |
| 1128 | |
| 1129 | ac.m_totalcxx . . $ ArticleCounts#m_total. = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1130 | ac.m_unreadcxx . . $ ArticleCounts#m_unread. = ac.m_totalcxx . . $ ArticleCounts#m_total. - q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1131 | |
| 1132 | return ac; |
| 1133 | } |
| 1134 | else { |
| 1135 | if (ok != nullptr) { |
| 1136 | *ok = false; |
| 1137 | } |
| 1138 | |
| 1139 | return {}; |
| 1140 | } |
| 1141 | } |
| 1142 | |
| 1143 | QListcxx . . $ QList#<Messagecxx . . $ Message#> DatabaseQueriescxx . . $ DatabaseQueries#::getUndeletedMessagesForProbecxx . . $ DatabaseQueries#getUndeletedMessagesForProbe(7b8a7475cb73a7c7).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, const Searchcxx . . $ Search#* probe) { |
| 1144 | QListcxx . . $ QList#<Messagecxx . . $ Message#> messagescxx . . $ QList#QList(ced63f7c635d850d).; |
| 1145 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1146 | |
| 1147 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT %1 " |
| 1148 | "FROM Messages " |
| 1149 | "WHERE " |
| 1150 | " Messages.is_deleted = 0 AND " |
| 1151 | " Messages.is_pdeleted = 0 AND " |
| 1152 | " Messages.account_id = :account_id AND " |
| 1153 | " (title REGEXP :fltr OR contents REGEXP :fltr);") |
| 1154 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(messageTableAttributescxx . . $ DatabaseQueries#messageTableAttributes(dd908507b11f616c).(true, db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_SQLITE_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:227:9`!)) |
| 1155 | .valuescxx . . $ QMap#values(16615713d304f37e).() |
| 1156 | .joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 1157 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), probecxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 1158 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":fltr"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->filtercxx . . $ Search#filter(6ef7b6c27b00b43d).()); |
| 1159 | |
| 1160 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1161 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1162 | bool decoded; |
| 1163 | Messagecxx . . $ Message# message = Messagecxx . . $ Message#::fromSqlRecordcxx . . $ Message#fromSqlRecord(195b8e11f7f7a4ad).(q.recordcxx . . $ QSqlQuery#record(bb20731da56c592d).(), &decoded); |
| 1164 | |
| 1165 | if (decoded) { |
| 1166 | messages.appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1167 | } |
| 1168 | } |
| 1169 | } |
| 1170 | else { |
| 1171 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 1172 | } |
| 1173 | |
| 1174 | return messages; |
| 1175 | } |
| 1176 | |
| 1177 | QListcxx . . $ QList#<Messagecxx . . $ Message#> DatabaseQueriescxx . . $ DatabaseQueries#::getUndeletedMessagesWithLabelcxx . . $ DatabaseQueries#getUndeletedMessagesWithLabel(279f162fe273670b).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, const Labelcxx . . $ Label#* label, bool* ok) { |
| 1178 | QListcxx . . $ QList#<Messagecxx . . $ Message#> messagescxx . . $ QList#QList(ced63f7c635d850d).; |
| 1179 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1180 | |
| 1181 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT %1 " |
| 1182 | "FROM Messages " |
| 1183 | "INNER JOIN Feeds " |
| 1184 | "ON Messages.feed = Feeds.custom_id AND Messages.account_id = :account_id AND Messages.account_id = " |
| 1185 | "Feeds.account_id " |
| 1186 | "WHERE " |
| 1187 | " Messages.is_deleted = 0 AND " |
| 1188 | " Messages.is_pdeleted = 0 AND " |
| 1189 | " Messages.account_id = :account_id AND " |
| 1190 | " Messages.labels LIKE :label;") |
| 1191 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(messageTableAttributescxx . . $ DatabaseQueries#messageTableAttributes(dd908507b11f616c).(false, db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_SQLITE_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:227:9`!)) |
| 1192 | .valuescxx . . $ QMap#values(16615713d304f37e).() |
| 1193 | .joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 1194 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 1195 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":label"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("%.%1.%").argcxx . . $ QString#arg(ad0bca07273edcc2).(label->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).())); |
| 1196 | |
| 1197 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1198 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1199 | bool decoded; |
| 1200 | Messagecxx . . $ Message# message = Messagecxx . . $ Message#::fromSqlRecordcxx . . $ Message#fromSqlRecord(195b8e11f7f7a4ad).(q.recordcxx . . $ QSqlQuery#record(bb20731da56c592d).(), &decoded); |
| 1201 | |
| 1202 | if (decoded) { |
| 1203 | messages.appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1204 | } |
| 1205 | } |
| 1206 | |
| 1207 | if (ok != nullptr) { |
| 1208 | *ok = true; |
| 1209 | } |
| 1210 | } |
| 1211 | else { |
| 1212 | if (ok != nullptr) { |
| 1213 | *ok = false; |
| 1214 | } |
| 1215 | } |
| 1216 | |
| 1217 | return messages; |
| 1218 | } |
| 1219 | |
| 1220 | QListcxx . . $ QList#<Messagecxx . . $ Message#> DatabaseQueriescxx . . $ DatabaseQueries#::getUndeletedLabelledMessagescxx . . $ DatabaseQueries#getUndeletedLabelledMessages(4df15bb3942892d6).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, bool* ok) { |
| 1221 | QListcxx . . $ QList#<Messagecxx . . $ Message#> messagescxx . . $ QList#QList(ced63f7c635d850d).; |
| 1222 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1223 | |
| 1224 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT %1 " |
| 1225 | "FROM Messages " |
| 1226 | "INNER JOIN Feeds " |
| 1227 | "ON Messages.feed = Feeds.custom_id AND Messages.account_id = Feeds.account_id " |
| 1228 | "WHERE " |
| 1229 | " Messages.is_deleted = 0 AND " |
| 1230 | " Messages.is_pdeleted = 0 AND " |
| 1231 | " Messages.account_id = :account_id AND " |
| 1232 | " LENGTH(Messages.labels) > 2;") |
| 1233 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(messageTableAttributescxx . . $ DatabaseQueries#messageTableAttributes(dd908507b11f616c).(false, db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_SQLITE_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:227:9`!)) |
| 1234 | .valuescxx . . $ QMap#values(16615713d304f37e).() |
| 1235 | .joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 1236 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1237 | |
| 1238 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1239 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1240 | bool decoded; |
| 1241 | Messagecxx . . $ Message# message = Messagecxx . . $ Message#::fromSqlRecordcxx . . $ Message#fromSqlRecord(195b8e11f7f7a4ad).(q.recordcxx . . $ QSqlQuery#record(bb20731da56c592d).(), &decoded); |
| 1242 | |
| 1243 | if (decoded) { |
| 1244 | messages.appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1245 | } |
| 1246 | } |
| 1247 | |
| 1248 | if (ok != nullptr) { |
| 1249 | *ok = true; |
| 1250 | } |
| 1251 | } |
| 1252 | else { |
| 1253 | auto a = q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).(); |
| 1254 | |
| 1255 | if (ok != nullptr) { |
| 1256 | *ok = false; |
| 1257 | } |
| 1258 | } |
| 1259 | |
| 1260 | return messages; |
| 1261 | } |
| 1262 | |
| 1263 | QListcxx . . $ QList#<Messagecxx . . $ Message#> DatabaseQueriescxx . . $ DatabaseQueries#::getUndeletedImportantMessagescxx . . $ DatabaseQueries#getUndeletedImportantMessages(4df15bb3942892d6).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, bool* ok) { |
| 1264 | QListcxx . . $ QList#<Messagecxx . . $ Message#> messagescxx . . $ QList#QList(ced63f7c635d850d).; |
| 1265 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1266 | |
| 1267 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1268 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT %1 " |
| 1269 | "FROM Messages " |
| 1270 | "WHERE is_important = 1 AND is_deleted = 0 AND " |
| 1271 | " is_pdeleted = 0 AND account_id = :account_id;") |
| 1272 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(messageTableAttributescxx . . $ DatabaseQueries#messageTableAttributes(dd908507b11f616c).(true, db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_SQLITE_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:227:9`!)) |
| 1273 | .valuescxx . . $ QMap#values(16615713d304f37e).() |
| 1274 | .joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 1275 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1276 | |
| 1277 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1278 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1279 | bool decoded; |
| 1280 | Messagecxx . . $ Message# message = Messagecxx . . $ Message#::fromSqlRecordcxx . . $ Message#fromSqlRecord(195b8e11f7f7a4ad).(q.recordcxx . . $ QSqlQuery#record(bb20731da56c592d).(), &decoded); |
| 1281 | |
| 1282 | if (decoded) { |
| 1283 | messages.appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1284 | } |
| 1285 | } |
| 1286 | |
| 1287 | if (ok != nullptr) { |
| 1288 | *ok = true; |
| 1289 | } |
| 1290 | } |
| 1291 | else { |
| 1292 | if (ok != nullptr) { |
| 1293 | *ok = false; |
| 1294 | } |
| 1295 | } |
| 1296 | |
| 1297 | return messages; |
| 1298 | } |
| 1299 | |
| 1300 | QListcxx . . $ QList#<Messagecxx . . $ Message#> DatabaseQueriescxx . . $ DatabaseQueries#::getUndeletedUnreadMessagescxx . . $ DatabaseQueries#getUndeletedUnreadMessages(4df15bb3942892d6).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, bool* ok) { |
| 1301 | QListcxx . . $ QList#<Messagecxx . . $ Message#> messagescxx . . $ QList#QList(ced63f7c635d850d).; |
| 1302 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1303 | |
| 1304 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1305 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT %1 " |
| 1306 | "FROM Messages " |
| 1307 | "WHERE is_read = 0 AND is_deleted = 0 AND " |
| 1308 | " is_pdeleted = 0 AND account_id = :account_id;") |
| 1309 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(messageTableAttributescxx . . $ DatabaseQueries#messageTableAttributes(dd908507b11f616c).(true, db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_SQLITE_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:227:9`!)) |
| 1310 | .valuescxx . . $ QMap#values(16615713d304f37e).() |
| 1311 | .joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 1312 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1313 | |
| 1314 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1315 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1316 | bool decoded; |
| 1317 | Messagecxx . . $ Message# message = Messagecxx . . $ Message#::fromSqlRecordcxx . . $ Message#fromSqlRecord(195b8e11f7f7a4ad).(q.recordcxx . . $ QSqlQuery#record(bb20731da56c592d).(), &decoded); |
| 1318 | |
| 1319 | if (decoded) { |
| 1320 | messages.appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1321 | } |
| 1322 | } |
| 1323 | |
| 1324 | if (ok != nullptr) { |
| 1325 | *ok = true; |
| 1326 | } |
| 1327 | } |
| 1328 | else { |
| 1329 | if (ok != nullptr) { |
| 1330 | *ok = false; |
| 1331 | } |
| 1332 | } |
| 1333 | |
| 1334 | return messages; |
| 1335 | } |
| 1336 | |
| 1337 | QListcxx . . $ QList#<Messagecxx . . $ Message#> DatabaseQueriescxx . . $ DatabaseQueries#::getArticlesSlicecxx . . $ DatabaseQueries#getArticlesSlice(b19a248cd3d41b64).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 1338 | const QStringcxx . . $ QString#& feed_custom_id, |
| 1339 | int account_id, |
| 1340 | bool newest_first, |
| 1341 | bool unread_only, |
| 1342 | bool starred_only, |
| 1343 | qint64cxx . . $ qint64# start_after_article_date, |
| 1344 | int row_offset, |
| 1345 | int row_limit) { |
| 1346 | QListcxx . . $ QList#<Messagecxx . . $ Message#> messagescxx . . $ QList#QList(ced63f7c635d850d).; |
| 1347 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1348 | QStringcxx . . $ QString# feed_clause = !feed_custom_id.isEmptycxx . . $ QString#isEmpty(3482b152b9333168).() ? QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.feed = :feed AND") : QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 1349 | QStringcxx . . $ QString# is_read_clause = unread_only ? QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.is_read = :is_read AND ") : QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 1350 | QStringcxx . . $ QString# is_starred_clause = starred_only ? QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.is_important = :is_important AND ") : QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 1351 | QStringcxx . . $ QString# account_id_clause = account_id > 0 ? QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.account_id = :account_id AND ") : QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 1352 | QStringcxx . . $ QString# date_created_clausecxx . . $ QString#QString(ced63f7c635d850d).; |
| 1353 | |
| 1354 | if (start_after_article_date > 0) { |
| 1355 | if (newest_first) { |
| 1356 | date_created_clause =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.date_created < :date_created AND "); |
| 1357 | } |
| 1358 | else { |
| 1359 | date_created_clause =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Messages.date_created > :date_created AND "); |
| 1360 | } |
| 1361 | } |
| 1362 | |
| 1363 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1364 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT %1 " |
| 1365 | "FROM Messages LEFT JOIN Feeds ON Messages.feed = Feeds.custom_id AND " |
| 1366 | " Messages.account_id = Feeds.account_id " |
| 1367 | "WHERE %3 " |
| 1368 | " %4 " |
| 1369 | " %5 " |
| 1370 | " %6 " |
| 1371 | " %7 " |
| 1372 | " Messages.is_deleted = 0 AND " |
| 1373 | " Messages.is_pdeleted = 0 " |
| 1374 | "ORDER BY Messages.date_created %2 " |
| 1375 | "LIMIT :row_limit OFFSET :row_offset;") |
| 1376 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(messageTableAttributescxx . . $ DatabaseQueries#messageTableAttributes(dd908507b11f616c).(false, db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_SQLITE_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:227:9`!)).valuescxx . . $ QMap#values(16615713d304f37e).().joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")), |
| 1377 | newest_first ? QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DESC") : QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("ASC"), |
| 1378 | feed_clause, |
| 1379 | date_created_clause, |
| 1380 | account_id_clause, |
| 1381 | is_read_clause, |
| 1382 | is_starred_clause)); |
| 1383 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1384 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":row_limit"), row_limitcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1385 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":row_offset"), row_offsetcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1386 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), feed_custom_idcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 1387 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_read"), 0cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1388 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_important"), 1cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1389 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":date_created"), start_after_article_datecxx . . $ QVariant#QVariant(1ca78f0f7b9b0ce5).); |
| 1390 | |
| 1391 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1392 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1393 | bool decoded; |
| 1394 | Messagecxx . . $ Message# message = Messagecxx . . $ Message#::fromSqlRecordcxx . . $ Message#fromSqlRecord(195b8e11f7f7a4ad).(q.recordcxx . . $ QSqlQuery#record(bb20731da56c592d).(), &decoded); |
| 1395 | |
| 1396 | if (decoded) { |
| 1397 | messages.appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1398 | } |
| 1399 | } |
| 1400 | } |
| 1401 | else { |
| 1402 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().driverTextcxx . . $ QSqlError#driverText(6ef7b6c27b00b43d).() + QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(" ") + q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().databaseTextcxx . . $ QSqlError#databaseText(6ef7b6c27b00b43d).()); |
| 1403 | } |
| 1404 | |
| 1405 | return messages; |
| 1406 | } |
| 1407 | |
| 1408 | QListcxx . . $ QList#<Messagecxx . . $ Message#> DatabaseQueriescxx . . $ DatabaseQueries#::getUndeletedMessagesForFeedcxx . . $ DatabaseQueries#getUndeletedMessagesForFeed(966a807d3edefbf9).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 1409 | const QStringcxx . . $ QString#& feed_custom_id, |
| 1410 | int account_id, |
| 1411 | bool* ok) { |
| 1412 | QListcxx . . $ QList#<Messagecxx . . $ Message#> messagescxx . . $ QList#QList(ced63f7c635d850d).; |
| 1413 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1414 | |
| 1415 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1416 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT %1 " |
| 1417 | "FROM Messages " |
| 1418 | "WHERE is_deleted = 0 AND is_pdeleted = 0 AND " |
| 1419 | " feed = :feed AND account_id = :account_id;") |
| 1420 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(messageTableAttributescxx . . $ DatabaseQueries#messageTableAttributes(dd908507b11f616c).(true, db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_SQLITE_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:227:9`!)) |
| 1421 | .valuescxx . . $ QMap#values(16615713d304f37e).() |
| 1422 | .joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 1423 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), feed_custom_idcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 1424 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1425 | |
| 1426 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1427 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1428 | bool decoded; |
| 1429 | Messagecxx . . $ Message# message = Messagecxx . . $ Message#::fromSqlRecordcxx . . $ Message#fromSqlRecord(195b8e11f7f7a4ad).(q.recordcxx . . $ QSqlQuery#record(bb20731da56c592d).(), &decoded); |
| 1430 | |
| 1431 | if (decoded) { |
| 1432 | messages.appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1433 | } |
| 1434 | } |
| 1435 | |
| 1436 | if (ok != nullptr) { |
| 1437 | *ok = true; |
| 1438 | } |
| 1439 | } |
| 1440 | else { |
| 1441 | auto aa = q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).(); |
| 1442 | |
| 1443 | if (ok != nullptr) { |
| 1444 | *ok = false; |
| 1445 | } |
| 1446 | } |
| 1447 | |
| 1448 | return messages; |
| 1449 | } |
| 1450 | |
| 1451 | QListcxx . . $ QList#<Messagecxx . . $ Message#> DatabaseQueriescxx . . $ DatabaseQueries#::getUndeletedMessagesForBincxx . . $ DatabaseQueries#getUndeletedMessagesForBin(4df15bb3942892d6).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, bool* ok) { |
| 1452 | QListcxx . . $ QList#<Messagecxx . . $ Message#> messagescxx . . $ QList#QList(ced63f7c635d850d).; |
| 1453 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1454 | |
| 1455 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1456 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT %1 " |
| 1457 | "FROM Messages " |
| 1458 | "WHERE is_deleted = 1 AND is_pdeleted = 0 AND account_id = :account_id;") |
| 1459 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(messageTableAttributescxx . . $ DatabaseQueries#messageTableAttributes(dd908507b11f616c).(true, db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_SQLITE_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:227:9`!)) |
| 1460 | .valuescxx . . $ QMap#values(16615713d304f37e).() |
| 1461 | .joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 1462 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1463 | |
| 1464 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1465 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1466 | bool decoded; |
| 1467 | Messagecxx . . $ Message# message = Messagecxx . . $ Message#::fromSqlRecordcxx . . $ Message#fromSqlRecord(195b8e11f7f7a4ad).(q.recordcxx . . $ QSqlQuery#record(bb20731da56c592d).(), &decoded); |
| 1468 | |
| 1469 | if (decoded) { |
| 1470 | messages.appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1471 | } |
| 1472 | } |
| 1473 | |
| 1474 | if (ok != nullptr) { |
| 1475 | *ok = true; |
| 1476 | } |
| 1477 | } |
| 1478 | else { |
| 1479 | if (ok != nullptr) { |
| 1480 | *ok = false; |
| 1481 | } |
| 1482 | } |
| 1483 | |
| 1484 | return messages; |
| 1485 | } |
| 1486 | |
| 1487 | QListcxx . . $ QList#<Messagecxx . . $ Message#> DatabaseQueriescxx . . $ DatabaseQueries#::getUndeletedMessagesForAccountcxx . . $ DatabaseQueries#getUndeletedMessagesForAccount(4df15bb3942892d6).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, bool* ok) { |
| 1488 | QListcxx . . $ QList#<Messagecxx . . $ Message#> messagescxx . . $ QList#QList(ced63f7c635d850d).; |
| 1489 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1490 | |
| 1491 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1492 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT %1 " |
| 1493 | "FROM Messages " |
| 1494 | "WHERE is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;") |
| 1495 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(messageTableAttributescxx . . $ DatabaseQueries#messageTableAttributes(dd908507b11f616c).(true, db.driverNamecxx . . $ QSqlDatabase#driverName(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_DB_SQLITE_DRIVERcxx . . $ `src/librssguard/definitions/definitions.h:227:9`!)) |
| 1496 | .valuescxx . . $ QMap#values(16615713d304f37e).() |
| 1497 | .joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 1498 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1499 | |
| 1500 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1501 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1502 | bool decoded; |
| 1503 | Messagecxx . . $ Message# message = Messagecxx . . $ Message#::fromSqlRecordcxx . . $ Message#fromSqlRecord(195b8e11f7f7a4ad).(q.recordcxx . . $ QSqlQuery#record(bb20731da56c592d).(), &decoded); |
| 1504 | |
| 1505 | if (decoded) { |
| 1506 | messages.appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1507 | } |
| 1508 | } |
| 1509 | |
| 1510 | if (ok != nullptr) { |
| 1511 | *ok = true; |
| 1512 | } |
| 1513 | } |
| 1514 | else { |
| 1515 | if (ok != nullptr) { |
| 1516 | *ok = false; |
| 1517 | } |
| 1518 | } |
| 1519 | |
| 1520 | return messages; |
| 1521 | } |
| 1522 | |
| 1523 | QStringListcxx . . $ QStringList# DatabaseQueriescxx . . $ DatabaseQueries#::bagOfMessagescxx . . $ DatabaseQueries#bagOfMessages(d4ba91b55bc39312).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, ServiceRootcxx . . $ ServiceRoot#::BagOfMessagescxx . . $ ServiceRoot#BagOfMessages# bag, const Feedcxx . . $ Feed#* feed) { |
| 1524 | QStringListcxx . . $ QStringList# idscxx . . $ QList#QList(ced63f7c635d850d).; |
| 1525 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1526 | QStringcxx . . $ QString# querycxx . . $ QString#QString(ced63f7c635d850d).; |
| 1527 | |
| 1528 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1529 | |
| 1530 | switch (bag) { |
| 1531 | case ServiceRootcxx . . $ ServiceRoot#::BagOfMessagescxx . . $ ServiceRoot#BagOfMessages#::Unreadcxx . . $ ServiceRoot#BagOfMessages#Unread.: |
| 1532 | query =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("is_read = 0"); |
| 1533 | break; |
| 1534 | |
| 1535 | case ServiceRootcxx . . $ ServiceRoot#::BagOfMessagescxx . . $ ServiceRoot#BagOfMessages#::Starredcxx . . $ ServiceRoot#BagOfMessages#Starred.: |
| 1536 | query =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("is_important = 1"); |
| 1537 | break; |
| 1538 | |
| 1539 | case ServiceRootcxx . . $ ServiceRoot#::BagOfMessagescxx . . $ ServiceRoot#BagOfMessages#::Readcxx . . $ ServiceRoot#BagOfMessages#Read.: |
| 1540 | default: |
| 1541 | query =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("is_read = 1"); |
| 1542 | break; |
| 1543 | } |
| 1544 | |
| 1545 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT custom_id " |
| 1546 | "FROM Messages " |
| 1547 | "WHERE %1 AND feed = :feed AND account_id = :account_id;") |
| 1548 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(query)); |
| 1549 | |
| 1550 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), feedcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 1551 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), feedcxx . . $ QVariant#QVariant(132dd6869045752b).->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).()); |
| 1552 | q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 1553 | |
| 1554 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1555 | ids.appendcxx . . $ QList#append(1262c8661f7a27a7).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 1556 | } |
| 1557 | |
| 1558 | return ids; |
| 1559 | } |
| 1560 | |
| 1561 | QHashcxx . . $ QHash#<QStringcxx . . $ QString#, QStringListcxx . . $ QStringList#> DatabaseQueriescxx . . $ DatabaseQueries#::bagsOfMessagescxx . . $ DatabaseQueries#bagsOfMessages(2e507a8771a94db8).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, const QListcxx . . $ QList#<Labelcxx . . $ Label#*>& labels) { |
| 1562 | QHashcxx . . $ QHash#<QStringcxx . . $ QString#, QStringListcxx . . $ QStringList#> idscxx . . $ QHash#QHash(ced63f7c635d850d).; |
| 1563 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1564 | |
| 1565 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1566 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT custom_id FROM Messages " |
| 1567 | "WHERE " |
| 1568 | " account_id = :account_id AND " |
| 1569 | " labels LIKE :label;")); |
| 1570 | |
| 1571 | for (const Labelcxx . . $ Label#* lbl : labels) { |
| 1572 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":label"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("%.%1.%").argcxx . . $ QString#arg(ad0bca07273edcc2).(lbl->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).())); |
| 1573 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), lblcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 1574 | q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 1575 | |
| 1576 | QStringListcxx . . $ QStringList# ids_one_labelcxx . . $ QList#QList(ced63f7c635d850d).; |
| 1577 | |
| 1578 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1579 | ids_one_label.appendcxx . . $ QList#append(1262c8661f7a27a7).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 1580 | } |
| 1581 | |
| 1582 | ids.insertcxx . . $ QHash#insert(d77b19c31d2eb147).(lbl->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).(), ids_one_label); |
| 1583 | } |
| 1584 | |
| 1585 | return idscxx . . $ QHash#QHash(4af0980b0c631cac).; |
| 1586 | } |
| 1587 | |
| 1588 | UpdatedArticlescxx . . $ UpdatedArticles# DatabaseQueriescxx . . $ DatabaseQueries#::updateMessagescxx . . $ DatabaseQueries#updateMessages(ffa7bd2a8b102c98).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 1589 | QListcxx . . $ QList#<Messagecxx . . $ Message#>& messages, |
| 1590 | Feedcxx . . $ Feed#* feed, |
| 1591 | bool force_update, |
| 1592 | QMutexcxx . . $ QMutex#* db_mutex, |
| 1593 | bool* ok) { |
| 1594 | if (messages.isEmptycxx . . $ QList#isEmpty(3482b152b9333168).()) { |
| 1595 | *ok = true; |
| 1596 | return {}; |
| 1597 | } |
| 1598 | |
| 1599 | UpdatedArticlescxx . . $ UpdatedArticles# updated_messages; |
| 1600 | int account_id = feed->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).(); |
| 1601 | auto feed_custom_id = feed->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).(); |
| 1602 | |
| 1603 | // Prepare queries. |
| 1604 | QSqlQuerycxx . . $ QSqlQuery# query_select_with_urlcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1605 | QSqlQuerycxx . . $ QSqlQuery# query_select_with_custom_idcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1606 | QSqlQuerycxx . . $ QSqlQuery# query_select_with_custom_id_for_feedcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1607 | QSqlQuerycxx . . $ QSqlQuery# query_select_with_idcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1608 | QSqlQuerycxx . . $ QSqlQuery# query_updatecxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 1609 | |
| 1610 | // Here we have query which will check for existence of the "same" message in given feed. |
| 1611 | // The two message are the "same" if: |
| 1612 | // 1) they belong to the SAME FEED AND, |
| 1613 | // 2) they have same URL AND, |
| 1614 | // 3) they have same AUTHOR AND, |
| 1615 | // 4) they have same TITLE. |
| 1616 | // NOTE: This only applies to messages from standard RSS/ATOM/JSON feeds without ID/GUID. |
| 1617 | query_select_with_url.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1618 | query_select_with_url.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT id, date_created, is_read, is_important, contents, feed FROM Messages " |
| 1619 | "WHERE feed = :feed AND title = :title AND url = :url AND author = :author AND " |
| 1620 | "account_id = :account_id;")); |
| 1621 | |
| 1622 | // When we have custom ID of the message which is service-specific (synchronized services). |
| 1623 | query_select_with_custom_id.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1624 | query_select_with_custom_id |
| 1625 | .preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT id, date_created, is_read, is_important, contents, feed, title, author FROM Messages " |
| 1626 | "WHERE custom_id = :custom_id AND account_id = :account_id;")); |
| 1627 | |
| 1628 | // We have custom ID of message, but it is feed-specific not service-specific (standard RSS/ATOM/JSON). |
| 1629 | query_select_with_custom_id_for_feed.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1630 | query_select_with_custom_id_for_feed |
| 1631 | .preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT id, date_created, is_read, is_important, contents, title, author FROM Messages " |
| 1632 | "WHERE feed = :feed AND custom_id = :custom_id AND account_id = :account_id;")); |
| 1633 | |
| 1634 | // In some case, messages are already stored in the DB and they all have primary DB ID. |
| 1635 | // This is particularly the case when user runs some message filter manually on existing messages |
| 1636 | // of some feed. |
| 1637 | query_select_with_id.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1638 | query_select_with_id |
| 1639 | .preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT date_created, is_read, is_important, contents, feed, title, author FROM Messages " |
| 1640 | "WHERE id = :id AND account_id = :account_id;")); |
| 1641 | |
| 1642 | // Used to update existing messages. |
| 1643 | query_update.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 1644 | query_update.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages " |
| 1645 | "SET title = :title, is_read = :is_read, is_important = :is_important, is_deleted = " |
| 1646 | ":is_deleted, url = :url, author = :author, score = :score, date_created = :date_created, " |
| 1647 | "contents = :contents, enclosures = :enclosures, feed = :feed " |
| 1648 | "WHERE id = :id;")); |
| 1649 | |
| 1650 | QVectorcxx . . $ QVector#<Messagecxx . . $ Message#*> msgs_to_insertcxx . . $ QList#QList(ced63f7c635d850d).; |
| 1651 | |
| 1652 | for (Messagecxx . . $ Message#& message : messages) { |
| 1653 | int id_existing_message = -1; |
| 1654 | qint64cxx . . $ qint64# date_existing_message = 0; |
| 1655 | bool is_read_existing_message = false; |
| 1656 | bool is_important_existing_message = false; |
| 1657 | QStringcxx . . $ QString# contents_existing_messagecxx . . $ QString#QString(ced63f7c635d850d).; |
| 1658 | QStringcxx . . $ QString# feed_id_existing_messagecxx . . $ QString#QString(ced63f7c635d850d).; |
| 1659 | QStringcxx . . $ QString# title_existing_messagecxx . . $ QString#QString(ced63f7c635d850d).; |
| 1660 | QStringcxx . . $ QString# author_existing_messagecxx . . $ QString#QString(ced63f7c635d850d).; |
| 1661 | |
| 1662 | QMutexLocker lckcxx . . $ QMutexLocker#QMutexLocker(35605a8b3c396497).(db_mutex); |
| 1663 | |
| 1664 | if (message.m_idcxx . . $ Message#m_id. > 0) { |
| 1665 | // We recognize directly existing message. |
| 1666 | // NOTE: Particularly for manual message filter execution. |
| 1667 | query_select_with_id.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), messagecxx . . $ QVariant#QVariant(f349c77f591a7878)..m_idcxx . . $ Message#m_id.); |
| 1668 | query_select_with_id.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1669 | |
| 1670 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Checking if message with primary ID" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(message.m_id) |
| 1671 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "is present in DB."; |
| 1672 | |
| 1673 | if (query_select_with_id.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && query_select_with_id.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1674 | id_existing_message = message.m_idcxx . . $ Message#m_id.; |
| 1675 | date_existing_message = query_select_with_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).valuecxx . . $ QVariant#value(1e6269539e51e84a).<qint64cxx . . $ qint64#>(); |
| 1676 | is_read_existing_message = query_select_with_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).(); |
| 1677 | is_important_existing_message = query_select_with_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(2).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).(); |
| 1678 | contents_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(3).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1679 | feed_id_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(4).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1680 | title_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(5).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1681 | author_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(6).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1682 | |
| 1683 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Message with direct DB ID is already present in DB and has DB ID" |
| 1684 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(id_existing_message); |
| 1685 | } |
| 1686 | else if (query_select_with_id.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().isValidcxx . . $ QSqlError#isValid(50ce9a9e25b4a850).()) { |
| 1687 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed to check for existing message in DB via primary ID:" |
| 1688 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(query_select_with_id.lastError().text()); |
| 1689 | } |
| 1690 | |
| 1691 | query_select_with_id.finishcxx . . $ QSqlQuery#finish(49f6e7a06ebc5aa8).(); |
| 1692 | } |
| 1693 | else if (message.m_customIdcxx . . $ Message#m_customId..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 1694 | // We need to recognize existing messages according to URL & AUTHOR & TITLE. |
| 1695 | // NOTE: This concerns articles from RSS/ATOM/JSON which do not |
| 1696 | // provide unique ID/GUID. |
| 1697 | query_select_with_url.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), unnulifyStringcxx . . $ QVariant#QVariant(132dd6869045752b).(feed_custom_id)); |
| 1698 | query_select_with_url.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":title"), unnulifyStringcxx . . $ QVariant#QVariant(132dd6869045752b).(message.m_titlecxx . . $ Message#m_title.)); |
| 1699 | query_select_with_url.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":url"), unnulifyStringcxx . . $ QVariant#QVariant(132dd6869045752b).(message.m_urlcxx . . $ Message#m_url.)); |
| 1700 | query_select_with_url.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":author"), unnulifyStringcxx . . $ QVariant#QVariant(132dd6869045752b).(message.m_authorcxx . . $ Message#m_author.)); |
| 1701 | query_select_with_url.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1702 | |
| 1703 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Checking if message with title " <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_NO_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:433:9`!(message.m_title) <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). ", url " |
| 1704 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_NO_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:433:9`!(message.m_url) <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "' and author " <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_NO_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:433:9`!(message.m_author) |
| 1705 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). " is present in DB."; |
| 1706 | |
| 1707 | if (query_select_with_url.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && query_select_with_url.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1708 | id_existing_message = query_select_with_url.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1709 | date_existing_message = query_select_with_url.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).valuecxx . . $ QVariant#value(1e6269539e51e84a).<qint64cxx . . $ qint64#>(); |
| 1710 | is_read_existing_message = query_select_with_url.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(2).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).(); |
| 1711 | is_important_existing_message = query_select_with_url.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(3).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).(); |
| 1712 | contents_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_url.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(4).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1713 | feed_id_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_url.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(5).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1714 | title_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). unnulifyStringcxx . . $ DatabaseQueries#unnulifyString(fd988a2ab94d906b).(message.m_titlecxx . . $ Message#m_title.); |
| 1715 | author_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). unnulifyStringcxx . . $ DatabaseQueries#unnulifyString(fd988a2ab94d906b).(message.m_authorcxx . . $ Message#m_author.); |
| 1716 | |
| 1717 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Message with these attributes is already present in DB and has DB ID" |
| 1718 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(id_existing_message); |
| 1719 | } |
| 1720 | else if (query_select_with_url.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().isValidcxx . . $ QSqlError#isValid(50ce9a9e25b4a850).()) { |
| 1721 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed to check for existing message in DB via URL/TITLE/AUTHOR:" |
| 1722 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(query_select_with_url.lastError().text()); |
| 1723 | } |
| 1724 | |
| 1725 | query_select_with_url.finishcxx . . $ QSqlQuery#finish(49f6e7a06ebc5aa8).(); |
| 1726 | } |
| 1727 | else { |
| 1728 | // We can recognize existing messages via their custom ID. |
| 1729 | if (feed->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->isSyncablecxx . . $ ServiceRoot#isSyncable(50ce9a9e25b4a850).()) { |
| 1730 | // Custom IDs are service-wide. |
| 1731 | // NOTE: This concerns messages from custom accounts, like TT-RSS or Nextcloud News. |
| 1732 | query_select_with_custom_id.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1733 | query_select_with_custom_id.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":custom_id"), unnulifyStringcxx . . $ QVariant#QVariant(132dd6869045752b).(message.m_customIdcxx . . $ Message#m_customId.)); |
| 1734 | |
| 1735 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Checking if message with service-specific custom ID" |
| 1736 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(message.m_customId) <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "is present in DB."; |
| 1737 | |
| 1738 | if (query_select_with_custom_id.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && query_select_with_custom_id.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1739 | id_existing_message = query_select_with_custom_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1740 | date_existing_message = query_select_with_custom_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).valuecxx . . $ QVariant#value(1e6269539e51e84a).<qint64cxx . . $ qint64#>(); |
| 1741 | is_read_existing_message = query_select_with_custom_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(2).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).(); |
| 1742 | is_important_existing_message = query_select_with_custom_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(3).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).(); |
| 1743 | contents_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_custom_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(4).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1744 | feed_id_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_custom_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(5).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1745 | title_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_custom_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(6).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1746 | author_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_custom_id.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(7).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1747 | |
| 1748 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Message with custom ID" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(message.m_customId) |
| 1749 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "is already present in DB and has DB ID '" <<cxx . . $ QDebug#`operator<<`(6e3b7ae53f380c3). id_existing_message <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "'."; |
| 1750 | } |
| 1751 | else if (query_select_with_custom_id.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().isValidcxx . . $ QSqlError#isValid(50ce9a9e25b4a850).()) { |
| 1752 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed to check for existing message in DB via ID:" |
| 1753 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(query_select_with_custom_id.lastError().text()); |
| 1754 | } |
| 1755 | |
| 1756 | query_select_with_custom_id.finishcxx . . $ QSqlQuery#finish(49f6e7a06ebc5aa8).(); |
| 1757 | } |
| 1758 | else { |
| 1759 | // Custom IDs are feed-specific. |
| 1760 | // NOTE: This concerns articles with ID/GUID from standard RSS/ATOM/JSON feeds. |
| 1761 | query_select_with_custom_id_for_feed.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1762 | query_select_with_custom_id_for_feed.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), feed_custom_idcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 1763 | query_select_with_custom_id_for_feed.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":custom_id"), unnulifyStringcxx . . $ QVariant#QVariant(132dd6869045752b).(message.m_customIdcxx . . $ Message#m_customId.)); |
| 1764 | |
| 1765 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Checking if message with feed-specific custom ID" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(message.m_customId) |
| 1766 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "is present in DB."; |
| 1767 | |
| 1768 | if (query_select_with_custom_id_for_feed.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && query_select_with_custom_id_for_feed.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 1769 | id_existing_message = query_select_with_custom_id_for_feed.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1770 | date_existing_message = query_select_with_custom_id_for_feed.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).valuecxx . . $ QVariant#value(1e6269539e51e84a).<qint64cxx . . $ qint64#>(); |
| 1771 | is_read_existing_message = query_select_with_custom_id_for_feed.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(2).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).(); |
| 1772 | is_important_existing_message = query_select_with_custom_id_for_feed.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(3).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).(); |
| 1773 | contents_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_custom_id_for_feed.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(4).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1774 | feed_id_existing_message =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). feed_custom_id; |
| 1775 | title_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_custom_id_for_feed.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(5).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1776 | author_existing_message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). query_select_with_custom_id_for_feed.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(6).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 1777 | |
| 1778 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Message with custom ID" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(message.m_customId) |
| 1779 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "is already present in DB and has DB ID" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(id_existing_message); |
| 1780 | } |
| 1781 | else if (query_select_with_custom_id_for_feed.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().isValidcxx . . $ QSqlError#isValid(50ce9a9e25b4a850).()) { |
| 1782 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed to check for existing message in DB via ID:" |
| 1783 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(query_select_with_custom_id_for_feed.lastError().text()); |
| 1784 | } |
| 1785 | |
| 1786 | query_select_with_custom_id_for_feed.finishcxx . . $ QSqlQuery#finish(49f6e7a06ebc5aa8).(); |
| 1787 | } |
| 1788 | } |
| 1789 | |
| 1790 | // Now, check if this message is already in the DB. |
| 1791 | if (id_existing_message >= 0) { |
| 1792 | message.m_idcxx . . $ Message#m_id. = id_existing_message; |
| 1793 | |
| 1794 | // Message is already in the DB. |
| 1795 | // |
| 1796 | // Now, we update it if at least one of next conditions is true: |
| 1797 | // 1) FOR SYNCHRONIZED SERVICES: |
| 1798 | // Message has custom ID AND (its date OR read status OR starred status are changed |
| 1799 | // or message was moved from other feed to current feed - this can particularly happen in Gmail feeds). |
| 1800 | // |
| 1801 | // 2) FOR NON-SYNCHRONIZED SERVICES (RSS/ATOM/JSON): |
| 1802 | // Message has custom ID/GUID and its title or author or contents are changed. |
| 1803 | // |
| 1804 | // 3) FOR ALL SERVICES: |
| 1805 | // Message has its date fetched from feed AND its date is different |
| 1806 | // from date in DB or content is changed. Date/time is considered different |
| 1807 | // when the difference is larger than MSG_DATETIME_DIFF_THRESSHOLD |
| 1808 | // |
| 1809 | // 4) FOR ALL SERVICES: |
| 1810 | // Message update is forced, we want to overwrite message as some arbitrary atribute was changed, |
| 1811 | // this particularly happens when manual message filter execution happens. |
| 1812 | bool ignore_contents_changes = |
| 1813 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->settingscxx . . $ Application#settings(951936487a2d9252).()->valuecxx . . $ Settings#value(8f1f29a69568d71a).(GROUPcxx . . $ `src/librssguard/miscellaneous/settings.h:32:9`!(Messages), SETTINGcxx . . $ `src/librssguard/miscellaneous/settings.h:30:9`!(Messages::IgnoreContentsChanges)).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).(); |
| 1814 | bool cond_1 = |
| 1815 | !message.m_customIdcxx . . $ Message#m_customId..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).() && feed->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->isSyncablecxx . . $ ServiceRoot#isSyncable(50ce9a9e25b4a850).() && |
| 1816 | (message.m_createdcxx . . $ Message#m_created..toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).() != date_existing_message || |
| 1817 | message.m_isReadcxx . . $ Message#m_isRead. != is_read_existing_message || message.m_isImportantcxx . . $ Message#m_isImportant. != is_important_existing_message || |
| 1818 | (message.m_feedIdcxx . . $ Message#m_feedId. !=cxx . . $ `operator!=`(5bc2975d2d751687). feed_id_existing_message && message.m_feedIdcxx . . $ Message#m_feedId. ==cxx . . $ `operator==`(5bc2975d2d751687). feed_custom_id) || |
| 1819 | message.m_titlecxx . . $ Message#m_title. !=cxx . . $ `operator!=`(5bc2975d2d751687). title_existing_message || |
| 1820 | (!ignore_contents_changes && message.m_contentscxx . . $ Message#m_contents. !=cxx . . $ `operator!=`(5bc2975d2d751687). contents_existing_message)); |
| 1821 | bool cond_2 = !message.m_customIdcxx . . $ Message#m_customId..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).() && !feed->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->isSyncablecxx . . $ ServiceRoot#isSyncable(50ce9a9e25b4a850).() && |
| 1822 | (message.m_titlecxx . . $ Message#m_title. !=cxx . . $ `operator!=`(5bc2975d2d751687). title_existing_message || message.m_authorcxx . . $ Message#m_author. !=cxx . . $ `operator!=`(5bc2975d2d751687). author_existing_message || |
| 1823 | (!ignore_contents_changes && message.m_contentscxx . . $ Message#m_contents. !=cxx . . $ `operator!=`(5bc2975d2d751687). contents_existing_message)); |
| 1824 | bool cond_3 = (message.m_createdFromFeedcxx . . $ Message#m_createdFromFeed. && stdcxx . . $ std/::abs(message.m_createdcxx . . $ Message#m_created..toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).() - |
| 1825 | date_existing_message) > MSG_DATETIME_DIFF_THRESSHOLDcxx . . $ `src/librssguard/definitions/definitions.h:73:9`!) || |
| 1826 | (!ignore_contents_changes && message.m_contentscxx . . $ Message#m_contents. !=cxx . . $ `operator!=`(5bc2975d2d751687). contents_existing_message); |
| 1827 | |
| 1828 | if (cond_1 || cond_2 || cond_3 || force_update) { |
| 1829 | if (!feed->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->isSyncablecxx . . $ ServiceRoot#isSyncable(50ce9a9e25b4a850).() && |
| 1830 | !qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->settingscxx . . $ Application#settings(951936487a2d9252).()->valuecxx . . $ Settings#value(8f1f29a69568d71a).(GROUPcxx . . $ `src/librssguard/miscellaneous/settings.h:32:9`!(Messages), SETTINGcxx . . $ `src/librssguard/miscellaneous/settings.h:30:9`!(Messages::MarkUnreadOnUpdated)).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).()) { |
| 1831 | // Feed is not syncable, thus we got RSS/JSON/whatever. |
| 1832 | // Article is only updated, so we now prefer to keep original read state |
| 1833 | // pretty much the same way starred state is kept. |
| 1834 | message.m_isReadcxx . . $ Message#m_isRead. = is_read_existing_message; |
| 1835 | } |
| 1836 | |
| 1837 | // Message exists and is changed, update it. |
| 1838 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":title"), unnulifyStringcxx . . $ QVariant#QVariant(132dd6869045752b).(message.m_titlecxx . . $ Message#m_title.)); |
| 1839 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_read"), intcxx . . $ QVariant#QVariant(f349c77f591a7878).(message.m_isReadcxx . . $ Message#m_isRead.)); |
| 1840 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_important"), |
| 1841 | (cxx . . $ QVariant#QVariant(f349c77f591a7878).feed->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->isSyncablecxx . . $ ServiceRoot#isSyncable(50ce9a9e25b4a850).() || message.m_isImportantcxx . . $ Message#m_isImportant.) |
| 1842 | ? int(message.m_isImportantcxx . . $ Message#m_isImportant.) |
| 1843 | : is_important_existing_message); |
| 1844 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_deleted"), intcxx . . $ QVariant#QVariant(f349c77f591a7878).(message.m_isDeletedcxx . . $ Message#m_isDeleted.)); |
| 1845 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":url"), unnulifyStringcxx . . $ QVariant#QVariant(132dd6869045752b).(message.m_urlcxx . . $ Message#m_url.)); |
| 1846 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":author"), unnulifyStringcxx . . $ QVariant#QVariant(132dd6869045752b).(message.m_authorcxx . . $ Message#m_author.)); |
| 1847 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":date_created"), messagecxx . . $ QVariant#QVariant(1ca78f0f7b9b0ce5)..m_createdcxx . . $ Message#m_created..toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).()); |
| 1848 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":contents"), unnulifyStringcxx . . $ QVariant#QVariant(132dd6869045752b).(message.m_contentscxx . . $ Message#m_contents.)); |
| 1849 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":enclosures"), Enclosurescxx . . $ QVariant#QVariant(132dd6869045752b).::encodeEnclosuresToStringcxx . . $ Enclosures#encodeEnclosuresToString(c8e8f256bddae405).(message.m_enclosurescxx . . $ Message#m_enclosures.)); |
| 1850 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), messagecxx . . $ QVariant#QVariant(132dd6869045752b)..m_feedIdcxx . . $ Message#m_feedId.); |
| 1851 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":score"), messagecxx . . $ QVariant#QVariant(4cbbf9c7388e6885)..m_scorecxx . . $ Message#m_score.); |
| 1852 | query_update.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), id_existing_messagecxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 1853 | |
| 1854 | if (query_update.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 1855 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Overwriting message with title" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(message.m_title) <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "URL" |
| 1856 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(message.m_url) <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "in DB."; |
| 1857 | |
| 1858 | if (!message.m_isReadcxx . . $ Message#m_isRead.) { |
| 1859 | updated_messages.m_unreadcxx . . $ UpdatedArticles#m_unread..appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1860 | } |
| 1861 | |
| 1862 | updated_messages.m_allcxx . . $ UpdatedArticles#m_all..appendcxx . . $ QList#append(200d2dc08238a4ed).(message); |
| 1863 | message.m_insertedUpdatedcxx . . $ Message#m_insertedUpdated. = true; |
| 1864 | } |
| 1865 | else if (query_update.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().isValidcxx . . $ QSqlError#isValid(50ce9a9e25b4a850).()) { |
| 1866 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! |
| 1867 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed to update message in DB:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(query_update.lastError().text()); |
| 1868 | } |
| 1869 | |
| 1870 | query_update.finishcxx . . $ QSqlQuery#finish(49f6e7a06ebc5aa8).(); |
| 1871 | } |
| 1872 | } |
| 1873 | else { |
| 1874 | msgs_to_insert.appendcxx . . $ QList#append(200d2dc08238a4ed).(&message); |
| 1875 | } |
| 1876 | } |
| 1877 | |
| 1878 | if (!msgs_to_insert.isEmptycxx . . $ QList#isEmpty(3482b152b9333168).()) { |
| 1879 | QStringcxx . . $ QString# bulk_insert = QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("INSERT INTO Messages " |
| 1880 | "(feed, title, is_read, is_important, is_deleted, url, author, score, date_created, " |
| 1881 | "contents, enclosures, custom_id, custom_hash, account_id) " |
| 1882 | "VALUES %1;"); |
| 1883 | |
| 1884 | for (int i = 0; i < msgs_to_insert.sizecxx . . $ QList#size(6b0412d51016192f).(); i += 1000) { |
| 1885 | QStringListcxx . . $ QStringList# valscxx . . $ QList#QList(ced63f7c635d850d).; |
| 1886 | int batch_length = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(1000, int(msgs_to_insert.sizecxx . . $ QList#size(6b0412d51016192f).()) - i); |
| 1887 | |
| 1888 | for (int l = i; l < (i + batch_length); l++) { |
| 1889 | Messagecxx . . $ Message#* msg = msgs_to_insert[cxx . . $ QList#`operator[]`(f5945173c490e616).l]; |
| 1890 | |
| 1891 | if (msg->m_titlecxx . . $ Message#m_title..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 1892 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Message" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(msg->m_customId) |
| 1893 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "will not be inserted to DB because it does not meet DB constraints."; |
| 1894 | |
| 1895 | continue; |
| 1896 | } |
| 1897 | |
| 1898 | vals.appendcxx . . $ QList#append(200d2dc08238a4ed).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("\n(':feed', ':title', :is_read, :is_important, :is_deleted, " |
| 1899 | "':url', ':author', :score, :date_created, ':contents', ':enclosures', " |
| 1900 | "':custom_id', ':custom_hash', :account_id)") |
| 1901 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), unnulifyStringcxx . . $ DatabaseQueries#unnulifyString(fd988a2ab94d906b).(feed_custom_id)) |
| 1902 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":title"), DatabaseFactorycxx . . $ DatabaseFactory#::escapeQuerycxx . . $ DatabaseFactory#escapeQuery(fd988a2ab94d906b).(unnulifyStringcxx . . $ DatabaseQueries#unnulifyString(fd988a2ab94d906b).(msg->m_titlecxx . . $ Message#m_title.))) |
| 1903 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_read"), QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(int(msg->m_isReadcxx . . $ Message#m_isRead.))) |
| 1904 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_important"), QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(int(msg->m_isImportantcxx . . $ Message#m_isImportant.))) |
| 1905 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_deleted"), QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(int(msg->m_isDeletedcxx . . $ Message#m_isDeleted.))) |
| 1906 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":url"), DatabaseFactorycxx . . $ DatabaseFactory#::escapeQuerycxx . . $ DatabaseFactory#escapeQuery(fd988a2ab94d906b).(unnulifyStringcxx . . $ DatabaseQueries#unnulifyString(fd988a2ab94d906b).(msg->m_urlcxx . . $ Message#m_url.))) |
| 1907 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":author"), DatabaseFactorycxx . . $ DatabaseFactory#::escapeQuerycxx . . $ DatabaseFactory#escapeQuery(fd988a2ab94d906b).(unnulifyStringcxx . . $ DatabaseQueries#unnulifyString(fd988a2ab94d906b).(msg->m_authorcxx . . $ Message#m_author.))) |
| 1908 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":date_created"), QStringcxx . . $ QString#::numbercxx . . $ QString#number(391c8d1a7da534d1).(msg->m_createdcxx . . $ Message#m_created..toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).())) |
| 1909 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":contents"), DatabaseFactorycxx . . $ DatabaseFactory#::escapeQuerycxx . . $ DatabaseFactory#escapeQuery(fd988a2ab94d906b).(unnulifyStringcxx . . $ DatabaseQueries#unnulifyString(fd988a2ab94d906b).(msg->m_contentscxx . . $ Message#m_contents.))) |
| 1910 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":enclosures"), |
| 1911 | DatabaseFactorycxx . . $ DatabaseFactory#::escapeQuerycxx . . $ DatabaseFactory#escapeQuery(fd988a2ab94d906b).(Enclosurescxx . . $ Enclosures#::encodeEnclosuresToStringcxx . . $ Enclosures#encodeEnclosuresToString(c8e8f256bddae405).(msg->m_enclosurescxx . . $ Message#m_enclosures.))) |
| 1912 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":custom_id"), DatabaseFactorycxx . . $ DatabaseFactory#::escapeQuerycxx . . $ DatabaseFactory#escapeQuery(fd988a2ab94d906b).(unnulifyStringcxx . . $ DatabaseQueries#unnulifyString(fd988a2ab94d906b).(msg->m_customIdcxx . . $ Message#m_customId.))) |
| 1913 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":custom_hash"), unnulifyStringcxx . . $ DatabaseQueries#unnulifyString(fd988a2ab94d906b).(msg->m_customHashcxx . . $ Message#m_customHash.)) |
| 1914 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":score"), QStringcxx . . $ QString#::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(msg->m_scorecxx . . $ Message#m_score.)) |
| 1915 | .replacecxx . . $ QString#replace(192e628656427d1c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(account_id))); |
| 1916 | } |
| 1917 | |
| 1918 | if (!vals.isEmptycxx . . $ QList#isEmpty(3482b152b9333168).()) { |
| 1919 | QStringcxx . . $ QString# final_bulk = bulk_insert.argcxx . . $ QString#arg(ad0bca07273edcc2).(vals.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", "))); |
| 1920 | |
| 1921 | QMutexLocker lckcxx . . $ QMutexLocker#QMutexLocker(35605a8b3c396497).(db_mutex); |
| 1922 | |
| 1923 | auto bulk_query = QSqlQuerycxx . . $ QSqlQuery#QSqlQuery(c76688c450d56ca3).(final_bulk, db); |
| 1924 | auto bulk_error = bulk_query.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).(); |
| 1925 | |
| 1926 | if (bulk_error.isValidcxx . . $ QSqlError#isValid(50ce9a9e25b4a850).()) { |
| 1927 | QStringcxx . . $ QString# txt = bulk_error.textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).() + bulk_error.databaseTextcxx . . $ QSqlError#databaseText(6ef7b6c27b00b43d).() + bulk_error.driverTextcxx . . $ QSqlError#driverText(6ef7b6c27b00b43d).(); |
| 1928 | |
| 1929 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed bulk insert of articles:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(txt); |
| 1930 | } |
| 1931 | else { |
| 1932 | // OK, we bulk-inserted many messages but the thing is that they do not |
| 1933 | // have their DB IDs fetched in objects, therefore labels cannot be assigned etc. |
| 1934 | // |
| 1935 | // We can calculate real IDs because of how "auto-increment" algorithms work. |
| 1936 | // https://www.sqlite.org/autoinc.html |
| 1937 | // https://mariadb.com/kb/en/auto_increment |
| 1938 | int last_msg_id = bulk_query.lastInsertIdcxx . . $ QSqlQuery#lastInsertId(23280f95d1ccaa1f).().toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 1939 | |
| 1940 | for (int l = i, c = 1; l < (i + batch_length); l++, c++) { |
| 1941 | Messagecxx . . $ Message#* msg = msgs_to_insert[cxx . . $ QList#`operator[]`(f5945173c490e616).l]; |
| 1942 | |
| 1943 | if (msg->m_titlecxx . . $ Message#m_title..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 1944 | // This article was not for sure inserted. Tweak |
| 1945 | // next ID calculation. |
| 1946 | c--; |
| 1947 | continue; |
| 1948 | } |
| 1949 | |
| 1950 | msg->m_insertedUpdatedcxx . . $ Message#m_insertedUpdated. = true; |
| 1951 | msg->m_idcxx . . $ Message#m_id. = last_msg_id - batch_length + c; |
| 1952 | |
| 1953 | if (!msg->m_isReadcxx . . $ Message#m_isRead.) { |
| 1954 | updated_messages.m_unreadcxx . . $ UpdatedArticles#m_unread..appendcxx . . $ QList#append(200d2dc08238a4ed).(*msg); |
| 1955 | } |
| 1956 | |
| 1957 | updated_messages.m_allcxx . . $ UpdatedArticles#m_all..appendcxx . . $ QList#append(200d2dc08238a4ed).(*msg); |
| 1958 | } |
| 1959 | } |
| 1960 | } |
| 1961 | } |
| 1962 | } |
| 1963 | |
| 1964 | const bool uses_online_labels = Globalscxx . . $ Globals#::hasFlagcxx . . $ Globals#hasFlag(e81494ae8084f6ba).(feed->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->supportedLabelOperationscxx . . $ ServiceRoot#supportedLabelOperations(a2eb219fd1bf9aba).(), |
| 1965 | ServiceRootcxx . . $ ServiceRoot#::LabelOperationcxx . . $ ServiceRoot#LabelOperation#::Synchronisedcxx . . $ ServiceRoot#LabelOperation#Synchronised.); |
| 1966 | |
| 1967 | for (Messagecxx . . $ Message#& message : messages) { |
| 1968 | if (!message.m_customIdcxx . . $ Message#m_customId..isEmptycxx . . $ QString#isEmpty(3482b152b9333168).() || message.m_idcxx . . $ Message#m_id. > 0) { |
| 1969 | QMutexLocker lckcxx . . $ QMutexLocker#QMutexLocker(35605a8b3c396497).(db_mutex); |
| 1970 | // bool lbls_changed = false; |
| 1971 | |
| 1972 | if (uses_online_labels) { |
| 1973 | // Store all labels obtained from server. |
| 1974 | setLabelsForMessagecxx . . $ DatabaseQueries#setLabelsForMessage(f076d2b59f25de51).(db, message.m_assignedLabelscxx . . $ Message#m_assignedLabels., message); |
| 1975 | // lbls_changed = true; |
| 1976 | } |
| 1977 | |
| 1978 | // Adjust labels tweaked by filters. |
| 1979 | for (Labelcxx . . $ Label#* assigned_by_filter : message.m_assignedLabelsByFiltercxx . . $ Message#m_assignedLabelsByFilter.) { |
| 1980 | assigned_by_filter->assignToMessagecxx . . $ Label#assignToMessage(55139daa7bc84358).(message, false); |
| 1981 | // lbls_changed = true; |
| 1982 | } |
| 1983 | |
| 1984 | for (Labelcxx . . $ Label#* removed_by_filter : message.m_deassignedLabelsByFiltercxx . . $ Message#m_deassignedLabelsByFilter.) { |
| 1985 | removed_by_filter->deassignFromMessagecxx . . $ Label#deassignFromMessage(55139daa7bc84358).(message, false); |
| 1986 | // lbls_changed = true; |
| 1987 | } |
| 1988 | |
| 1989 | // NOTE: This is likely not needed at all |
| 1990 | // as this feature was semi-broken anyway, it was trigerred |
| 1991 | // even when labels were added (via article filtering or on service server) |
| 1992 | // and the same labels were already assigned in local DB. |
| 1993 | // In other words, label assignment differences were not correctly |
| 1994 | // taken into account. |
| 1995 | /* |
| 1996 | if (lbls_changed && !message.m_insertedUpdated) { |
| 1997 | // This article was not inserted/updated in DB because its contents did not change |
| 1998 | // but its assigned labels were changed. Therefore we must count article |
| 1999 | // as updated. |
| 2000 | if (!message.m_isRead) { |
| 2001 | updated_messages.m_unread.append(message); |
| 2002 | } |
| 2003 | |
| 2004 | updated_messages.m_all.append(message); |
| 2005 | } |
| 2006 | */ |
| 2007 | } |
| 2008 | else { |
| 2009 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Cannot set labels for message" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(message.m_title) |
| 2010 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "because we don't have ID or custom ID."; |
| 2011 | } |
| 2012 | } |
| 2013 | |
| 2014 | // Now, fixup custom IDS for messages which initially did not have them, |
| 2015 | // just to keep the data consistent. |
| 2016 | QMutexLocker lckcxx . . $ QMutexLocker#QMutexLocker(35605a8b3c396497).(db_mutex); |
| 2017 | |
| 2018 | QSqlQuerycxx . . $ QSqlQuery# fixup_custom_ids_querycxx . . $ QSqlQuery#QSqlQuery(c76688c450d56ca3).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages " |
| 2019 | "SET custom_id = id " |
| 2020 | "WHERE custom_id IS NULL OR custom_id = '';"), |
| 2021 | db); |
| 2022 | QSqlErrorcxx . . $ QSqlError# fixup_custom_ids_error = fixup_custom_ids_query.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).(); |
| 2023 | |
| 2024 | if (fixup_custom_ids_error.isValidcxx . . $ QSqlError#isValid(50ce9a9e25b4a850).()) { |
| 2025 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! |
| 2026 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed to set custom ID for all messages:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(fixup_custom_ids_error.text()); |
| 2027 | } |
| 2028 | |
| 2029 | if (ok != nullptr) { |
| 2030 | *ok = true; |
| 2031 | } |
| 2032 | |
| 2033 | return updated_messages; |
| 2034 | } |
| 2035 | |
| 2036 | bool DatabaseQueriescxx . . $ DatabaseQueries#::purgeMessagesFromBincxx . . $ DatabaseQueries#purgeMessagesFromBin(c36b96d9cb3706e6).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, bool clear_only_read, int account_id) { |
| 2037 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2038 | |
| 2039 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2040 | |
| 2041 | if (clear_only_read) { |
| 2042 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_pdeleted = 1 WHERE is_read = 1 AND is_deleted = 1 AND account_id = " |
| 2043 | ":account_id;")); |
| 2044 | } |
| 2045 | else { |
| 2046 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_pdeleted = 1 WHERE is_deleted = 1 AND account_id = :account_id;")); |
| 2047 | } |
| 2048 | |
| 2049 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2050 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2051 | } |
| 2052 | |
| 2053 | bool DatabaseQueriescxx . . $ DatabaseQueries#::deleteAccountcxx . . $ DatabaseQueries#deleteAccount(7654f6248827f336).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, ServiceRootcxx . . $ ServiceRoot#* account) { |
| 2054 | moveItemcxx . . $ DatabaseQueries#moveItem(f20a617a9b42979).(account, false, true, {}, db); |
| 2055 | |
| 2056 | QSqlQuerycxx . . $ QSqlQuery# querycxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2057 | |
| 2058 | query.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2059 | QStringListcxx . . $ QStringList# queriescxx . . $ QList#QList(ced63f7c635d850d).; |
| 2060 | |
| 2061 | queries <<cxx . . $ QList#`operator<<`(457f2c2a0db63381). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM MessageFiltersInFeeds WHERE account_id = :account_id;") |
| 2062 | <<cxx . . $ QList#`operator<<`(457f2c2a0db63381). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages WHERE account_id = :account_id;") |
| 2063 | <<cxx . . $ QList#`operator<<`(457f2c2a0db63381). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Feeds WHERE account_id = :account_id;") |
| 2064 | <<cxx . . $ QList#`operator<<`(457f2c2a0db63381). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Categories WHERE account_id = :account_id;") |
| 2065 | <<cxx . . $ QList#`operator<<`(457f2c2a0db63381). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Labels WHERE account_id = :account_id;") |
| 2066 | <<cxx . . $ QList#`operator<<`(457f2c2a0db63381). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Accounts WHERE id = :account_id;"); |
| 2067 | |
| 2068 | for (const QStringcxx . . $ QString#& q : stdcxx . . $ std/::as_constcxx . . $ std/as_const(1dc117cbefefc300).(queries)) { |
| 2069 | query.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(q); |
| 2070 | query.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), accountcxx . . $ QVariant#QVariant(f349c77f591a7878).->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 2071 | |
| 2072 | if (!query.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2073 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Removing of account from DB failed, this is critical: '" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). query.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).() |
| 2074 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "'."; |
| 2075 | return false; |
| 2076 | } |
| 2077 | else { |
| 2078 | query.finishcxx . . $ QSqlQuery#finish(49f6e7a06ebc5aa8).(); |
| 2079 | } |
| 2080 | } |
| 2081 | |
| 2082 | return true; |
| 2083 | } |
| 2084 | |
| 2085 | bool DatabaseQueriescxx . . $ DatabaseQueries#::deleteAccountDatacxx . . $ DatabaseQueries#deleteAccountData(d1edcbd0e9fd446f).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 2086 | int account_id, |
| 2087 | bool delete_messages_too, |
| 2088 | bool delete_labels_too) { |
| 2089 | bool result = true; |
| 2090 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2091 | |
| 2092 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2093 | |
| 2094 | if (delete_messages_too) { |
| 2095 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages WHERE account_id = :account_id;")); |
| 2096 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2097 | result &= q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2098 | } |
| 2099 | |
| 2100 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Feeds WHERE account_id = :account_id;")); |
| 2101 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2102 | result &= q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2103 | |
| 2104 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Categories WHERE account_id = :account_id;")); |
| 2105 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2106 | result &= q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2107 | |
| 2108 | if (delete_labels_too) { |
| 2109 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Labels WHERE account_id = :account_id;")); |
| 2110 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2111 | result &= q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2112 | } |
| 2113 | |
| 2114 | return result; |
| 2115 | } |
| 2116 | |
| 2117 | bool DatabaseQueriescxx . . $ DatabaseQueries#::cleanLabelledMessagescxx . . $ DatabaseQueries#cleanLabelledMessages(3baa1e5a3d01667a).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, bool clean_read_only, Labelcxx . . $ Label#* label) { |
| 2118 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2119 | |
| 2120 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2121 | |
| 2122 | if (clean_read_only) { |
| 2123 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_deleted = :deleted " |
| 2124 | "WHERE " |
| 2125 | " is_deleted = 0 AND " |
| 2126 | " is_pdeleted = 0 AND " |
| 2127 | " is_read = 1 AND " |
| 2128 | " account_id = :account_id AND " |
| 2129 | " labels LIKE :label;")); |
| 2130 | } |
| 2131 | else { |
| 2132 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_deleted = :deleted " |
| 2133 | "WHERE " |
| 2134 | " is_deleted = 0 AND " |
| 2135 | " is_pdeleted = 0 AND " |
| 2136 | " account_id = :account_id AND " |
| 2137 | " labels LIKE :label;")); |
| 2138 | } |
| 2139 | |
| 2140 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":deleted"), 1cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2141 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 2142 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":label"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("%.%1.%").argcxx . . $ QString#arg(ad0bca07273edcc2).(label->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).())); |
| 2143 | |
| 2144 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2145 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Cleaning of labelled messages failed:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(q.lastError().text()); |
| 2146 | return false; |
| 2147 | } |
| 2148 | else { |
| 2149 | return true; |
| 2150 | } |
| 2151 | } |
| 2152 | |
| 2153 | void DatabaseQueriescxx . . $ DatabaseQueries#::cleanProbedMessagescxx . . $ DatabaseQueries#cleanProbedMessages(c95b318ca26899a0).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, bool clean_read_only, Searchcxx . . $ Search#* probe) { |
| 2154 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2155 | |
| 2156 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2157 | |
| 2158 | if (clean_read_only) { |
| 2159 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_deleted = :deleted " |
| 2160 | "WHERE " |
| 2161 | " is_deleted = 0 AND " |
| 2162 | " is_pdeleted = 0 AND " |
| 2163 | " is_read = 1 AND " |
| 2164 | " account_id = :account_id AND " |
| 2165 | " (title REGEXP :fltr OR contents REGEXP :fltr);")); |
| 2166 | } |
| 2167 | else { |
| 2168 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_deleted = :deleted " |
| 2169 | "WHERE " |
| 2170 | " is_deleted = 0 AND " |
| 2171 | " is_pdeleted = 0 AND " |
| 2172 | " account_id = :account_id AND " |
| 2173 | " (title REGEXP :fltr OR contents REGEXP :fltr);")); |
| 2174 | } |
| 2175 | |
| 2176 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":deleted"), 1cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2177 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), probecxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 2178 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":fltr"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->filtercxx . . $ Search#filter(6ef7b6c27b00b43d).()); |
| 2179 | |
| 2180 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2181 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2182 | } |
| 2183 | } |
| 2184 | |
| 2185 | bool DatabaseQueriescxx . . $ DatabaseQueries#::cleanImportantMessagescxx . . $ DatabaseQueries#cleanImportantMessages(c36b96d9cb3706e6).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, bool clean_read_only, int account_id) { |
| 2186 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2187 | |
| 2188 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2189 | |
| 2190 | if (clean_read_only) { |
| 2191 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_deleted = :deleted " |
| 2192 | "WHERE is_important = 1 AND is_deleted = 0 AND is_pdeleted = 0 AND is_read = 1 AND account_id = " |
| 2193 | ":account_id;")); |
| 2194 | } |
| 2195 | else { |
| 2196 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_deleted = :deleted " |
| 2197 | "WHERE is_important = 1 AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 2198 | } |
| 2199 | |
| 2200 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":deleted"), 1cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2201 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2202 | |
| 2203 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2204 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Cleaning of important messages failed: '" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "'."; |
| 2205 | return false; |
| 2206 | } |
| 2207 | else { |
| 2208 | return true; |
| 2209 | } |
| 2210 | } |
| 2211 | |
| 2212 | bool DatabaseQueriescxx . . $ DatabaseQueries#::cleanUnreadMessagescxx . . $ DatabaseQueries#cleanUnreadMessages(d8032dc71cca56cc).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id) { |
| 2213 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2214 | |
| 2215 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2216 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_deleted = :deleted " |
| 2217 | "WHERE is_deleted = 0 AND is_pdeleted = 0 AND is_read = 0 AND account_id = :account_id;")); |
| 2218 | |
| 2219 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":deleted"), 1cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2220 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2221 | |
| 2222 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2223 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Cleaning of unread messages failed: '" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "'."; |
| 2224 | return false; |
| 2225 | } |
| 2226 | else { |
| 2227 | return true; |
| 2228 | } |
| 2229 | } |
| 2230 | |
| 2231 | bool DatabaseQueriescxx . . $ DatabaseQueries#::cleanFeedscxx . . $ DatabaseQueries#cleanFeeds(751433c9103cda00).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, const QStringListcxx . . $ QStringList#& ids, bool clean_read_only, int account_id) { |
| 2232 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2233 | |
| 2234 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2235 | |
| 2236 | if (clean_read_only) { |
| 2237 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("UPDATE Messages SET is_deleted = :deleted " |
| 2238 | "WHERE feed IN (%1) AND is_deleted = 0 AND is_pdeleted = 0 AND is_read = 1 AND account_id = " |
| 2239 | ":account_id;") |
| 2240 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(ids.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 2241 | } |
| 2242 | else { |
| 2243 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("UPDATE Messages SET is_deleted = :deleted " |
| 2244 | "WHERE feed IN (%1) AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;") |
| 2245 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(ids.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(", ")))); |
| 2246 | } |
| 2247 | |
| 2248 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":deleted"), 1cxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2249 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2250 | |
| 2251 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2252 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Cleaning of feeds failed: '" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "'."; |
| 2253 | return false; |
| 2254 | } |
| 2255 | else { |
| 2256 | return true; |
| 2257 | } |
| 2258 | } |
| 2259 | |
| 2260 | bool DatabaseQueriescxx . . $ DatabaseQueries#::purgeLeftoverMessageFilterAssignmentscxx . . $ DatabaseQueries#purgeLeftoverMessageFilterAssignments(d8032dc71cca56cc).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id) { |
| 2261 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2262 | |
| 2263 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2264 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM MessageFiltersInFeeds " |
| 2265 | "WHERE account_id = :account_id AND " |
| 2266 | "feed_custom_id NOT IN (SELECT custom_id FROM Feeds WHERE account_id = :account_id);")); |
| 2267 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2268 | |
| 2269 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2270 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Removing of leftover message filter assignments failed: '" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).() |
| 2271 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "'."; |
| 2272 | return false; |
| 2273 | } |
| 2274 | else { |
| 2275 | return true; |
| 2276 | } |
| 2277 | } |
| 2278 | |
| 2279 | bool DatabaseQueriescxx . . $ DatabaseQueries#::purgeLeftoverMessagescxx . . $ DatabaseQueries#purgeLeftoverMessages(d8032dc71cca56cc).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id) { |
| 2280 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2281 | |
| 2282 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2283 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages " |
| 2284 | "WHERE account_id = :account_id AND feed NOT IN (SELECT custom_id FROM Feeds WHERE account_id = " |
| 2285 | ":account_id);")); |
| 2286 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2287 | |
| 2288 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2289 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_DBcxx . . $ `src/librssguard/definitions/definitions.h:180:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Removing of leftover messages failed: '" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "'."; |
| 2290 | return false; |
| 2291 | } |
| 2292 | else { |
| 2293 | return true; |
| 2294 | } |
| 2295 | } |
| 2296 | |
| 2297 | void DatabaseQueriescxx . . $ DatabaseQueries#::storeAccountTreecxx . . $ DatabaseQueries#storeAccountTree(c017e062e91577af).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, RootItemcxx . . $ RootItem#* tree_root, int account_id) { |
| 2298 | // Iterate all children. |
| 2299 | auto str = tree_root->getSubTreecxx . . $ RootItem#getSubTree(38d8ae5645f2bbf1).<RootItemcxx . . $ RootItem#>(); |
| 2300 | |
| 2301 | for (RootItemcxx . . $ RootItem#* child : stdcxx . . $ std/::as_constcxx . . $ std/as_const(1dc117cbefefc300).(str)) { |
| 2302 | if (child->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Categorycxx . . $ RootItem#Kind#Category.) { |
| 2303 | createOverwriteCategorycxx . . $ DatabaseQueries#createOverwriteCategory(1aade24338114213).(db, child->toCategorycxx . . $ RootItem#toCategory(7ec1e35fb0cd560d).(), account_id, child->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).()->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 2304 | } |
| 2305 | else if (child->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Feedcxx . . $ RootItem#Kind#Feed.) { |
| 2306 | createOverwriteFeedcxx . . $ DatabaseQueries#createOverwriteFeed(235dc10d297885ee).(db, child->toFeedcxx . . $ RootItem#toFeed(6205f4b142e8b232).(), account_id, child->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).()->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 2307 | } |
| 2308 | else if (child->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Labelscxx . . $ RootItem#Kind#Labels.) { |
| 2309 | // Add all labels. |
| 2310 | auto ch = child->childItemscxx . . $ RootItem#childItems(f275a58a8bc5f139).(); |
| 2311 | |
| 2312 | for (RootItemcxx . . $ RootItem#* lbl : stdcxx . . $ std/::as_constcxx . . $ std/as_const(1dc117cbefefc300).(ch)) { |
| 2313 | Labelcxx . . $ Label#* label = lbl->toLabelcxx . . $ RootItem#toLabel(3494628e4df37b42).(); |
| 2314 | |
| 2315 | createLabelcxx . . $ DatabaseQueries#createLabel(73c307d30be60cd2).(db, label, account_id); |
| 2316 | } |
| 2317 | } |
| 2318 | } |
| 2319 | } |
| 2320 | |
| 2321 | QStringListcxx . . $ QStringList# DatabaseQueriescxx . . $ DatabaseQueries#::customIdsOfMessagesFromAccountcxx . . $ DatabaseQueries#customIdsOfMessagesFromAccount(48f448c6c6a368e0).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 2322 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# target_read, |
| 2323 | int account_id, |
| 2324 | bool* ok) { |
| 2325 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2326 | QStringListcxx . . $ QStringList# idscxx . . $ QList#QList(ced63f7c635d850d).; |
| 2327 | |
| 2328 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2329 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT custom_id FROM Messages " |
| 2330 | "WHERE is_read = :read AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 2331 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2332 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), target_readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 0 : 1); |
| 2333 | |
| 2334 | if (ok != nullptr) { |
| 2335 | *ok = q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2336 | } |
| 2337 | else { |
| 2338 | q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2339 | } |
| 2340 | |
| 2341 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 2342 | ids.appendcxx . . $ QList#append(1262c8661f7a27a7).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 2343 | } |
| 2344 | |
| 2345 | return ids; |
| 2346 | } |
| 2347 | |
| 2348 | QStringListcxx . . $ QStringList# DatabaseQueriescxx . . $ DatabaseQueries#::customIdsOfMessagesFromLabelcxx . . $ DatabaseQueries#customIdsOfMessagesFromLabel(923aa9f1971615aa).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 2349 | Labelcxx . . $ Label#* label, |
| 2350 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# target_read, |
| 2351 | bool* ok) { |
| 2352 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2353 | QStringListcxx . . $ QStringList# idscxx . . $ QList#QList(ced63f7c635d850d).; |
| 2354 | |
| 2355 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2356 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT custom_id FROM Messages " |
| 2357 | "WHERE " |
| 2358 | " is_read = :read AND " |
| 2359 | " is_deleted = 0 AND " |
| 2360 | " is_pdeleted = 0 AND " |
| 2361 | " account_id = :account_id AND " |
| 2362 | " labels LIKE :label;")); |
| 2363 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), labelcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 2364 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":label"), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("%.%1.%").argcxx . . $ QString#arg(ad0bca07273edcc2).(label->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).())); |
| 2365 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), target_readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 0 : 1); |
| 2366 | |
| 2367 | if (ok != nullptr) { |
| 2368 | *ok = q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2369 | } |
| 2370 | else { |
| 2371 | q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2372 | } |
| 2373 | |
| 2374 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 2375 | ids.appendcxx . . $ QList#append(1262c8661f7a27a7).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 2376 | } |
| 2377 | |
| 2378 | return ids; |
| 2379 | } |
| 2380 | |
| 2381 | void DatabaseQueriescxx . . $ DatabaseQueries#::markProbeReadUnreadcxx . . $ DatabaseQueries#markProbeReadUnread(992e896b25c4f4e).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Searchcxx . . $ Search#* probe, RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# read) { |
| 2382 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2383 | |
| 2384 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2385 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Messages SET is_read = :read " |
| 2386 | "WHERE " |
| 2387 | " is_deleted = 0 AND " |
| 2388 | " is_pdeleted = 0 AND " |
| 2389 | " account_id = :account_id AND " |
| 2390 | " (title REGEXP :fltr OR contents REGEXP :fltr);")); |
| 2391 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 1 : 0); |
| 2392 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), probecxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 2393 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":fltr"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->filtercxx . . $ Search#filter(6ef7b6c27b00b43d).()); |
| 2394 | |
| 2395 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2396 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2397 | } |
| 2398 | } |
| 2399 | |
| 2400 | QStringListcxx . . $ QStringList# DatabaseQueriescxx . . $ DatabaseQueries#::customIdsOfMessagesFromProbecxx . . $ DatabaseQueries#customIdsOfMessagesFromProbe(ac4134f412504b9f).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 2401 | Searchcxx . . $ Search#* probe, |
| 2402 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# target_read) { |
| 2403 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2404 | QStringListcxx . . $ QStringList# idscxx . . $ QList#QList(ced63f7c635d850d).; |
| 2405 | |
| 2406 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2407 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT custom_id FROM Messages " |
| 2408 | "WHERE " |
| 2409 | " is_read = :read AND " |
| 2410 | " is_deleted = 0 AND " |
| 2411 | " is_pdeleted = 0 AND " |
| 2412 | " account_id = :account_id AND " |
| 2413 | " (title REGEXP :fltr OR contents REGEXP :fltr);")); |
| 2414 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), probecxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 2415 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), target_readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 0 : 1); |
| 2416 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":fltr"), probecxx . . $ QVariant#QVariant(132dd6869045752b).->filtercxx . . $ Search#filter(6ef7b6c27b00b43d).()); |
| 2417 | |
| 2418 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2419 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2420 | } |
| 2421 | |
| 2422 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 2423 | ids.appendcxx . . $ QList#append(1262c8661f7a27a7).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 2424 | } |
| 2425 | |
| 2426 | return ids; |
| 2427 | } |
| 2428 | |
| 2429 | QStringListcxx . . $ QStringList# DatabaseQueriescxx . . $ DatabaseQueries#::customIdsOfImportantMessagescxx . . $ DatabaseQueries#customIdsOfImportantMessages(48f448c6c6a368e0).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 2430 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# target_read, |
| 2431 | int account_id, |
| 2432 | bool* ok) { |
| 2433 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2434 | QStringListcxx . . $ QStringList# idscxx . . $ QList#QList(ced63f7c635d850d).; |
| 2435 | |
| 2436 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2437 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT custom_id FROM Messages " |
| 2438 | "WHERE " |
| 2439 | "is_read = :read AND is_important = 1 AND is_deleted = 0 AND " |
| 2440 | "is_pdeleted = 0 AND account_id = :account_id;")); |
| 2441 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2442 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), target_readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 0 : 1); |
| 2443 | |
| 2444 | if (ok != nullptr) { |
| 2445 | *ok = q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2446 | } |
| 2447 | else { |
| 2448 | q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2449 | } |
| 2450 | |
| 2451 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 2452 | ids.appendcxx . . $ QList#append(1262c8661f7a27a7).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 2453 | } |
| 2454 | |
| 2455 | return ids; |
| 2456 | } |
| 2457 | |
| 2458 | QStringListcxx . . $ QStringList# DatabaseQueriescxx . . $ DatabaseQueries#::customIdsOfUnreadMessagescxx . . $ DatabaseQueries#customIdsOfUnreadMessages(f3e086b87dba7817).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, bool* ok) { |
| 2459 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2460 | QStringListcxx . . $ QStringList# idscxx . . $ QList#QList(ced63f7c635d850d).; |
| 2461 | |
| 2462 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2463 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT custom_id FROM Messages " |
| 2464 | "WHERE is_read = 0 AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 2465 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2466 | |
| 2467 | if (ok != nullptr) { |
| 2468 | *ok = q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2469 | } |
| 2470 | else { |
| 2471 | q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2472 | } |
| 2473 | |
| 2474 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 2475 | ids.appendcxx . . $ QList#append(1262c8661f7a27a7).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 2476 | } |
| 2477 | |
| 2478 | return ids; |
| 2479 | } |
| 2480 | |
| 2481 | QStringListcxx . . $ QStringList# DatabaseQueriescxx . . $ DatabaseQueries#::customIdsOfMessagesFromBincxx . . $ DatabaseQueries#customIdsOfMessagesFromBin(48f448c6c6a368e0).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 2482 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# target_read, |
| 2483 | int account_id, |
| 2484 | bool* ok) { |
| 2485 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2486 | QStringListcxx . . $ QStringList# idscxx . . $ QList#QList(ced63f7c635d850d).; |
| 2487 | |
| 2488 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2489 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT custom_id FROM Messages " |
| 2490 | "WHERE is_read = :read AND is_deleted = 1 AND is_pdeleted = 0 AND account_id = :account_id;")); |
| 2491 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2492 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), target_readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 0 : 1); |
| 2493 | |
| 2494 | if (ok != nullptr) { |
| 2495 | *ok = q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2496 | } |
| 2497 | else { |
| 2498 | q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2499 | } |
| 2500 | |
| 2501 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 2502 | ids.appendcxx . . $ QList#append(1262c8661f7a27a7).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 2503 | } |
| 2504 | |
| 2505 | return ids; |
| 2506 | } |
| 2507 | |
| 2508 | QStringListcxx . . $ QStringList# DatabaseQueriescxx . . $ DatabaseQueries#::customIdsOfMessagesFromFeedcxx . . $ DatabaseQueries#customIdsOfMessagesFromFeed(2f4e7e6149f5934f).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 2509 | const QStringcxx . . $ QString#& feed_custom_id, |
| 2510 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# target_read, |
| 2511 | int account_id, |
| 2512 | bool* ok) { |
| 2513 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2514 | QStringListcxx . . $ QStringList# idscxx . . $ QList#QList(ced63f7c635d850d).; |
| 2515 | |
| 2516 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2517 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT custom_id FROM Messages " |
| 2518 | "WHERE is_read = :read AND is_deleted = 0 AND " |
| 2519 | "is_pdeleted = 0 AND feed = :feed AND account_id = :account_id;")); |
| 2520 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2521 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), feed_custom_idcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 2522 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":read"), target_readcxx . . $ QVariant#QVariant(f349c77f591a7878). == RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. ? 0 : 1); |
| 2523 | |
| 2524 | if (ok != nullptr) { |
| 2525 | *ok = q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2526 | } |
| 2527 | else { |
| 2528 | q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2529 | } |
| 2530 | |
| 2531 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 2532 | ids.appendcxx . . $ QList#append(1262c8661f7a27a7).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 2533 | } |
| 2534 | |
| 2535 | return ids; |
| 2536 | } |
| 2537 | |
| 2538 | void DatabaseQueriescxx . . $ DatabaseQueries#::createOverwriteCategorycxx . . $ DatabaseQueries#createOverwriteCategory(1aade24338114213).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 2539 | Categorycxx . . $ Category#* category, |
| 2540 | int account_id, |
| 2541 | int new_parent_id) { |
| 2542 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2543 | int next_sort_order; |
| 2544 | |
| 2545 | if (category->idcxx . . $ RootItem#id(455f465bc33b4cdf).() <= 0 || (category->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).() != nullptr && category->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).()->idcxx . . $ RootItem#id(455f465bc33b4cdf).() != new_parent_id)) { |
| 2546 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT MAX(ordr) FROM Categories WHERE account_id = :account_id AND parent_id = :parent_id;")); |
| 2547 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2548 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":parent_id"), new_parent_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2549 | |
| 2550 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() || !q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 2551 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2552 | } |
| 2553 | |
| 2554 | next_sort_order = (q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).isNullcxx . . $ QVariant#isNull(50ce9a9e25b4a850).() ? -1 : q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()) + 1; |
| 2555 | q.finishcxx . . $ QSqlQuery#finish(49f6e7a06ebc5aa8).(); |
| 2556 | } |
| 2557 | else { |
| 2558 | next_sort_order = category->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).(); |
| 2559 | } |
| 2560 | |
| 2561 | if (category->idcxx . . $ RootItem#id(455f465bc33b4cdf).() <= 0) { |
| 2562 | // We need to insert category first. |
| 2563 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("INSERT INTO " |
| 2564 | "Categories (parent_id, ordr, title, date_created, account_id) " |
| 2565 | "VALUES (0, 0, 'new', 0, %1);") |
| 2566 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(account_id))); |
| 2567 | |
| 2568 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2569 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2570 | } |
| 2571 | else { |
| 2572 | category->setIdcxx . . $ RootItem#setId(d4f767463ce0a6b3).(q.lastInsertIdcxx . . $ QSqlQuery#lastInsertId(23280f95d1ccaa1f).().toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 2573 | } |
| 2574 | } |
| 2575 | else if (category->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).() != nullptr && category->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).()->idcxx . . $ RootItem#id(455f465bc33b4cdf).() != new_parent_id) { |
| 2576 | // Category is moving between parents. |
| 2577 | // 1. Move category to bottom of current parent. |
| 2578 | // 2. Assign proper new sort order. |
| 2579 | // |
| 2580 | // NOTE: The category will get reassigned to new parent usually after this method |
| 2581 | // completes by the caller. |
| 2582 | moveItemcxx . . $ DatabaseQueries#moveItem(f20a617a9b42979).(category, false, true, {}, db); |
| 2583 | } |
| 2584 | |
| 2585 | // Restore to correct sort order. |
| 2586 | category->setSortOrdercxx . . $ RootItem#setSortOrder(d4f767463ce0a6b3).(next_sort_order); |
| 2587 | |
| 2588 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).("UPDATE Categories "cxx . . $ QString#QString(85c52e162fed56f9). |
| 2589 | "SET parent_id = :parent_id, ordr = :ordr, title = :title, description = :description, date_created = " |
| 2590 | ":date_created, " |
| 2591 | " icon = :icon, account_id = :account_id, custom_id = :custom_id " |
| 2592 | "WHERE id = :id;"); |
| 2593 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":parent_id"), new_parent_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2594 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":title"), categorycxx . . $ QVariant#QVariant(132dd6869045752b).->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).()); |
| 2595 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":description"), categorycxx . . $ QVariant#QVariant(132dd6869045752b).->descriptioncxx . . $ RootItem#description(6ef7b6c27b00b43d).()); |
| 2596 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":date_created"), categorycxx . . $ QVariant#QVariant(1ca78f0f7b9b0ce5).->creationDatecxx . . $ RootItem#creationDate(4e062b5c490497ac).().toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).()); |
| 2597 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":icon"), qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->toByteArraycxx . . $ IconFactory#toByteArray(e1f790fd40d1d8c2).(category->iconcxx . . $ RootItem#icon(952ef71f8967d9eb).())); |
| 2598 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2599 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":custom_id"), categorycxx . . $ QVariant#QVariant(132dd6869045752b).->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).()); |
| 2600 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), categorycxx . . $ QVariant#QVariant(f349c77f591a7878).->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 2601 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":ordr"), categorycxx . . $ QVariant#QVariant(f349c77f591a7878).->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).()); |
| 2602 | |
| 2603 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2604 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2605 | } |
| 2606 | } |
| 2607 | |
| 2608 | void DatabaseQueriescxx . . $ DatabaseQueries#::createOverwriteFeedcxx . . $ DatabaseQueries#createOverwriteFeed(235dc10d297885ee).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Feedcxx . . $ Feed#* feed, int account_id, int new_parent_id) { |
| 2609 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2610 | int next_sort_order; |
| 2611 | |
| 2612 | if (feed->idcxx . . $ RootItem#id(455f465bc33b4cdf).() <= 0 || (feed->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).() != nullptr && feed->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).()->idcxx . . $ RootItem#id(455f465bc33b4cdf).() != new_parent_id)) { |
| 2613 | // We either insert completely new feed or we move feed |
| 2614 | // to new parent. Get new viable sort order. |
| 2615 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT MAX(ordr) FROM Feeds WHERE account_id = :account_id AND category = :category;")); |
| 2616 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2617 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":category"), new_parent_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2618 | |
| 2619 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() || !q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 2620 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2621 | } |
| 2622 | |
| 2623 | next_sort_order = (q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).isNullcxx . . $ QVariant#isNull(50ce9a9e25b4a850).() ? -1 : q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()) + 1; |
| 2624 | q.finishcxx . . $ QSqlQuery#finish(49f6e7a06ebc5aa8).(); |
| 2625 | } |
| 2626 | else { |
| 2627 | next_sort_order = feed->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).(); |
| 2628 | } |
| 2629 | |
| 2630 | if (feed->idcxx . . $ RootItem#id(455f465bc33b4cdf).() <= 0) { |
| 2631 | // We need to insert feed first. |
| 2632 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("INSERT INTO " |
| 2633 | "Feeds (title, ordr, date_created, category, update_type, update_interval, account_id, custom_id) " |
| 2634 | "VALUES ('new', 0, 0, 0, 0, 1, %1, 'new');") |
| 2635 | .argcxx . . $ QString#arg(ad0bca07273edcc2).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(account_id))); |
| 2636 | |
| 2637 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2638 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2639 | } |
| 2640 | else { |
| 2641 | feed->setIdcxx . . $ RootItem#setId(d4f767463ce0a6b3).(q.lastInsertIdcxx . . $ QSqlQuery#lastInsertId(23280f95d1ccaa1f).().toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 2642 | |
| 2643 | if (feed->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 2644 | feed->setCustomIdcxx . . $ RootItem#setCustomId(3520e46b33348bf6).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(feed->idcxx . . $ RootItem#id(455f465bc33b4cdf).())); |
| 2645 | } |
| 2646 | } |
| 2647 | } |
| 2648 | else if (feed->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).() != nullptr && feed->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).()->idcxx . . $ RootItem#id(455f465bc33b4cdf).() != new_parent_id) { |
| 2649 | // Feed is moving between categories. |
| 2650 | // 1. Move feed to bottom of current category. |
| 2651 | // 2. Assign proper new sort order. |
| 2652 | // |
| 2653 | // NOTE: The feed will get reassigned to new parent usually after this method |
| 2654 | // completes by the caller. |
| 2655 | moveItemcxx . . $ DatabaseQueries#moveItem(f20a617a9b42979).(feed, false, true, {}, db); |
| 2656 | } |
| 2657 | |
| 2658 | // Restore to correct sort order. |
| 2659 | feed->setSortOrdercxx . . $ RootItem#setSortOrder(d4f767463ce0a6b3).(next_sort_order); |
| 2660 | |
| 2661 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).("UPDATE Feeds "cxx . . $ QString#QString(85c52e162fed56f9). |
| 2662 | "SET " |
| 2663 | "title = :title, " |
| 2664 | "ordr = :ordr, " |
| 2665 | "description = :description, " |
| 2666 | "date_created = :date_created, " |
| 2667 | "icon = :icon, " |
| 2668 | "category = :category, " |
| 2669 | "source = :source, " |
| 2670 | "update_type = :update_type, " |
| 2671 | "update_interval = :update_interval, " |
| 2672 | "is_off = :is_off, " |
| 2673 | "is_quiet = :is_quiet, " |
| 2674 | "open_articles = :open_articles, " |
| 2675 | "is_rtl = :is_rtl, " |
| 2676 | "add_any_datetime_articles = :add_any_datetime_articles, " |
| 2677 | "datetime_to_avoid = :datetime_to_avoid, " |
| 2678 | "keep_article_customize = :keep_article_customize, " |
| 2679 | "keep_article_count = :keep_article_count, " |
| 2680 | "keep_unread_articles = :keep_unread_articles, " |
| 2681 | "keep_starred_articles = :keep_starred_articles, " |
| 2682 | "recycle_articles = :recycle_articles, " |
| 2683 | "account_id = :account_id, " |
| 2684 | "custom_id = :custom_id, " |
| 2685 | "custom_data = :custom_data " |
| 2686 | "WHERE id = :id;"); |
| 2687 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":title"), feedcxx . . $ QVariant#QVariant(132dd6869045752b).->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).()); |
| 2688 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":description"), feedcxx . . $ QVariant#QVariant(132dd6869045752b).->descriptioncxx . . $ RootItem#description(6ef7b6c27b00b43d).()); |
| 2689 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":date_created"), feedcxx . . $ QVariant#QVariant(1ca78f0f7b9b0ce5).->creationDatecxx . . $ RootItem#creationDate(4e062b5c490497ac).().toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).()); |
| 2690 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":icon"), qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->toByteArraycxx . . $ IconFactory#toByteArray(e1f790fd40d1d8c2).(feed->iconcxx . . $ RootItem#icon(952ef71f8967d9eb).())); |
| 2691 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":category"), new_parent_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2692 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":source"), feedcxx . . $ QVariant#QVariant(132dd6869045752b).->sourcecxx . . $ Feed#source(6ef7b6c27b00b43d).()); |
| 2693 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":update_type"), intcxx . . $ QVariant#QVariant(f349c77f591a7878).(feed->autoUpdateTypecxx . . $ Feed#autoUpdateType(32c2e86181102346).())); |
| 2694 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":update_interval"), feedcxx . . $ QVariant#QVariant(f349c77f591a7878).->autoUpdateIntervalcxx . . $ Feed#autoUpdateInterval(455f465bc33b4cdf).()); |
| 2695 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2696 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":custom_id"), feedcxx . . $ QVariant#QVariant(132dd6869045752b).->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).()); |
| 2697 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), feedcxx . . $ QVariant#QVariant(f349c77f591a7878).->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 2698 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":ordr"), feedcxx . . $ QVariant#QVariant(f349c77f591a7878).->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).()); |
| 2699 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_off"), feedcxx . . $ QVariant#QVariant(9f0ba574c1c44ffc).->isSwitchedOffcxx . . $ Feed#isSwitchedOff(50ce9a9e25b4a850).()); |
| 2700 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_quiet"), feedcxx . . $ QVariant#QVariant(9f0ba574c1c44ffc).->isQuietcxx . . $ Feed#isQuiet(50ce9a9e25b4a850).()); |
| 2701 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":open_articles"), feedcxx . . $ QVariant#QVariant(9f0ba574c1c44ffc).->openArticlesDirectlycxx . . $ Feed#openArticlesDirectly(50ce9a9e25b4a850).()); |
| 2702 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":is_rtl"), intcxx . . $ QVariant#QVariant(f349c77f591a7878).(feed->rtlBehaviorcxx . . $ Feed#rtlBehavior(1d55ef3bd2b2e67d).())); |
| 2703 | |
| 2704 | const Feedcxx . . $ Feed#::ArticleIgnoreLimitcxx . . $ Feed#ArticleIgnoreLimit# art = feed->articleIgnoreLimitcxx . . $ Feed#articleIgnoreLimit(a6099ccba00faa1d).(); |
| 2705 | |
| 2706 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":add_any_datetime_articles"), artcxx . . $ QVariant#QVariant(9f0ba574c1c44ffc)..m_addAnyArticlesToDbcxx . . $ Feed#ArticleIgnoreLimit#m_addAnyArticlesToDb.); |
| 2707 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":datetime_to_avoid"), |
| 2708 | (cxx . . $ QVariant#QVariant(1ca78f0f7b9b0ce5).art.m_dtToAvoidcxx . . $ Feed#ArticleIgnoreLimit#m_dtToAvoid..isValidcxx . . $ QDateTime#isValid(50ce9a9e25b4a850).() && art.m_dtToAvoidcxx . . $ Feed#ArticleIgnoreLimit#m_dtToAvoid..toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).() > 0) |
| 2709 | ? art.m_dtToAvoidcxx . . $ Feed#ArticleIgnoreLimit#m_dtToAvoid..toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).() |
| 2710 | : art.m_hoursToAvoidcxx . . $ Feed#ArticleIgnoreLimit#m_hoursToAvoid.); |
| 2711 | |
| 2712 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":keep_article_customize"), artcxx . . $ QVariant#QVariant(9f0ba574c1c44ffc)..m_customizeLimittingcxx . . $ Feed#ArticleIgnoreLimit#m_customizeLimitting.); |
| 2713 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":keep_article_count"), artcxx . . $ QVariant#QVariant(f349c77f591a7878)..m_keepCountOfArticlescxx . . $ Feed#ArticleIgnoreLimit#m_keepCountOfArticles.); |
| 2714 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":keep_unread_articles"), artcxx . . $ QVariant#QVariant(9f0ba574c1c44ffc)..m_doNotRemoveUnreadcxx . . $ Feed#ArticleIgnoreLimit#m_doNotRemoveUnread.); |
| 2715 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":keep_starred_articles"), artcxx . . $ QVariant#QVariant(9f0ba574c1c44ffc)..m_doNotRemoveStarredcxx . . $ Feed#ArticleIgnoreLimit#m_doNotRemoveStarred.); |
| 2716 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":recycle_articles"), artcxx . . $ QVariant#QVariant(9f0ba574c1c44ffc)..m_moveToBinDontPurgecxx . . $ Feed#ArticleIgnoreLimit#m_moveToBinDontPurge.); |
| 2717 | |
| 2718 | auto custom_data = feed->customDatabaseDatacxx . . $ Feed#customDatabaseData(556033a494fe4eb9).(); |
| 2719 | QStringcxx . . $ QString# serialized_custom_data = serializeCustomDatacxx . . $ DatabaseQueries#serializeCustomData(f70f12fa894c0ae9).(custom_data); |
| 2720 | |
| 2721 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":custom_data"), serialized_custom_datacxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 2722 | |
| 2723 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2724 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2725 | } |
| 2726 | } |
| 2727 | |
| 2728 | void DatabaseQueriescxx . . $ DatabaseQueries#::createOverwriteAccountcxx . . $ DatabaseQueries#createOverwriteAccount(7e936fcc00e36b24).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, ServiceRootcxx . . $ ServiceRoot#* account) { |
| 2729 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2730 | |
| 2731 | if (account->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).() <= 0) { |
| 2732 | // We need to insert account and generate sort order first. |
| 2733 | if (account->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() < 0) { |
| 2734 | if (!q.execcxx . . $ QSqlQuery#exec(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT MAX(ordr) FROM Accounts;"))) { |
| 2735 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2736 | } |
| 2737 | |
| 2738 | q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).(); |
| 2739 | |
| 2740 | int next_order = (q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).isNullcxx . . $ QVariant#isNull(50ce9a9e25b4a850).() ? -1 : q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()) + 1; |
| 2741 | |
| 2742 | account->setSortOrdercxx . . $ RootItem#setSortOrder(d4f767463ce0a6b3).(next_order); |
| 2743 | q.finishcxx . . $ QSqlQuery#finish(49f6e7a06ebc5aa8).(); |
| 2744 | } |
| 2745 | |
| 2746 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("INSERT INTO Accounts (ordr, type) " |
| 2747 | "VALUES (0, :type);")); |
| 2748 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":type"), accountcxx . . $ QVariant#QVariant(132dd6869045752b).->codecxx . . $ ServiceRoot#code(6ef7b6c27b00b43d).()); |
| 2749 | |
| 2750 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2751 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2752 | } |
| 2753 | else { |
| 2754 | account->setAccountIdcxx . . $ ServiceRoot#setAccountId(d4f767463ce0a6b3).(q.lastInsertIdcxx . . $ QSqlQuery#lastInsertId(23280f95d1ccaa1f).().toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 2755 | } |
| 2756 | } |
| 2757 | |
| 2758 | // Now we construct the SQL update query. |
| 2759 | auto proxy = account->networkProxycxx . . $ ServiceRoot#networkProxy(e4d242e7a984a99c).(); |
| 2760 | |
| 2761 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Accounts " |
| 2762 | "SET proxy_type = :proxy_type, proxy_host = :proxy_host, proxy_port = :proxy_port, " |
| 2763 | " proxy_username = :proxy_username, proxy_password = :proxy_password, ordr = :ordr, " |
| 2764 | " custom_data = :custom_data " |
| 2765 | "WHERE id = :id")); |
| 2766 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":proxy_type"), proxycxx . . $ QVariant#QVariant(f349c77f591a7878)..typecxx . . $ QNetworkProxy#type(d216d110afa77711).()); |
| 2767 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":proxy_host"), proxycxx . . $ QVariant#QVariant(132dd6869045752b)..hostNamecxx . . $ QNetworkProxy#hostName(6ef7b6c27b00b43d).()); |
| 2768 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":proxy_port"), proxycxx . . $ QVariant#QVariant(f349c77f591a7878)..portcxx . . $ QNetworkProxy#port(72085aa11f4b6e09).()); |
| 2769 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":proxy_username"), proxycxx . . $ QVariant#QVariant(132dd6869045752b)..usercxx . . $ QNetworkProxy#user(6ef7b6c27b00b43d).()); |
| 2770 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":proxy_password"), TextFactorycxx . . $ QVariant#QVariant(132dd6869045752b).::encryptcxx . . $ TextFactory#encrypt(8566f3882fd92083).(proxy.passwordcxx . . $ QNetworkProxy#password(6ef7b6c27b00b43d).())); |
| 2771 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), accountcxx . . $ QVariant#QVariant(f349c77f591a7878).->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 2772 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":ordr"), accountcxx . . $ QVariant#QVariant(f349c77f591a7878).->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).()); |
| 2773 | |
| 2774 | auto custom_data = account->customDatabaseDatacxx . . $ ServiceRoot#customDatabaseData(556033a494fe4eb9).(); |
| 2775 | QStringcxx . . $ QString# serialized_custom_data = serializeCustomDatacxx . . $ DatabaseQueries#serializeCustomData(f70f12fa894c0ae9).(custom_data); |
| 2776 | |
| 2777 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":custom_data"), serialized_custom_datacxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 2778 | |
| 2779 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2780 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2781 | } |
| 2782 | } |
| 2783 | |
| 2784 | bool DatabaseQueriescxx . . $ DatabaseQueries#::deleteFeedcxx . . $ DatabaseQueries#deleteFeed(4a9c113ffd7aaf62).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Feedcxx . . $ Feed#* feed, int account_id) { |
| 2785 | moveItemcxx . . $ DatabaseQueries#moveItem(f20a617a9b42979).(feed, false, true, {}, db); |
| 2786 | |
| 2787 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2788 | |
| 2789 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Messages WHERE feed = :feed AND account_id = :account_id;")); |
| 2790 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), feedcxx . . $ QVariant#QVariant(132dd6869045752b).->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).()); |
| 2791 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2792 | |
| 2793 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2794 | return false; |
| 2795 | } |
| 2796 | |
| 2797 | // Remove feed itself. |
| 2798 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Feeds WHERE custom_id = :feed AND account_id = :account_id;")); |
| 2799 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed"), feedcxx . . $ QVariant#QVariant(132dd6869045752b).->customIdcxx . . $ RootItem#customId(6ef7b6c27b00b43d).()); |
| 2800 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2801 | |
| 2802 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && purgeLeftoverMessageFilterAssignmentscxx . . $ DatabaseQueries#purgeLeftoverMessageFilterAssignments(d8032dc71cca56cc).(db, account_id); |
| 2803 | } |
| 2804 | |
| 2805 | bool DatabaseQueriescxx . . $ DatabaseQueries#::deleteCategorycxx . . $ DatabaseQueries#deleteCategory(653e423f3e14b97d).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, Categorycxx . . $ Category#* category) { |
| 2806 | moveItemcxx . . $ DatabaseQueries#moveItem(f20a617a9b42979).(category, false, true, {}, db); |
| 2807 | |
| 2808 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2809 | |
| 2810 | // Remove this category from database. |
| 2811 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2812 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM Categories WHERE id = :category;")); |
| 2813 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":category"), categorycxx . . $ QVariant#QVariant(f349c77f591a7878).->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 2814 | return q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).(); |
| 2815 | } |
| 2816 | |
| 2817 | void DatabaseQueriescxx . . $ DatabaseQueries#::moveItemcxx . . $ DatabaseQueries#moveItem(f20a617a9b42979).(RootItemcxx . . $ RootItem#* item, |
| 2818 | bool move_top, |
| 2819 | bool move_bottom, |
| 2820 | int move_index, |
| 2821 | const QSqlDatabasecxx . . $ QSqlDatabase#& db) { |
| 2822 | if (item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() != RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Feedcxx . . $ RootItem#Kind#Feed. && item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() != RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Categorycxx . . $ RootItem#Kind#Category. && |
| 2823 | item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() != RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::ServiceRootcxx . . $ RootItem#Kind#ServiceRoot.) { |
| 2824 | return; |
| 2825 | } |
| 2826 | |
| 2827 | auto neighbors = item->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).()->childItemscxx . . $ RootItem#childItems(f275a58a8bc5f139).(); |
| 2828 | int max_sort_order = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(neighbors) |
| 2829 | .selectcxx . . $ boolinq/Linq#select(a3f5bd4cd382e0ee).([=](RootItemcxx . . $ RootItem#* it) { |
| 2830 | return it->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() ? it->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() : 0; |
| 2831 | }) |
| 2832 | .maxcxx . . $ boolinq/Linq#max(7b7646ca7c721626).(); |
| 2833 | |
| 2834 | if ((!move_top && !move_bottom && item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() == move_index) || /* Item is already sorted OK. */ |
| 2835 | (!move_top && !move_bottom && |
| 2836 | move_index < 0) || /* Order cannot be smaller than 0 if we do not move to begin/end. */ |
| 2837 | (!move_top && !move_bottom && move_index > max_sort_order) || /* Cannot move past biggest sort order. */ |
| 2838 | (move_top && item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() == 0) || /* Item is already on top. */ |
| 2839 | (move_bottom && item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() == max_sort_order) || /* Item is already on bottom. */ |
| 2840 | max_sort_order <= 0) { /* We only have 1 item, nothing to sort. */ |
| 2841 | return; |
| 2842 | } |
| 2843 | |
| 2844 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2845 | |
| 2846 | if (move_top) { |
| 2847 | move_index = 0; |
| 2848 | } |
| 2849 | else if (move_bottom) { |
| 2850 | move_index = max_sort_order; |
| 2851 | } |
| 2852 | |
| 2853 | int move_low = qMincxx . . $ qMin(2a338fce5842aa6a).(move_index, item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).()); |
| 2854 | int move_high = qMaxcxx . . $ qMax(2a338fce5842aa6a).(move_index, item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).()); |
| 2855 | QStringcxx . . $ QString# parent_fieldcxx . . $ QString#QString(ced63f7c635d850d)., table_namecxx . . $ QString#QString(ced63f7c635d850d).; |
| 2856 | |
| 2857 | switch (item->kindcxx . . $ RootItem#kind(faa800885e6a64b).()) { |
| 2858 | case RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Feedcxx . . $ RootItem#Kind#Feed.: |
| 2859 | parent_field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("category"); |
| 2860 | table_name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Feeds"); |
| 2861 | break; |
| 2862 | |
| 2863 | case RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Categorycxx . . $ RootItem#Kind#Category.: |
| 2864 | parent_field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("parent_id"); |
| 2865 | table_name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Categories"); |
| 2866 | break; |
| 2867 | |
| 2868 | case RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::ServiceRootcxx . . $ RootItem#Kind#ServiceRoot.: |
| 2869 | table_name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Accounts"); |
| 2870 | break; |
| 2871 | } |
| 2872 | |
| 2873 | if (item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::ServiceRootcxx . . $ RootItem#Kind#ServiceRoot.) { |
| 2874 | if (item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() > move_index) { |
| 2875 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Accounts SET ordr = ordr + 1 " |
| 2876 | "WHERE ordr < :move_high AND ordr >= :move_low;")); |
| 2877 | } |
| 2878 | else { |
| 2879 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Accounts SET ordr = ordr - 1 " |
| 2880 | "WHERE ordr > :move_low AND ordr <= :move_high;")); |
| 2881 | } |
| 2882 | } |
| 2883 | else { |
| 2884 | if (item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() > move_index) { |
| 2885 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE %1 SET ordr = ordr + 1 " |
| 2886 | "WHERE account_id = :account_id AND %2 = :category AND ordr < :move_high AND ordr >= :move_low;") |
| 2887 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(table_name, parent_field)); |
| 2888 | } |
| 2889 | else { |
| 2890 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE %1 SET ordr = ordr - 1 " |
| 2891 | "WHERE account_id = :account_id AND %2 = :category AND ordr > :move_low AND ordr <= :move_high;") |
| 2892 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(table_name, parent_field)); |
| 2893 | } |
| 2894 | |
| 2895 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), itemcxx . . $ QVariant#QVariant(f349c77f591a7878).->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).()); |
| 2896 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":category"), itemcxx . . $ QVariant#QVariant(f349c77f591a7878).->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).()->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 2897 | } |
| 2898 | |
| 2899 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":move_low"), move_lowcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2900 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":move_high"), move_highcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2901 | |
| 2902 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2903 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2904 | } |
| 2905 | |
| 2906 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE %1 SET ordr = :ordr WHERE id = :id;").argcxx . . $ QString#arg(ad0bca07273edcc2).(table_name)); |
| 2907 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), |
| 2908 | itemcxx . . $ QVariant#QVariant(f349c77f591a7878).->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::ServiceRootcxx . . $ RootItem#Kind#ServiceRoot. ? item->toServiceRootcxx . . $ RootItem#toServiceRoot(56209a8cf0725652).()->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).() : item->idcxx . . $ RootItem#id(455f465bc33b4cdf).()); |
| 2909 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":ordr"), move_indexcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2910 | |
| 2911 | if (!q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2912 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2913 | } |
| 2914 | |
| 2915 | // Fix live sort orders. |
| 2916 | if (item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() > move_index) { |
| 2917 | boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(neighbors) |
| 2918 | .wherecxx . . $ boolinq/Linq#where(d169c8e6e9294137).([cxx . . $ std/function#function(bdc3712e480e4d04).=](RootItemcxx . . $ RootItem#* it) { |
| 2919 | return it->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() && it->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() < move_high && it->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() >= move_low; |
| 2920 | }) |
| 2921 | .for_eachcxx . . $ boolinq/Linq#for_each(66e864814bcd1933).([cxx . . $ std/function#function(bdc3712e480e4d04).](RootItemcxx . . $ RootItem#* it) { |
| 2922 | it->setSortOrdercxx . . $ RootItem#setSortOrder(d4f767463ce0a6b3).(it->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() + 1); |
| 2923 | }); |
| 2924 | } |
| 2925 | else { |
| 2926 | boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(neighbors) |
| 2927 | .wherecxx . . $ boolinq/Linq#where(d169c8e6e9294137).([cxx . . $ std/function#function(bdc3712e480e4d04).=](RootItemcxx . . $ RootItem#* it) { |
| 2928 | return it->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() && it->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() > move_low && it->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() <= move_high; |
| 2929 | }) |
| 2930 | .for_eachcxx . . $ boolinq/Linq#for_each(66e864814bcd1933).([cxx . . $ std/function#function(bdc3712e480e4d04).](RootItemcxx . . $ RootItem#* it) { |
| 2931 | it->setSortOrdercxx . . $ RootItem#setSortOrder(d4f767463ce0a6b3).(it->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() - 1); |
| 2932 | }); |
| 2933 | } |
| 2934 | |
| 2935 | item->setSortOrdercxx . . $ RootItem#setSortOrder(d4f767463ce0a6b3).(move_index); |
| 2936 | } |
| 2937 | |
| 2938 | MessageFiltercxx . . $ MessageFilter#* DatabaseQueriescxx . . $ DatabaseQueries#::addMessageFiltercxx . . $ DatabaseQueries#addMessageFilter(58cdf08db29a3c17).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, const QStringcxx . . $ QString#& title, const QStringcxx . . $ QString#& script) { |
| 2939 | if (!db.drivercxx . . $ QSqlDatabase#driver(3c5fc00b3abe3e44).()->hasFeaturecxx . . $ QSqlDriver#hasFeature(141b0b24df41aa3b).(QSqlDrivercxx . . $ QSqlDriver#::DriverFeaturecxx . . $ QSqlDriver#DriverFeature#::LastInsertIdcxx . . $ QSqlDriver#LastInsertId.)) { |
| 2940 | throw ApplicationExceptioncxx . . $ ApplicationException#(QObjectcxx . . $ QObject#::trcxx . . $ QObject#tr(75d9f1c324b4579d).("Cannot insert article filter, because current database cannot return last " |
| 2941 | "inserted row ID.")); |
| 2942 | } |
| 2943 | |
| 2944 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2945 | |
| 2946 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("INSERT INTO MessageFilters (name, script) VALUES(:name, :script);")); |
| 2947 | |
| 2948 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":name"), titlecxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 2949 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":script"), scriptcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 2950 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2951 | |
| 2952 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2953 | auto* fltr = new MessageFiltercxx . . $ MessageFilter#(q.lastInsertIdcxx . . $ QSqlQuery#lastInsertId(23280f95d1ccaa1f).().toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 2954 | |
| 2955 | fltr->setNamecxx . . $ MessageFilter#setName(3520e46b33348bf6).(title); |
| 2956 | fltr->setScriptcxx . . $ MessageFilter#setScript(3520e46b33348bf6).(script); |
| 2957 | |
| 2958 | return fltr; |
| 2959 | } |
| 2960 | else { |
| 2961 | throw ApplicationExceptioncxx . . $ ApplicationException#(q.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).()); |
| 2962 | } |
| 2963 | } |
| 2964 | |
| 2965 | void DatabaseQueriescxx . . $ DatabaseQueries#::removeMessageFiltercxx . . $ DatabaseQueries#removeMessageFilter(b11e5540158605bb).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int filter_id, bool* ok) { |
| 2966 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2967 | |
| 2968 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM MessageFilters WHERE id = :id;")); |
| 2969 | |
| 2970 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), filter_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2971 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2972 | |
| 2973 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2974 | if (ok != nullptr) { |
| 2975 | *ok = true; |
| 2976 | } |
| 2977 | } |
| 2978 | else { |
| 2979 | if (ok != nullptr) { |
| 2980 | *ok = false; |
| 2981 | } |
| 2982 | } |
| 2983 | } |
| 2984 | |
| 2985 | void DatabaseQueriescxx . . $ DatabaseQueries#::removeMessageFilterAssignmentscxx . . $ DatabaseQueries#removeMessageFilterAssignments(b11e5540158605bb).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int filter_id, bool* ok) { |
| 2986 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 2987 | |
| 2988 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM MessageFiltersInFeeds WHERE filter = :filter;")); |
| 2989 | |
| 2990 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":filter"), filter_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 2991 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 2992 | |
| 2993 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 2994 | if (ok != nullptr) { |
| 2995 | *ok = true; |
| 2996 | } |
| 2997 | } |
| 2998 | else { |
| 2999 | if (ok != nullptr) { |
| 3000 | *ok = false; |
| 3001 | } |
| 3002 | } |
| 3003 | } |
| 3004 | |
| 3005 | QListcxx . . $ QList#<MessageFiltercxx . . $ MessageFilter#*> DatabaseQueriescxx . . $ DatabaseQueries#::getMessageFilterscxx . . $ DatabaseQueries#getMessageFilters(ae8a430f6c112f3f).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, bool* ok) { |
| 3006 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 3007 | QListcxx . . $ QList#<MessageFiltercxx . . $ MessageFilter#*> filterscxx . . $ QList#QList(ced63f7c635d850d).; |
| 3008 | |
| 3009 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 3010 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT id, name, script FROM MessageFilters;")); |
| 3011 | |
| 3012 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 3013 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 3014 | auto* filter = new MessageFiltercxx . . $ MessageFilter#(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 3015 | |
| 3016 | filter->setNamecxx . . $ MessageFilter#setName(3520e46b33348bf6).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 3017 | filter->setScriptcxx . . $ MessageFilter#setScript(3520e46b33348bf6).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(2).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 3018 | |
| 3019 | filters.appendcxx . . $ QList#append(200d2dc08238a4ed).(filter); |
| 3020 | } |
| 3021 | |
| 3022 | if (ok != nullptr) { |
| 3023 | *ok = true; |
| 3024 | } |
| 3025 | } |
| 3026 | else { |
| 3027 | if (ok != nullptr) { |
| 3028 | *ok = false; |
| 3029 | } |
| 3030 | } |
| 3031 | |
| 3032 | return filters; |
| 3033 | } |
| 3034 | |
| 3035 | QMultiMapcxx . . $ QMultiMap#<QStringcxx . . $ QString#, int> DatabaseQueriescxx . . $ DatabaseQueries#::messageFiltersInFeedscxx . . $ DatabaseQueries#messageFiltersInFeeds(cab7983b3a3d945d).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id, bool* ok) { |
| 3036 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 3037 | QMultiMapcxx . . $ QMultiMap#<QStringcxx . . $ QString#, int> filters_in_feedscxx . . $ QMultiMap#QMultiMap(49f6e7a06ebc5aa8).; |
| 3038 | |
| 3039 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT filter, feed_custom_id FROM MessageFiltersInFeeds WHERE account_id = :account_id;")); |
| 3040 | |
| 3041 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 3042 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 3043 | |
| 3044 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 3045 | while (q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 3046 | filters_in_feeds.insertcxx . . $ QMultiMap#insert(907ebdbdc8b32ba9).(q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(1).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(), q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 3047 | } |
| 3048 | |
| 3049 | if (ok != nullptr) { |
| 3050 | *ok = true; |
| 3051 | } |
| 3052 | } |
| 3053 | else { |
| 3054 | if (ok != nullptr) { |
| 3055 | *ok = false; |
| 3056 | } |
| 3057 | } |
| 3058 | |
| 3059 | return filters_in_feeds; |
| 3060 | } |
| 3061 | |
| 3062 | void DatabaseQueriescxx . . $ DatabaseQueries#::assignMessageFilterToFeedcxx . . $ DatabaseQueries#assignMessageFilterToFeed(19619206800115f).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 3063 | const QStringcxx . . $ QString#& feed_custom_id, |
| 3064 | int filter_id, |
| 3065 | int account_id, |
| 3066 | bool* ok) { |
| 3067 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 3068 | |
| 3069 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT COUNT(*) FROM MessageFiltersInFeeds " |
| 3070 | "WHERE filter = :filter AND feed_custom_id = :feed_custom_id AND account_id = :account_id;")); |
| 3071 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 3072 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":filter"), filter_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 3073 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed_custom_id"), feed_custom_idcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 3074 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 3075 | |
| 3076 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() && q.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 3077 | auto already_included_count = q.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 3078 | |
| 3079 | if (already_included_count > 0) { |
| 3080 | if (ok != nullptr) { |
| 3081 | *ok = true; |
| 3082 | } |
| 3083 | |
| 3084 | return; |
| 3085 | } |
| 3086 | } |
| 3087 | |
| 3088 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("INSERT INTO MessageFiltersInFeeds (filter, feed_custom_id, account_id) " |
| 3089 | "VALUES(:filter, :feed_custom_id, :account_id);")); |
| 3090 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":filter"), filter_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 3091 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed_custom_id"), feed_custom_idcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 3092 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 3093 | |
| 3094 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 3095 | if (ok != nullptr) { |
| 3096 | *ok = true; |
| 3097 | } |
| 3098 | } |
| 3099 | else { |
| 3100 | if (ok != nullptr) { |
| 3101 | *ok = false; |
| 3102 | } |
| 3103 | } |
| 3104 | } |
| 3105 | |
| 3106 | void DatabaseQueriescxx . . $ DatabaseQueries#::updateMessageFiltercxx . . $ DatabaseQueries#updateMessageFilter(cba6822c46e2dce6).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, MessageFiltercxx . . $ MessageFilter#* filter, bool* ok) { |
| 3107 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 3108 | |
| 3109 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE MessageFilters SET name = :name, script = :script WHERE id = :id;")); |
| 3110 | |
| 3111 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":name"), filtercxx . . $ QVariant#QVariant(132dd6869045752b).->namecxx . . $ MessageFilter#name(6ef7b6c27b00b43d).()); |
| 3112 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":script"), filtercxx . . $ QVariant#QVariant(132dd6869045752b).->scriptcxx . . $ MessageFilter#script(6ef7b6c27b00b43d).()); |
| 3113 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), filtercxx . . $ QVariant#QVariant(f349c77f591a7878).->idcxx . . $ MessageFilter#id(455f465bc33b4cdf).()); |
| 3114 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 3115 | |
| 3116 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 3117 | if (ok != nullptr) { |
| 3118 | *ok = true; |
| 3119 | } |
| 3120 | } |
| 3121 | else { |
| 3122 | if (ok != nullptr) { |
| 3123 | *ok = false; |
| 3124 | } |
| 3125 | } |
| 3126 | } |
| 3127 | |
| 3128 | void DatabaseQueriescxx . . $ DatabaseQueries#::removeMessageFilterFromFeedcxx . . $ DatabaseQueries#removeMessageFilterFromFeed(19619206800115f).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, |
| 3129 | const QStringcxx . . $ QString#& feed_custom_id, |
| 3130 | int filter_id, |
| 3131 | int account_id, |
| 3132 | bool* ok) { |
| 3133 | QSqlQuerycxx . . $ QSqlQuery# qcxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 3134 | |
| 3135 | q.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("DELETE FROM MessageFiltersInFeeds " |
| 3136 | "WHERE filter = :filter AND feed_custom_id = :feed_custom_id AND account_id = :account_id;")); |
| 3137 | |
| 3138 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":filter"), filter_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 3139 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":feed_custom_id"), feed_custom_idcxx . . $ QVariant#QVariant(132dd6869045752b).); |
| 3140 | q.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 3141 | q.setForwardOnlycxx . . $ QSqlQuery#setForwardOnly(b45ddcbc8423892c).(true); |
| 3142 | |
| 3143 | if (q.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 3144 | if (ok != nullptr) { |
| 3145 | *ok = true; |
| 3146 | } |
| 3147 | } |
| 3148 | else { |
| 3149 | if (ok != nullptr) { |
| 3150 | *ok = false; |
| 3151 | } |
| 3152 | } |
| 3153 | } |
| 3154 | |
| 3155 | QStringListcxx . . $ QStringList# DatabaseQueriescxx . . $ DatabaseQueries#::getAllGmailRecipientscxx . . $ DatabaseQueries#getAllGmailRecipients(6f6438778336e77f).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, int account_id) { |
| 3156 | QSqlQuerycxx . . $ QSqlQuery# querycxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 3157 | QStringListcxx . . $ QStringList# reccxx . . $ QList#QList(ced63f7c635d850d).; |
| 3158 | |
| 3159 | query.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT DISTINCT author " |
| 3160 | "FROM Messages " |
| 3161 | "WHERE account_id = :account_id AND author IS NOT NULL AND author != '' " |
| 3162 | "ORDER BY lower(author) ASC;")); |
| 3163 | query.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":account_id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 3164 | |
| 3165 | if (query.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 3166 | while (query.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 3167 | rec.appendcxx . . $ QList#append(1262c8661f7a27a7).(query.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 3168 | } |
| 3169 | } |
| 3170 | else { |
| 3171 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_GMAILcxx . . $ `src/librssguard/definitions/definitions.h:185:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Query for all recipients failed: '" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). query.lastErrorcxx . . $ QSqlQuery#lastError(b02d9d6c0f4da678).().textcxx . . $ QSqlError#text(6ef7b6c27b00b43d).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "'."; |
| 3172 | } |
| 3173 | |
| 3174 | return rec; |
| 3175 | } |
| 3176 | |
| 3177 | bool DatabaseQueriescxx . . $ DatabaseQueries#::storeNewOauthTokenscxx . . $ DatabaseQueries#storeNewOauthTokens(d8cc73b7bcce6121).(const QSqlDatabasecxx . . $ QSqlDatabase#& db, const QStringcxx . . $ QString#& refresh_token, int account_id) { |
| 3178 | QSqlQuerycxx . . $ QSqlQuery# querycxx . . $ QSqlQuery#QSqlQuery(b3df2939303ae7a3).(db); |
| 3179 | |
| 3180 | query.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("SELECT custom_data FROM Accounts WHERE id = :id;")); |
| 3181 | query.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 3182 | |
| 3183 | if (!query.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).() || !query.nextcxx . . $ QSqlQuery#next(c9857a73d68e59ba).()) { |
| 3184 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_OAUTHcxx . . $ `src/librssguard/definitions/definitions.h:186:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Cannot fetch custom data column for storing of OAuth tokens, because of error:" |
| 3185 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(query.lastError().text()); |
| 3186 | return false; |
| 3187 | } |
| 3188 | |
| 3189 | QVariantHashcxx . . $ QVariantHash# custom_data = deserializeCustomDatacxx . . $ DatabaseQueries#deserializeCustomData(6be01bf7236fd155).(query.valuecxx . . $ QSqlQuery#value(fb36142a814bbf95).(0).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).()); |
| 3190 | |
| 3191 | custom_data[cxx . . $ QHash#`operator[]`(bbd415b616967878).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("refresh_token")] =cxx . . $ QVariant#`operator=`(79a68221451e88b7). refresh_tokencxx . . $ QVariant#QVariant(132dd6869045752b).; |
| 3192 | |
| 3193 | query.clearcxx . . $ QSqlQuery#clear(49f6e7a06ebc5aa8).(); |
| 3194 | query.preparecxx . . $ QSqlQuery#prepare(e1defb592416720d).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("UPDATE Accounts SET custom_data = :custom_data WHERE id = :id;")); |
| 3195 | query.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":custom_data"), serializeCustomDatacxx . . $ QVariant#QVariant(132dd6869045752b).(custom_data)); |
| 3196 | query.bindValuecxx . . $ QSqlQuery#bindValue(45793ecdf640d4c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":id"), account_idcxx . . $ QVariant#QVariant(f349c77f591a7878).); |
| 3197 | |
| 3198 | if (!query.execcxx . . $ QSqlQuery#exec(c9857a73d68e59ba).()) { |
| 3199 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_OAUTHcxx . . $ `src/librssguard/definitions/definitions.h:186:9`! |
| 3200 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Cannot store OAuth tokens, because of error:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(query.lastError().text()); |
| 3201 | return false; |
| 3202 | } |
| 3203 | else { |
| 3204 | return true; |
| 3205 | } |
| 3206 | } |
| 3207 | |
| 3208 | QStringcxx . . $ QString# DatabaseQueriescxx . . $ DatabaseQueries#::unnulifyStringcxx . . $ DatabaseQueries#unnulifyString(fd988a2ab94d906b).(const QStringcxx . . $ QString#& str) { |
| 3209 | return str.isNullcxx . . $ QString#isNull(50ce9a9e25b4a850).() ? QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("") : strcxx . . $ QString#QString(132dd6869045752b).; |
| 3210 | } |