Commit 198d7b48 authored by Volker Krause's avatar Volker Krause
Browse files

Replace QMap::unite with QMap::insert

QMap::unite is deprecated as it can generate multiple entries for the same
key, which is not desired here. QMap::insert does the same, but overrides
existing values if a key already exists.
parent 07f1fbbf
......@@ -46,11 +46,11 @@ public Q_SLOTS:
const QMap<qint64, KIMAP::MessagePtr> &messages)
{
m_signals << QStringLiteral("headersReceived");
m_uids.unite(uids);
m_sizes.unite(sizes);
m_flags.unite(flags);
m_messages.unite(messages);
m_attrs.unite(attrs);
m_uids.insert(uids);
m_sizes.insert(sizes);
m_flags.insert(flags);
m_messages.insert(messages);
m_attrs.insert(attrs);
}
void onMessagesReceived(const QString & /*mailbox*/,
......@@ -59,9 +59,9 @@ public Q_SLOTS:
const QMap<qint64, KIMAP::MessagePtr> &messages)
{
m_signals << QStringLiteral("messagesReceived");
m_uids.unite(uids);
m_messages.unite(messages);
m_attrs.unite(attrs);
m_uids.insert(uids);
m_messages.insert(messages);
m_attrs.insert(attrs);
}
void onPartsReceived(const QString & /*mailbox*/,
......@@ -70,14 +70,14 @@ public Q_SLOTS:
const QMap<qint64, KIMAP::MessageParts> &parts)
{
m_signals << QStringLiteral("partsReceived");
m_attrs.unite(attrs);
m_parts.unite(parts);
m_attrs.insert(attrs);
m_parts.insert(parts);
}
void onMessagesAvailable(const QMap<qint64, KIMAP::Message> &messages)
{
m_signals << QStringLiteral("messagesAvailable");
m_msgs.unite(messages);
m_msgs.insert(messages);
}
private Q_SLOTS:
......
......@@ -79,7 +79,7 @@ void GetQuotaRootJob::handleResponse(const Response &response)
const QMap<QByteArray, QPair<qint64, qint64>> &quota = d->readQuota(response.content[quotaContentIndex]);
if (d->quotas.contains(rootName)) {
d->quotas[rootName].unite(quota);
d->quotas[rootName].insert(quota);
} else {
d->quotas[rootName] = quota;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment