Changeset View
Changeset View
Standalone View
Standalone View
src/duplicatesfinder.cpp
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 49 | { | |||
---|---|---|---|---|---|
60 | for (int i = 0, rows = m_model->rowCount(); i < rows; i++) { | 60 | for (int i = 0, rows = m_model->rowCount(); i < rows; i++) { | ||
61 | QModelIndex idx = m_model->index(i, 0); | 61 | QModelIndex idx = m_model->index(i, 0); | ||
62 | 62 | | |||
63 | //we gather the values | 63 | //we gather the values | ||
64 | AbstractContact::Ptr values = idx.data(PersonsModel::PersonVCardRole).value<AbstractContact::Ptr>(); | 64 | AbstractContact::Ptr values = idx.data(PersonsModel::PersonVCardRole).value<AbstractContact::Ptr>(); | ||
65 | 65 | | |||
66 | //we check if it matches | 66 | //we check if it matches | ||
67 | int j = 0; | 67 | int j = 0; | ||
68 | Q_FOREACH (const AbstractContact::Ptr &valueToCompare, collectedValues) { | 68 | for (const AbstractContact::Ptr &valueToCompare : qAsConst(collectedValues)) { | ||
69 | QList<Match::MatchReason> matchedRoles = Match::matchAt(values, valueToCompare); | 69 | QList<Match::MatchReason> matchedRoles = Match::matchAt(values, valueToCompare); | ||
70 | 70 | | |||
71 | if (!matchedRoles.isEmpty()) { | 71 | if (!matchedRoles.isEmpty()) { | ||
72 | QPersistentModelIndex i2(m_model->index(j, 0)); | 72 | QPersistentModelIndex i2(m_model->index(j, 0)); | ||
73 | 73 | | |||
74 | m_matches.append(Match(matchedRoles, idx, i2)); | 74 | m_matches.append(Match(matchedRoles, idx, i2)); | ||
75 | } | 75 | } | ||
76 | j++; | 76 | j++; | ||
Show All 36 Lines |