| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/core/feedsproxymodel.cpp`/ |
| 2 | |
| 3 | #include "core/feedsproxymodel.h"cxx . . $ `<file>/src/librssguard/core/feedsproxymodel.h`/ |
| 4 | |
| 5 | #include "core/feedsmodel.h"cxx . . $ `<file>/src/librssguard/core/feedsmodel.h`/ |
| 6 | #include "database/databasequeries.h"cxx . . $ `<file>/src/librssguard/database/databasequeries.h`/ |
| 7 | #include "definitions/definitions.h"cxx . . $ `<file>/src/librssguard/definitions/definitions.h`/ |
| 8 | #include "definitions/globals.h"cxx . . $ `<file>/src/librssguard/definitions/globals.h`/ |
| 9 | #include "gui/feedsview.h"cxx . . $ `<file>/src/librssguard/gui/feedsview.h`/ |
| 10 | #include "miscellaneous/application.h"cxx . . $ `<file>/src/librssguard/miscellaneous/application.h`/ |
| 11 | #include "miscellaneous/regexfactory.h"cxx . . $ `<file>/src/librssguard/miscellaneous/regexfactory.h`/ |
| 12 | #include "miscellaneous/settings.h"cxx . . $ `<file>/src/librssguard/miscellaneous/settings.h`/ |
| 13 | #include "services/abstract/rootitem.h"cxx . . $ `<file>/src/librssguard/services/abstract/rootitem.h`/ |
| 14 | |
| 15 | #include <QMimeData> |
| 16 | #include <QTimer> |
| 17 | |
| 18 | using RootItemPtrcxx . . $ RootItemPtr# = RootItemcxx . . $ RootItem#*; |
| 19 | |
| 20 | FeedsProxyModelcxx . . $ FeedsProxyModel#::FeedsProxyModelcxx . . $ FeedsProxyModel#FeedsProxyModel(b3533afc652abc62).(FeedsModelcxx . . $ FeedsModel#* source_model, QObjectcxx . . $ QObject#* parent) |
| 21 | : QSortFilterProxyModelcxx . . $ QSortFilterProxyModel#(parent), m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.(source_model), m_viewcxx . . $ FeedsProxyModel#m_view.(nullptr), m_selectedItemcxx . . $ FeedsProxyModel#m_selectedItem.(nullptr), |
| 22 | m_sortAlphabeticallycxx . . $ FeedsProxyModel#m_sortAlphabetically.(false), m_filtercxx . . $ FeedsProxyModel#m_filter.(FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter#::NoFilteringcxx . . $ FeedsProxyModel#FeedListFilter#NoFiltering.) { |
| 23 | setObjectNamecxx . . $ QObject#setObjectName(3520e46b33348bf6).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("FeedsProxyModel")); |
| 24 | |
| 25 | initializeFilterscxx . . $ FeedsProxyModel#initializeFilters(49f6e7a06ebc5aa8).(); |
| 26 | |
| 27 | setSortRolecxx . . $ QSortFilterProxyModel#setSortRole(d4f767463ce0a6b3).(Qtcxx . . $ Qt/::ItemDataRolecxx . . $ Qt/ItemDataRole#::EditRolecxx . . $ Qt/EditRole.); |
| 28 | setSortCaseSensitivitycxx . . $ QSortFilterProxyModel#setSortCaseSensitivity(dbd87adfa24451df).(Qtcxx . . $ Qt/::CaseSensitivitycxx . . $ Qt/CaseSensitivity#::CaseInsensitivecxx . . $ Qt/CaseInsensitive.); |
| 29 | setRecursiveFilteringEnabledcxx . . $ QSortFilterProxyModel#setRecursiveFilteringEnabled(b45ddcbc8423892c).(true); |
| 30 | setFilterKeyColumncxx . . $ QSortFilterProxyModel#setFilterKeyColumn(d4f767463ce0a6b3).(FDS_MODEL_TITLE_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:339:9`!); |
| 31 | setFilterRolecxx . . $ QSortFilterProxyModel#setFilterRole(d4f767463ce0a6b3).(Qtcxx . . $ Qt/::ItemDataRolecxx . . $ Qt/ItemDataRole#::EditRolecxx . . $ Qt/EditRole.); |
| 32 | setDynamicSortFiltercxx . . $ QSortFilterProxyModel#setDynamicSortFilter(b45ddcbc8423892c).(true); |
| 33 | setSourceModelcxx . . $ QSortFilterProxyModel#setSourceModel(c6e1f1e42522b780).(m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.); |
| 34 | |
| 35 | // Describes priorities of node types for sorting. |
| 36 | // Smaller index means that item is "smaller" which |
| 37 | // means it should be more on top when sorting |
| 38 | // in ascending order. |
| 39 | m_prioritiescxx . . $ FeedsProxyModel#m_priorities. =cxx . . $ QList#`operator=`(f67483249d2fd4fc). {RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Categorycxx . . $ RootItem#Kind#Category., |
| 40 | RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Feedcxx . . $ RootItem#Kind#Feed., |
| 41 | RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Labelscxx . . $ RootItem#Kind#Labels., |
| 42 | RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Probescxx . . $ RootItem#Kind#Probes., |
| 43 | RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Importantcxx . . $ RootItem#Kind#Important., |
| 44 | RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Unreadcxx . . $ RootItem#Kind#Unread., |
| 45 | RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Bincxx . . $ RootItem#Kind#Bin.}; |
| 46 | } |
| 47 | |
| 48 | FeedsProxyModelcxx . . $ FeedsProxyModel#::~cxx . . $ FeedsProxyModel#`~FeedsProxyModel`(ced63f7c635d850d).FeedsProxyModelcxx . . $ FeedsProxyModel#() { |
| 49 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_FEEDMODELcxx . . $ `src/librssguard/definitions/definitions.h:170:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Destroying FeedsProxyModel instance"; |
| 50 | } |
| 51 | |
| 52 | QModelIndexListcxx . . $ QModelIndexList# FeedsProxyModelcxx . . $ FeedsProxyModel#::matchcxx . . $ FeedsProxyModel#match(b09c7f237809a9e2).(const QModelIndexcxx . . $ QModelIndex#& start, |
| 53 | int role, |
| 54 | const QVariantcxx . . $ QVariant#& value, |
| 55 | int hits, |
| 56 | Qtcxx . . $ Qt/::MatchFlagscxx . . $ Qt/MatchFlags# flags) const { |
| 57 | QModelIndexListcxx . . $ QModelIndexList# resultcxx . . $ QList#QList(ced63f7c635d850d).; |
| 58 | const int match_type = flags &cxx . . $ QFlags#`operator&`(dc38392ed707d4f). 0x0F; |
| 59 | const Qtcxx . . $ Qt/::CaseSensitivitycxx . . $ Qt/CaseSensitivity# cs = Qtcxx . . $ Qt/::CaseSensitivitycxx . . $ Qt/CaseSensitivity#::CaseInsensitivecxx . . $ Qt/CaseInsensitive.; |
| 60 | const bool recurse = Globalscxx . . $ Globals#::hasFlagcxx . . $ Globals#hasFlag(e81494ae8084f6ba).(flags, Qtcxx . . $ Qt/::MatchFlagcxx . . $ Qt/MatchFlag#::MatchRecursivecxx . . $ Qt/MatchRecursive.); |
| 61 | const bool wrap = Globalscxx . . $ Globals#::hasFlagcxx . . $ Globals#hasFlag(e81494ae8084f6ba).(flags, Qtcxx . . $ Qt/::MatchFlagcxx . . $ Qt/MatchFlag#::MatchWrapcxx . . $ Qt/MatchWrap.); |
| 62 | const bool all_hits = (hits == -1); |
| 63 | QStringcxx . . $ QString# entered_textcxx . . $ QString#QString(ced63f7c635d850d).; |
| 64 | const QModelIndexcxx . . $ QModelIndex# p = parentcxx . . $ QSortFilterProxyModel#parent(f800c6f2fa4cbe57).(start); |
| 65 | int from = start.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).(); |
| 66 | int to = rowCountcxx . . $ QSortFilterProxyModel#rowCount(e3878d4d6cd9529c).(p); |
| 67 | |
| 68 | for (int i = 0; (wrap && i < 2) || (!wrap && i < 1); ++i) { |
| 69 | for (int r = from; (r < to) && (all_hits || result.countcxx . . $ QList#count(6b0412d51016192f).() < hits); ++r) { |
| 70 | QModelIndexcxx . . $ QModelIndex# idx = indexcxx . . $ QSortFilterProxyModel#index(37dbccf64c4e392).(r, start.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).(), p); |
| 71 | |
| 72 | if (!idx.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) { |
| 73 | continue; |
| 74 | } |
| 75 | |
| 76 | QModelIndexcxx . . $ QModelIndex# mapped_idx = mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(idx); |
| 77 | QVariantcxx . . $ QVariant# item_value = m_sourceModelcxx . . $ QVariant#QVariant(132dd6869045752b).->itemForIndexcxx . . $ FeedsModel#itemForIndex(8787ab140507818d).(mapped_idx)->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).(); |
| 78 | |
| 79 | // QVariant based matching. |
| 80 | if (match_type == Qtcxx . . $ Qt/::MatchFlagcxx . . $ Qt/MatchFlag#::MatchExactlycxx . . $ Qt/MatchExactly.) { |
| 81 | if (value ==cxx . . $ `operator==`(55b3085064498b6d). item_value) { |
| 82 | result.appendcxx . . $ QList#append(200d2dc08238a4ed).(idx); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | // QString based matching. |
| 87 | else { |
| 88 | if (entered_text.isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 89 | entered_text =cxx . . $ QString#`operator=`(4f35bf974e7f8568). value.toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 90 | } |
| 91 | |
| 92 | QStringcxx . . $ QString# item_text = item_value.toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 93 | |
| 94 | switch (match_type) { |
| 95 | #if QT_VERSIONcxx . . $ `<external>/3898848398875472725/qtversionchecks.h:17:9`! >= 0x050F00 // Qt >= 5.15.0 |
| 96 | case Qtcxx . . $ Qt/::MatchFlagcxx . . $ Qt/MatchFlag#::MatchRegularExpressioncxx . . $ Qt/MatchRegularExpression.: |
| 97 | #else |
| 98 | case Qt::MatchFlag::MatchRegExp: |
| 99 | #endif |
| 100 | if (QRegularExpressioncxx . . $ QRegularExpression#QRegularExpression(4279d2539df7cd4a).(entered_text, |
| 101 | QRegularExpressioncxx . . $ QRegularExpression#::PatternOptioncxx . . $ QRegularExpression#PatternOption#::CaseInsensitiveOptioncxx . . $ QRegularExpression#CaseInsensitiveOption. |cxx . . $ `operator|`(30291fd90490ac3). |
| 102 | QRegularExpressioncxx . . $ QRegularExpression#::PatternOptioncxx . . $ QRegularExpression#PatternOption#::UseUnicodePropertiesOptioncxx . . $ QRegularExpression#UseUnicodePropertiesOption.) |
| 103 | .matchcxx . . $ QRegularExpression#match(d076266091fa4922).(item_text) |
| 104 | .hasMatchcxx . . $ QRegularExpressionMatch#hasMatch(50ce9a9e25b4a850).()) { |
| 105 | result.appendcxx . . $ QList#append(200d2dc08238a4ed).(idx); |
| 106 | } |
| 107 | |
| 108 | break; |
| 109 | |
| 110 | case Qtcxx . . $ Qt/::MatchFlagcxx . . $ Qt/MatchFlag#::MatchWildcardcxx . . $ Qt/MatchWildcard.: |
| 111 | if (QRegularExpressioncxx . . $ QRegularExpression#QRegularExpression(4279d2539df7cd4a).(RegexFactorycxx . . $ RegexFactory#::wildcardToRegularExpressioncxx . . $ RegexFactory#wildcardToRegularExpression(fd988a2ab94d906b).(entered_text), |
| 112 | QRegularExpressioncxx . . $ QRegularExpression#::PatternOptioncxx . . $ QRegularExpression#PatternOption#::CaseInsensitiveOptioncxx . . $ QRegularExpression#CaseInsensitiveOption. |cxx . . $ `operator|`(30291fd90490ac3). |
| 113 | QRegularExpressioncxx . . $ QRegularExpression#::PatternOptioncxx . . $ QRegularExpression#PatternOption#::UseUnicodePropertiesOptioncxx . . $ QRegularExpression#UseUnicodePropertiesOption.) |
| 114 | .matchcxx . . $ QRegularExpression#match(d076266091fa4922).(item_text) |
| 115 | .hasMatchcxx . . $ QRegularExpressionMatch#hasMatch(50ce9a9e25b4a850).()) { |
| 116 | result.appendcxx . . $ QList#append(200d2dc08238a4ed).(idx); |
| 117 | } |
| 118 | |
| 119 | break; |
| 120 | |
| 121 | case Qtcxx . . $ Qt/::MatchFlagcxx . . $ Qt/MatchFlag#::MatchStartsWithcxx . . $ Qt/MatchStartsWith.: |
| 122 | if (item_text.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(entered_text, cs)) { |
| 123 | result.appendcxx . . $ QList#append(200d2dc08238a4ed).(idx); |
| 124 | } |
| 125 | |
| 126 | break; |
| 127 | |
| 128 | case Qtcxx . . $ Qt/::MatchFlagcxx . . $ Qt/MatchFlag#::MatchEndsWithcxx . . $ Qt/MatchEndsWith.: |
| 129 | if (item_text.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(entered_text, cs)) { |
| 130 | result.appendcxx . . $ QList#append(200d2dc08238a4ed).(idx); |
| 131 | } |
| 132 | |
| 133 | break; |
| 134 | |
| 135 | case Qtcxx . . $ Qt/::MatchFlagcxx . . $ Qt/MatchFlag#::MatchFixedStringcxx . . $ Qt/MatchFixedString.: |
| 136 | if (item_text.comparecxx . . $ QString#compare(c6f75f9b1a93e019).(entered_text, cs) == 0) { |
| 137 | result.appendcxx . . $ QList#append(200d2dc08238a4ed).(idx); |
| 138 | } |
| 139 | |
| 140 | break; |
| 141 | |
| 142 | case Qtcxx . . $ Qt/::MatchFlagcxx . . $ Qt/MatchFlag#::MatchContainscxx . . $ Qt/MatchContains.: |
| 143 | default: |
| 144 | if (item_text.containscxx . . $ QString#contains(8cce4688c16f48f3).(entered_text, cs)) { |
| 145 | result.appendcxx . . $ QList#append(200d2dc08238a4ed).(idx); |
| 146 | } |
| 147 | |
| 148 | break; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | if (recurse && hasChildrencxx . . $ QSortFilterProxyModel#hasChildren(b4ec4506a4420b60).(idx)) { |
| 153 | result +=cxx . . $ QList#`operator+=`(15ec5f0e45a4f6d6). matchcxx . . $ FeedsProxyModel#match(b09c7f237809a9e2).(indexcxx . . $ QSortFilterProxyModel#index(37dbccf64c4e392).(0, idx.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).(), idx), |
| 154 | role, |
| 155 | (entered_text.isEmptycxx . . $ QString#isEmpty(3482b152b9333168).() ? valuecxx . . $ QVariant#QVariant(244511558b20107a). : entered_textcxx . . $ QVariant#QVariant(132dd6869045752b).), |
| 156 | (all_hits ? -1 : hits - result.countcxx . . $ QList#count(6b0412d51016192f).()), |
| 157 | flags); |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | from = 0; |
| 162 | to = start.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).(); |
| 163 | } |
| 164 | |
| 165 | return result; |
| 166 | } |
| 167 | |
| 168 | bool FeedsProxyModelcxx . . $ FeedsProxyModel#::canDropMimeDatacxx . . $ FeedsProxyModel#canDropMimeData(b100e2dbbc763d6).(const QMimeDatacxx . . $ QMimeData#* data, |
| 169 | Qtcxx . . $ Qt/::DropActioncxx . . $ Qt/DropAction# action, |
| 170 | int row, |
| 171 | int column, |
| 172 | const QModelIndexcxx . . $ QModelIndex#& parent) const { |
| 173 | if (action != Qtcxx . . $ Qt/::DropActioncxx . . $ Qt/DropAction#::MoveActioncxx . . $ Qt/MoveAction.) { |
| 174 | return false; |
| 175 | } |
| 176 | |
| 177 | QByteArraycxx . . $ QByteArray# dragged_items_data = data->datacxx . . $ QMimeData#data(e72629479c734b12).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(MIME_TYPE_ITEM_POINTERcxx . . $ `src/librssguard/definitions/definitions.h:95:9`!)); |
| 178 | QDataStreamcxx . . $ QDataStream# streamcxx . . $ QDataStream#QDataStream(3fbd98f63ed0505e).(&dragged_items_data, QIODevicecxx . . $ QFlags#QFlags(93d577a3e9528307).::OpenModeFlagcxx . . $ QIODeviceBase#OpenModeFlag#::ReadOnlycxx . . $ QIODeviceBase#ReadOnly.); |
| 179 | const bool order_change = row >= 0 && !m_sortAlphabeticallycxx . . $ FeedsProxyModel#m_sortAlphabetically.; |
| 180 | const QModelIndexcxx . . $ QModelIndex# target_parent = mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(parent); |
| 181 | |
| 182 | if (stream.atEndcxx . . $ QDataStream#atEnd(50ce9a9e25b4a850).()) { |
| 183 | return false; |
| 184 | } |
| 185 | |
| 186 | quintptrcxx . . $ quintptr# pointer_to_item; |
| 187 | stream >>cxx . . $ QDataStream#`operator>>`(eb6a2cc2f61c38e7). pointer_to_item; |
| 188 | |
| 189 | RootItemcxx . . $ RootItem#* dragged_item = RootItemPtrcxx . . $ RootItemPtr#(pointer_to_item); |
| 190 | |
| 191 | // Dragged item must service root, feed or category. |
| 192 | // |
| 193 | // If row is less than zero, it means we are moving dragged item into new parent. If row is at least |
| 194 | // zero, then we are sorting the dragged item. |
| 195 | // |
| 196 | // Otherwise the target row identifies the item just below the drop target placement insertion line. |
| 197 | QModelIndexcxx . . $ QModelIndex# target_idx = order_change ? mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(indexcxx . . $ QSortFilterProxyModel#index(37dbccf64c4e392).(row, 0, parent)) : target_parent; |
| 198 | RootItemcxx . . $ RootItem#* target_item = m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.->itemForIndexcxx . . $ FeedsModel#itemForIndex(8787ab140507818d).(target_idx); |
| 199 | RootItemcxx . . $ RootItem#* target_parent_item = m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.->itemForIndexcxx . . $ FeedsModel#itemForIndex(8787ab140507818d).(target_parent); |
| 200 | |
| 201 | if (target_item != nullptr) { |
| 202 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_FEEDMODELcxx . . $ `src/librssguard/definitions/definitions.h:170:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Considering target for drop operation:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(target_item->title()) |
| 203 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "with index" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(target_idx) |
| 204 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "and target parent:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(target_parent_item->title()); |
| 205 | |
| 206 | switch (dragged_item->kindcxx . . $ RootItem#kind(faa800885e6a64b).()) { |
| 207 | case RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Feedcxx . . $ RootItem#Kind#Feed.: |
| 208 | case RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Categorycxx . . $ RootItem#Kind#Category.: |
| 209 | // Feeds can be reordered or inserted under service root or category. |
| 210 | // Categories can be reordered or inserted under service root or another category. |
| 211 | return target_parent_item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Categorycxx . . $ RootItem#Kind#Category. || |
| 212 | target_parent_item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::ServiceRootcxx . . $ RootItem#Kind#ServiceRoot.; |
| 213 | |
| 214 | case RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::ServiceRootcxx . . $ RootItem#Kind#ServiceRoot.: |
| 215 | // Service root cannot be inserted under different parent, can only be reordered. |
| 216 | if (!order_change) { |
| 217 | return false; |
| 218 | } |
| 219 | else { |
| 220 | return target_parent_item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Rootcxx . . $ RootItem#Kind#Root.; |
| 221 | } |
| 222 | |
| 223 | default: |
| 224 | break; |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | return false; |
| 229 | } |
| 230 | |
| 231 | bool FeedsProxyModelcxx . . $ FeedsProxyModel#::dropMimeDatacxx . . $ FeedsProxyModel#dropMimeData(31b49f559b1ac94).(const QMimeDatacxx . . $ QMimeData#* data, |
| 232 | Qtcxx . . $ Qt/::DropActioncxx . . $ Qt/DropAction# action, |
| 233 | int row, |
| 234 | int column, |
| 235 | const QModelIndexcxx . . $ QModelIndex#& parent) { |
| 236 | Q_UNUSEDcxx . . $ `<external>/17563275351362271547/qtpreprocessorsupport.h:20:9`!(column) |
| 237 | |
| 238 | if (action == Qtcxx . . $ Qt/::DropActioncxx . . $ Qt/DropAction#::IgnoreActioncxx . . $ Qt/IgnoreAction.) { |
| 239 | return true; |
| 240 | } |
| 241 | else if (action != Qtcxx . . $ Qt/::DropActioncxx . . $ Qt/DropAction#::MoveActioncxx . . $ Qt/MoveAction.) { |
| 242 | return false; |
| 243 | } |
| 244 | |
| 245 | QByteArraycxx . . $ QByteArray# dragged_items_data = data->datacxx . . $ QMimeData#data(e72629479c734b12).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(MIME_TYPE_ITEM_POINTERcxx . . $ `src/librssguard/definitions/definitions.h:95:9`!)); |
| 246 | |
| 247 | if (dragged_items_data.isEmptycxx . . $ QByteArray#isEmpty(3482b152b9333168).()) { |
| 248 | return false; |
| 249 | } |
| 250 | else { |
| 251 | QDataStreamcxx . . $ QDataStream# streamcxx . . $ QDataStream#QDataStream(3fbd98f63ed0505e).(&dragged_items_data, QIODevicecxx . . $ QFlags#QFlags(93d577a3e9528307).::OpenModeFlagcxx . . $ QIODeviceBase#OpenModeFlag#::ReadOnlycxx . . $ QIODeviceBase#ReadOnly.); |
| 252 | const bool order_change = row >= 0 && !m_sortAlphabeticallycxx . . $ FeedsProxyModel#m_sortAlphabetically.; |
| 253 | const QModelIndexcxx . . $ QModelIndex# source_parent = mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(parent); |
| 254 | |
| 255 | while (!stream.atEndcxx . . $ QDataStream#atEnd(50ce9a9e25b4a850).()) { |
| 256 | quintptrcxx . . $ quintptr# pointer_to_item; |
| 257 | stream >>cxx . . $ QDataStream#`operator>>`(eb6a2cc2f61c38e7). pointer_to_item; |
| 258 | |
| 259 | // We have item we want to drag, we also determine the target item. |
| 260 | RootItemPtrcxx . . $ RootItemPtr# dragged_item = RootItemPtrcxx . . $ RootItemPtr#(pointer_to_item); |
| 261 | RootItemcxx . . $ RootItem#* target_item = m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.->itemForIndexcxx . . $ FeedsModel#itemForIndex(8787ab140507818d).(source_parent); |
| 262 | ServiceRootcxx . . $ ServiceRoot#* dragged_item_root = dragged_item->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).(); |
| 263 | ServiceRootcxx . . $ ServiceRoot#* target_item_root = target_item->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).(); |
| 264 | |
| 265 | if ((dragged_item == target_item || dragged_item->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).() == target_item) && !order_change) { |
| 266 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_FEEDMODELcxx . . $ `src/librssguard/definitions/definitions.h:170:9`! |
| 267 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Dragged item is equal to target item or its parent is equal to target item. Cancelling drag-drop " |
| 268 | "action."; |
| 269 | return false; |
| 270 | } |
| 271 | |
| 272 | if (dragged_item_root != target_item_root) { |
| 273 | // Transferring of items between different accounts is not possible. |
| 274 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->showGuiMessagecxx . . $ Application#showGuiMessage(cf433640a87c3b52).(Notificationcxx . . $ Notification#::Eventcxx . . $ Notification#Event#::GeneralEventcxx . . $ Notification#Event#GeneralEvent., |
| 275 | {cxx . . $ GuiMessage#GuiMessage(b833bfd374dccacd).trcxx . . $ FeedsProxyModel#tr(75d9f1c324b4579d).("Cannot perform drag & drop operation"), |
| 276 | trcxx . . $ FeedsProxyModel#tr(75d9f1c324b4579d).("You can't transfer dragged item into different account, this is not supported."), |
| 277 | QSystemTrayIconcxx . . $ QSystemTrayIcon#::MessageIconcxx . . $ QSystemTrayIcon#MessageIcon#::Criticalcxx . . $ QSystemTrayIcon#Critical.}); |
| 278 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_FEEDMODELcxx . . $ `src/librssguard/definitions/definitions.h:170:9`! |
| 279 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Dragged item cannot be dragged into different account. Cancelling drag-drop action."; |
| 280 | return false; |
| 281 | } |
| 282 | |
| 283 | if (dragged_item != target_item && dragged_item->parentcxx . . $ RootItem#parent(e4f4b13bf6686a09).() != target_item && |
| 284 | dragged_item->performDragDropChangecxx . . $ RootItem#performDragDropChange(424ed8b026878aba).(target_item)) { |
| 285 | // Drag & drop is supported by the dragged item and was |
| 286 | // completed on data level and in item hierarchy. |
| 287 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! requireItemValidationAfterDragDropcxx . . $ FeedsProxyModel#requireItemValidationAfterDragDrop(87a6de385263c395).(m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.->indexForItemcxx . . $ FeedsModel#indexForItem(c0d6ccdcbdf61811).(dragged_item)); |
| 288 | |
| 289 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_FEEDMODELcxx . . $ `src/librssguard/definitions/definitions.h:170:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Dropping item" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(dragged_item->title()) <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "under new parent" |
| 290 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(target_item->title()); |
| 291 | } |
| 292 | |
| 293 | if (order_change) { |
| 294 | auto db = qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->databasecxx . . $ Application#database(4a253a6ca99872d8).()->drivercxx . . $ DatabaseFactory#driver(5299be7c9afd522d).()->connectioncxx . . $ DatabaseDriver#connection(32d6d64cc6e35a97).(metaObjectcxx . . $ QString#QString(85c52e162fed56f9).()->classNamecxx . . $ QMetaObject#className(a9f41ea0e82d88cf).()); |
| 295 | RootItemcxx . . $ RootItem#* place_above_item = m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.->itemForIndexcxx . . $ FeedsModel#itemForIndex(8787ab140507818d).(mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(indexcxx . . $ QSortFilterProxyModel#index(37dbccf64c4e392).(row, 0, parent))); |
| 296 | int target_sort_order = place_above_item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).(); |
| 297 | |
| 298 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_FEEDMODELcxx . . $ `src/librssguard/definitions/definitions.h:170:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Resorting/placing item" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(dragged_item->title()) |
| 299 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "with sord order" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(dragged_item->sortOrder()) <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "above item" |
| 300 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(place_above_item->title()) <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "with new sort order" |
| 301 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(target_sort_order); |
| 302 | |
| 303 | if (target_sort_order > dragged_item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).()) { |
| 304 | target_sort_order--; |
| 305 | } |
| 306 | |
| 307 | DatabaseQueriescxx . . $ DatabaseQueries#::moveItemcxx . . $ DatabaseQueries#moveItem(f20a617a9b42979).(dragged_item, false, false, target_sort_order, db); |
| 308 | } |
| 309 | |
| 310 | invalidatecxx . . $ QSortFilterProxyModel#invalidate(49f6e7a06ebc5aa8).(); |
| 311 | } |
| 312 | |
| 313 | return true; |
| 314 | } |
| 315 | |
| 316 | return false; |
| 317 | } |
| 318 | |
| 319 | bool FeedsProxyModelcxx . . $ FeedsProxyModel#::lessThancxx . . $ FeedsProxyModel#lessThan(38842d0605fc2db).(const QModelIndexcxx . . $ QModelIndex#& left, const QModelIndexcxx . . $ QModelIndex#& right) const { |
| 320 | if (left.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).() && right.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) { |
| 321 | // Make necessary castings. |
| 322 | const RootItemcxx . . $ RootItem#* left_item = m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.->itemForIndexcxx . . $ FeedsModel#itemForIndex(8787ab140507818d).(left); |
| 323 | const RootItemcxx . . $ RootItem#* right_item = m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.->itemForIndexcxx . . $ FeedsModel#itemForIndex(8787ab140507818d).(right); |
| 324 | |
| 325 | // NOTE: Here we want to accomplish that ALL |
| 326 | // categories are queued one after another and all |
| 327 | // feeds are queued one after another too. |
| 328 | // Moreover, sort everything alphabetically or |
| 329 | // by item counts, depending on the sort column. |
| 330 | if (left_item->keepOnTopcxx . . $ RootItem#keepOnTop(50ce9a9e25b4a850).()) { |
| 331 | return sortOrdercxx . . $ QSortFilterProxyModel#sortOrder(3d035b40950d32d6).() == Qtcxx . . $ Qt/::SortOrdercxx . . $ Qt/SortOrder#::AscendingOrdercxx . . $ Qt/AscendingOrder.; |
| 332 | } |
| 333 | else if (right_item->keepOnTopcxx . . $ RootItem#keepOnTop(50ce9a9e25b4a850).()) { |
| 334 | return sortOrdercxx . . $ QSortFilterProxyModel#sortOrder(3d035b40950d32d6).() == Qtcxx . . $ Qt/::SortOrdercxx . . $ Qt/SortOrder#::DescendingOrdercxx . . $ Qt/DescendingOrder.; |
| 335 | } |
| 336 | else if (left_item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == right_item->kindcxx . . $ RootItem#kind(faa800885e6a64b).()) { |
| 337 | if (m_sortAlphabeticallycxx . . $ FeedsProxyModel#m_sortAlphabetically.) { |
| 338 | // Both items are of the same type. |
| 339 | if (left.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == FDS_MODEL_COUNTS_INDEXcxx . . $ `src/librssguard/definitions/definitions.h:340:9`!) { |
| 340 | // User wants to sort according to counts. |
| 341 | return left_item->countOfUnreadMessagescxx . . $ RootItem#countOfUnreadMessages(455f465bc33b4cdf).() < right_item->countOfUnreadMessagescxx . . $ RootItem#countOfUnreadMessages(455f465bc33b4cdf).(); |
| 342 | } |
| 343 | else { |
| 344 | // In other cases, sort by title. |
| 345 | return QStringcxx . . $ QString#::localeAwareComparecxx . . $ QString#localeAwareCompare(c6f4e55073dadb56).(left_item->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).(), right_item->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).()) < 0; |
| 346 | } |
| 347 | } |
| 348 | else { |
| 349 | // We sort some types with sort order, other alphabetically. |
| 350 | switch (left_item->kindcxx . . $ RootItem#kind(faa800885e6a64b).()) { |
| 351 | case RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Feedcxx . . $ RootItem#Kind#Feed.: |
| 352 | case RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Categorycxx . . $ RootItem#Kind#Category.: |
| 353 | case RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::ServiceRootcxx . . $ RootItem#Kind#ServiceRoot.: |
| 354 | return sortOrdercxx . . $ QSortFilterProxyModel#sortOrder(3d035b40950d32d6).() == Qtcxx . . $ Qt/::SortOrdercxx . . $ Qt/SortOrder#::AscendingOrdercxx . . $ Qt/AscendingOrder. ? left_item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() < right_item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() |
| 355 | : left_item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).() > right_item->sortOrdercxx . . $ RootItem#sortOrder(455f465bc33b4cdf).(); |
| 356 | |
| 357 | default: |
| 358 | return sortOrdercxx . . $ QSortFilterProxyModel#sortOrder(3d035b40950d32d6).() == Qtcxx . . $ Qt/::SortOrdercxx . . $ Qt/SortOrder#::AscendingOrdercxx . . $ Qt/AscendingOrder. |
| 359 | ? QStringcxx . . $ QString#::localeAwareComparecxx . . $ QString#localeAwareCompare(c6f4e55073dadb56).(left_item->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).(), right_item->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).()) < 0 |
| 360 | : QStringcxx . . $ QString#::localeAwareComparecxx . . $ QString#localeAwareCompare(c6f4e55073dadb56).(left_item->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).(), right_item->titlecxx . . $ RootItem#title(6ef7b6c27b00b43d).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).()) > 0; |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | else { |
| 365 | // We sort using priorities. |
| 366 | auto left_priority = m_prioritiescxx . . $ FeedsProxyModel#m_priorities..indexOfcxx . . $ QListSpecialMethodsBase#indexOf(284c58bbf0d07092).(left_item->kindcxx . . $ RootItem#kind(faa800885e6a64b).()); |
| 367 | auto right_priority = m_prioritiescxx . . $ FeedsProxyModel#m_priorities..indexOfcxx . . $ QListSpecialMethodsBase#indexOf(284c58bbf0d07092).(right_item->kindcxx . . $ RootItem#kind(faa800885e6a64b).()); |
| 368 | |
| 369 | return sortOrdercxx . . $ QSortFilterProxyModel#sortOrder(3d035b40950d32d6).() == Qtcxx . . $ Qt/::SortOrdercxx . . $ Qt/SortOrder#::AscendingOrdercxx . . $ Qt/AscendingOrder. ? left_priority < right_priority |
| 370 | : right_priority < left_priority; |
| 371 | } |
| 372 | } |
| 373 | else { |
| 374 | return false; |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | bool FeedsProxyModelcxx . . $ FeedsProxyModel#::filterAcceptsRowcxx . . $ FeedsProxyModel#filterAcceptsRow(5556b7879475181c).(int source_row, const QModelIndexcxx . . $ QModelIndex#& source_parent) const { |
| 379 | bool should_show = filterAcceptsRowInternalcxx . . $ FeedsProxyModel#filterAcceptsRowInternal(5556b7879475181c).(source_row, source_parent); |
| 380 | |
| 381 | if (should_show && m_hiddenIndicescxx . . $ FeedsProxyModel#m_hiddenIndices..containscxx . . $ QListSpecialMethodsBase#contains(7349e39e0b02d05c).(QPaircxx . . $ std/pair#pair(14d64bafa7379ebc).<int, QModelIndexcxx . . $ QModelIndex#>(source_row, source_parent))) { |
| 382 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_COREcxx . . $ `src/librssguard/definitions/definitions.h:178:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Item" |
| 383 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(m_sourceModel |
| 384 | ->data(m_sourceModel->index(source_row, 0, source_parent), Qt::ItemDataRole::EditRole) |
| 385 | .toString()) |
| 386 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "was previously hidden and now shows up, expand."; |
| 387 | |
| 388 | const_cast<FeedsProxyModelcxx . . $ FeedsProxyModel#*>(this)->m_hiddenIndicescxx . . $ FeedsProxyModel#m_hiddenIndices..removeAllcxx . . $ QList#removeAll(5aa96cff9a2299b8).(QPaircxx . . $ std/pair#pair(14d64bafa7379ebc).<int, QModelIndexcxx . . $ QModelIndex#>(source_row, source_parent)); |
| 389 | |
| 390 | // Now, item now should be displayed and previously it was not. |
| 391 | // Expand! |
| 392 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! indexNotFilteredOutAnymorecxx . . $ FeedsProxyModel#indexNotFilteredOutAnymore(1ffafa588cd53a0f).(m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.->indexcxx . . $ FeedsModel#index(37dbccf64c4e392).(source_row, 0, source_parent)); |
| 393 | } |
| 394 | |
| 395 | if (!should_show) { |
| 396 | const_cast<FeedsProxyModelcxx . . $ FeedsProxyModel#*>(this)->m_hiddenIndicescxx . . $ FeedsProxyModel#m_hiddenIndices..appendcxx . . $ QList#append(1262c8661f7a27a7).(QPaircxx . . $ std/pair#pair(14d64bafa7379ebc).<int, QModelIndexcxx . . $ QModelIndex#>(source_row, source_parent)); |
| 397 | } |
| 398 | |
| 399 | return should_show; |
| 400 | } |
| 401 | |
| 402 | void FeedsProxyModelcxx . . $ FeedsProxyModel#::initializeFilterscxx . . $ FeedsProxyModel#initializeFilters(49f6e7a06ebc5aa8).() { |
| 403 | m_filterscxx . . $ FeedsProxyModel#m_filters.[cxx . . $ QMap#`operator[]`(bbd415b616967878).FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter#::ShowEmptycxx . . $ FeedsProxyModel#FeedListFilter#ShowEmpty.] =cxx . . $ std/function#`operator=`(842f3727de83eb28). [this](const RootItemcxx . . $ RootItem#* item) { |
| 404 | return item->countOfAllMessagescxx . . $ RootItem#countOfAllMessages(455f465bc33b4cdf).() == 0; |
| 405 | }; |
| 406 | |
| 407 | m_filterscxx . . $ FeedsProxyModel#m_filters.[cxx . . $ QMap#`operator[]`(bbd415b616967878).FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter#::ShowNonEmptycxx . . $ FeedsProxyModel#FeedListFilter#ShowNonEmpty.] =cxx . . $ std/function#`operator=`(842f3727de83eb28). [this](const RootItemcxx . . $ RootItem#* item) { |
| 408 | return item->countOfAllMessagescxx . . $ RootItem#countOfAllMessages(455f465bc33b4cdf).() != 0; |
| 409 | }; |
| 410 | |
| 411 | m_filterscxx . . $ FeedsProxyModel#m_filters.[cxx . . $ QMap#`operator[]`(bbd415b616967878).FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter#::ShowQuietcxx . . $ FeedsProxyModel#FeedListFilter#ShowQuiet.] =cxx . . $ std/function#`operator=`(842f3727de83eb28). [this](const RootItemcxx . . $ RootItem#* item) { |
| 412 | Feedcxx . . $ Feed#* feed = item->toFeedcxx . . $ RootItem#toFeed(6205f4b142e8b232).(); |
| 413 | |
| 414 | return feed != nullptr && feed->isQuietcxx . . $ Feed#isQuiet(50ce9a9e25b4a850).(); |
| 415 | }; |
| 416 | |
| 417 | m_filterscxx . . $ FeedsProxyModel#m_filters.[cxx . . $ QMap#`operator[]`(bbd415b616967878).FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter#::ShowSwitchedOffcxx . . $ FeedsProxyModel#FeedListFilter#ShowSwitchedOff.] =cxx . . $ std/function#`operator=`(842f3727de83eb28). [this](const RootItemcxx . . $ RootItem#* item) { |
| 418 | Feedcxx . . $ Feed#* feed = item->toFeedcxx . . $ RootItem#toFeed(6205f4b142e8b232).(); |
| 419 | |
| 420 | return feed != nullptr && feed->isSwitchedOffcxx . . $ Feed#isSwitchedOff(50ce9a9e25b4a850).(); |
| 421 | }; |
| 422 | |
| 423 | m_filterscxx . . $ FeedsProxyModel#m_filters.[cxx . . $ QMap#`operator[]`(bbd415b616967878).FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter#::ShowUnreadcxx . . $ FeedsProxyModel#FeedListFilter#ShowUnread.] =cxx . . $ std/function#`operator=`(842f3727de83eb28). [this](const RootItemcxx . . $ RootItem#* item) { |
| 424 | return item->countOfUnreadMessagescxx . . $ RootItem#countOfUnreadMessages(455f465bc33b4cdf).() > 0; |
| 425 | }; |
| 426 | |
| 427 | m_filterscxx . . $ FeedsProxyModel#m_filters.[cxx . . $ QMap#`operator[]`(bbd415b616967878).FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter#::ShowWithArticleFilterscxx . . $ FeedsProxyModel#FeedListFilter#ShowWithArticleFilters.] =cxx . . $ std/function#`operator=`(842f3727de83eb28). [this](const RootItemcxx . . $ RootItem#* item) { |
| 428 | Feedcxx . . $ Feed#* feed = item->toFeedcxx . . $ RootItem#toFeed(6205f4b142e8b232).(); |
| 429 | |
| 430 | return feed != nullptr && !feed->messageFilterscxx . . $ Feed#messageFilters(98143e7d5e66961a).().isEmptycxx . . $ QList#isEmpty(3482b152b9333168).(); |
| 431 | }; |
| 432 | |
| 433 | m_filterscxx . . $ FeedsProxyModel#m_filters.[cxx . . $ QMap#`operator[]`(bbd415b616967878).FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter#::ShowWithErrorcxx . . $ FeedsProxyModel#FeedListFilter#ShowWithError.] =cxx . . $ std/function#`operator=`(842f3727de83eb28). [this](const RootItemcxx . . $ RootItem#* item) { |
| 434 | Feedcxx . . $ Feed#* feed = item->toFeedcxx . . $ RootItem#toFeed(6205f4b142e8b232).(); |
| 435 | |
| 436 | return feed != nullptr && |
| 437 | (feed->statuscxx . . $ Feed#status(3ef043b41d362a5c).() == Feedcxx . . $ Feed#::Statuscxx . . $ Feed#Status#::AuthErrorcxx . . $ Feed#Status#AuthError. || feed->statuscxx . . $ Feed#status(3ef043b41d362a5c).() == Feedcxx . . $ Feed#::Statuscxx . . $ Feed#Status#::NetworkErrorcxx . . $ Feed#Status#NetworkError. || |
| 438 | feed->statuscxx . . $ Feed#status(3ef043b41d362a5c).() == Feedcxx . . $ Feed#::Statuscxx . . $ Feed#Status#::OtherErrorcxx . . $ Feed#Status#OtherError. || feed->statuscxx . . $ Feed#status(3ef043b41d362a5c).() == Feedcxx . . $ Feed#::Statuscxx . . $ Feed#Status#::ParsingErrorcxx . . $ Feed#Status#ParsingError.); |
| 439 | }; |
| 440 | |
| 441 | m_filterscxx . . $ FeedsProxyModel#m_filters.[cxx . . $ QMap#`operator[]`(bbd415b616967878).FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter#::ShowWithNewArticlescxx . . $ FeedsProxyModel#FeedListFilter#ShowWithNewArticles.] =cxx . . $ std/function#`operator=`(842f3727de83eb28). [this](const RootItemcxx . . $ RootItem#* item) { |
| 442 | Feedcxx . . $ Feed#* feed = item->toFeedcxx . . $ RootItem#toFeed(6205f4b142e8b232).(); |
| 443 | |
| 444 | return feed != nullptr && feed->statuscxx . . $ Feed#status(3ef043b41d362a5c).() == Feedcxx . . $ Feed#::Statuscxx . . $ Feed#Status#::NewMessagescxx . . $ Feed#Status#NewMessages.; |
| 445 | }; |
| 446 | |
| 447 | m_filterKeyscxx . . $ FeedsProxyModel#m_filterKeys. =cxx . . $ QList#`operator=`(b54a8b2da3f31fa6). m_filterscxx . . $ FeedsProxyModel#m_filters..keyscxx . . $ QMap#keys(bf6c511543d55010).(); |
| 448 | } |
| 449 | |
| 450 | bool FeedsProxyModelcxx . . $ FeedsProxyModel#::filterAcceptsRowInternalcxx . . $ FeedsProxyModel#filterAcceptsRowInternal(5556b7879475181c).(int source_row, const QModelIndexcxx . . $ QModelIndex#& source_parent) const { |
| 451 | const QModelIndexcxx . . $ QModelIndex# idx = m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.->indexcxx . . $ FeedsModel#index(37dbccf64c4e392).(source_row, 0, source_parent); |
| 452 | |
| 453 | if (!idx.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) { |
| 454 | return false; |
| 455 | } |
| 456 | |
| 457 | const RootItemcxx . . $ RootItem#* item = m_sourceModelcxx . . $ FeedsProxyModel#m_sourceModel.->itemForIndexcxx . . $ FeedsModel#itemForIndex(8787ab140507818d).(idx); |
| 458 | |
| 459 | if (m_selectedItemcxx . . $ FeedsProxyModel#m_selectedItem. == item) { |
| 460 | return true; |
| 461 | } |
| 462 | |
| 463 | ServiceRootcxx . . $ ServiceRoot#* par_account = item->getParentServiceRootcxx . . $ RootItem#getParentServiceRoot(56209a8cf0725652).(); |
| 464 | |
| 465 | if (item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Importantcxx . . $ RootItem#Kind#Important. && !par_account->nodeShowImportantcxx . . $ ServiceRoot#nodeShowImportant(50ce9a9e25b4a850).()) { |
| 466 | return false; |
| 467 | } |
| 468 | |
| 469 | if (item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Unreadcxx . . $ RootItem#Kind#Unread. && !par_account->nodeShowUnreadcxx . . $ ServiceRoot#nodeShowUnread(50ce9a9e25b4a850).()) { |
| 470 | return false; |
| 471 | } |
| 472 | |
| 473 | if (item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Probescxx . . $ RootItem#Kind#Probes. && !par_account->nodeShowProbescxx . . $ ServiceRoot#nodeShowProbes(50ce9a9e25b4a850).()) { |
| 474 | return false; |
| 475 | } |
| 476 | |
| 477 | if (item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() == RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Labelscxx . . $ RootItem#Kind#Labels. && !par_account->nodeShowLabelscxx . . $ ServiceRoot#nodeShowLabels(50ce9a9e25b4a850).()) { |
| 478 | return false; |
| 479 | } |
| 480 | |
| 481 | if (item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() != RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Categorycxx . . $ RootItem#Kind#Category. && item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() != RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Feedcxx . . $ RootItem#Kind#Feed. && |
| 482 | item->kindcxx . . $ RootItem#kind(faa800885e6a64b).() != RootItemcxx . . $ RootItem#::Kindcxx . . $ RootItem#Kind#::Labelcxx . . $ RootItem#Kind#Label.) { |
| 483 | // Some items are always visible. |
| 484 | return true; |
| 485 | } |
| 486 | |
| 487 | bool should_show = QSortFilterProxyModelcxx . . $ QSortFilterProxyModel#::filterAcceptsRowcxx . . $ QSortFilterProxyModel#filterAcceptsRow(5556b7879475181c).(source_row, source_parent); |
| 488 | |
| 489 | // if (item->kind() == RootItem::Kind::Feed) { |
| 490 | // const Feed* feed = item->toFeed(); |
| 491 | |
| 492 | for (FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter# val : m_filterKeyscxx . . $ FeedsProxyModel#m_filterKeys.) { |
| 493 | if (Globalscxx . . $ Globals#::hasFlagcxx . . $ Globals#hasFlag(e81494ae8084f6ba).(m_filtercxx . . $ FeedsProxyModel#m_filter., val)) { |
| 494 | // This particular filter is enabled. |
| 495 | if (m_filterscxx . . $ FeedsProxyModel#m_filters.[cxx . . $ QMap#`operator[]`(d16022aafb6b87be).val](cxx . . $ std/function#`operator()`(39e0826ffb540481).item)) { |
| 496 | // The item matches the feed filter. |
| 497 | // Display it if it matches internal string-based filter too. |
| 498 | return should_show; |
| 499 | } |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | if (m_filtercxx . . $ FeedsProxyModel#m_filter. != FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter#::NoFilteringcxx . . $ FeedsProxyModel#FeedListFilter#NoFiltering.) { |
| 504 | // Some filter is enabled but this item does not meet it. |
| 505 | return false; |
| 506 | } |
| 507 | //} |
| 508 | |
| 509 | return should_show; |
| 510 | } |
| 511 | |
| 512 | bool FeedsProxyModelcxx . . $ FeedsProxyModel#::sortAlphabeticallycxx . . $ FeedsProxyModel#sortAlphabetically(50ce9a9e25b4a850).() const { |
| 513 | return m_sortAlphabeticallycxx . . $ FeedsProxyModel#m_sortAlphabetically.; |
| 514 | } |
| 515 | |
| 516 | void FeedsProxyModelcxx . . $ FeedsProxyModel#::sortcxx . . $ FeedsProxyModel#sort(11168df8d4e8286d).(int column, Qtcxx . . $ Qt/::SortOrdercxx . . $ Qt/SortOrder# order) { |
| 517 | QSortFilterProxyModelcxx . . $ QSortFilterProxyModel#::sortcxx . . $ QSortFilterProxyModel#sort(11168df8d4e8286d).(column, order); |
| 518 | } |
| 519 | |
| 520 | void FeedsProxyModelcxx . . $ FeedsProxyModel#::setViewcxx . . $ FeedsProxyModel#setView(7c40662b447f73ea).(FeedsViewcxx . . $ FeedsView#* newView) { |
| 521 | m_viewcxx . . $ FeedsProxyModel#m_view. = newView; |
| 522 | } |
| 523 | |
| 524 | const RootItemcxx . . $ RootItem#* FeedsProxyModelcxx . . $ FeedsProxyModel#::selectedItemcxx . . $ FeedsProxyModel#selectedItem(73c33a9645a79584).() const { |
| 525 | return m_selectedItemcxx . . $ FeedsProxyModel#m_selectedItem.; |
| 526 | } |
| 527 | |
| 528 | void FeedsProxyModelcxx . . $ FeedsProxyModel#::setSelectedItemcxx . . $ FeedsProxyModel#setSelectedItem(e83c05a3b3498166).(const RootItemcxx . . $ RootItem#* selected_item) { |
| 529 | m_selectedItemcxx . . $ FeedsProxyModel#m_selectedItem. = selected_item; |
| 530 | } |
| 531 | |
| 532 | void FeedsProxyModelcxx . . $ FeedsProxyModel#::setSortAlphabeticallycxx . . $ FeedsProxyModel#setSortAlphabetically(b45ddcbc8423892c).(bool sort_alphabetically) { |
| 533 | if (sort_alphabetically != m_sortAlphabeticallycxx . . $ FeedsProxyModel#m_sortAlphabetically.) { |
| 534 | m_sortAlphabeticallycxx . . $ FeedsProxyModel#m_sortAlphabetically. = sort_alphabetically; |
| 535 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->settingscxx . . $ Application#settings(951936487a2d9252).()->setValuecxx . . $ Settings#setValue(365356ede4ebaabb).(GROUPcxx . . $ `src/librssguard/miscellaneous/settings.h:32:9`!(Feeds), Feedscxx . . $ Feeds/::SortAlphabeticallycxx . . $ Feeds/SortAlphabetically., sort_alphabeticallycxx . . $ QVariant#QVariant(9f0ba574c1c44ffc).); |
| 536 | invalidatecxx . . $ QSortFilterProxyModel#invalidate(49f6e7a06ebc5aa8).(); |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | QModelIndexListcxx . . $ QModelIndexList# FeedsProxyModelcxx . . $ FeedsProxyModel#::mapListToSourcecxx . . $ FeedsProxyModel#mapListToSource(a18e22b7fb4fea).(const QModelIndexListcxx . . $ QModelIndexList#& indexes) const { |
| 541 | QModelIndexListcxx . . $ QModelIndexList# source_indexescxx . . $ QList#QList(ced63f7c635d850d).; |
| 542 | source_indexes.reservecxx . . $ QList#reserve(35cb52607f6af42f).(indexes.sizecxx . . $ QList#size(6b0412d51016192f).()); |
| 543 | |
| 544 | for (const QModelIndexcxx . . $ QModelIndex#& index : indexes) { |
| 545 | source_indexes <<cxx . . $ QList#`operator<<`(457f2c2a0db63381). mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(index); |
| 546 | } |
| 547 | |
| 548 | return source_indexes; |
| 549 | } |
| 550 | |
| 551 | void FeedsProxyModelcxx . . $ FeedsProxyModel#::setFeedListFiltercxx . . $ FeedsProxyModel#setFeedListFilter(613fd7fc3879d90b).(FeedListFiltercxx . . $ FeedsProxyModel#FeedListFilter# filter) { |
| 552 | m_filtercxx . . $ FeedsProxyModel#m_filter. = filter; |
| 553 | |
| 554 | #if QT_VERSION_MAJORcxx . . $ `<external>/9758848313111604122/qconfig.h:67:9`! == 5 |
| 555 | invalidateFilter(); |
| 556 | #else |
| 557 | invalidateRowsFiltercxx . . $ QSortFilterProxyModel#invalidateRowsFilter(49f6e7a06ebc5aa8).(); |
| 558 | #endif |
| 559 | } |