summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorPekka Vuorela <pvuorela@iki.fi>2025-09-27 19:59:32 +0300
committerPekka Vuorela <pvuorela@iki.fi>2025-09-29 14:36:45 +0300
commitc920b71baf962cde974f55cc034e64c5bffe6b21 (patch)
tree673f4bab92e76ef03635568efe233ec3f255d8c9 /src/plugins
parent8f4a54e9ab0a3cba69c837dc373b74b5f687b808 (diff)
Avoid (explicit) QmfList outside the library
Paving the way to get rid of the QmfList which was added sort of stopgap on Qt6 migration because of the QList changes. - Imap plugin using for() loop which should work for any container type returned by the methods. - tst_qmailstore unit test just getting the list of addresses after we are sure those won't change. A few more lines but avoids the custom type. - On previous changed also indexing fully 0 based to keep it more robust. "Hi 0" type of subjects shouldn't really matter on tests. Change-Id: I7a74dbe7654d5f3dd80435d5bf9af110b875b03a Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/messageservices/imap/imapprotocol.cpp9
-rw-r--r--src/plugins/messageservices/imap/imapstrategy.cpp4
2 files changed, 5 insertions, 8 deletions
diff --git a/src/plugins/messageservices/imap/imapprotocol.cpp b/src/plugins/messageservices/imap/imapprotocol.cpp
index 1296525b..220c0e16 100644
--- a/src/plugins/messageservices/imap/imapprotocol.cpp
+++ b/src/plugins/messageservices/imap/imapprotocol.cpp
@@ -1906,11 +1906,9 @@ QStringList SearchMessageState::convertKey(const QMailMessageKey &key)
{
QStringList result;
QMailKey::Combiner combiner = key.combiner();
-
- const QmfList<QMailMessageKey::ArgumentType> args = key.arguments();
-
QList<QStringList> argSearches;
- for (QMailMessageKey::ArgumentType arg : args) {
+
+ for (const QMailMessageKey::ArgumentType &arg : key.arguments()) {
Q_ASSERT(arg.valueList.count() == 1); // shouldn't have more than 1 element.
QStringList searchKey(convertValue(arg.valueList[0], arg.property, arg.op));
if (!searchKey.isEmpty()) {
@@ -1921,9 +1919,8 @@ QStringList SearchMessageState::convertKey(const QMailMessageKey &key)
result = combine(argSearches, combiner);
QList<QStringList> subSearchKeys;
- const QmfList<QMailMessageKey> subkeys = key.subKeys();
- for (QMailMessageKey subkey : subkeys) {
+ for (const QMailMessageKey &subkey : key.subKeys()) {
QStringList searchKey(convertKey(subkey));
if (!searchKey.isEmpty())
subSearchKeys.append(searchKey);
diff --git a/src/plugins/messageservices/imap/imapstrategy.cpp b/src/plugins/messageservices/imap/imapstrategy.cpp
index e856fef1..789411c6 100644
--- a/src/plugins/messageservices/imap/imapstrategy.cpp
+++ b/src/plugins/messageservices/imap/imapstrategy.cpp
@@ -394,8 +394,8 @@ QSet<QMailFolderId> foldersApplicableTo(QMailMessageKey const& messagekey, QSet<
} else if (key.combiner() == QMailKey::And) {
bool filled(included.size() != 0 || excluded.size() != 0);
- for (QmfList<QMailMessageKey>::const_iterator it(key.subKeys().begin()) ; it != key.subKeys().end() ; ++it) {
- IncludedExcludedPair next(extractFolders(*it));
+ for (const QMailMessageKey &key : key.subKeys()) {
+ IncludedExcludedPair next(extractFolders(key));
if (next.first.size() != 0 || next.second.size() != 0) {
if (filled) {
included.intersect(next.first);