Commit 59cf9b0f authored by JanKusanagi's avatar JanKusanagi

Optimize!

parent e584a432
......@@ -314,8 +314,7 @@ void ContactList::addSingleContact(ASPerson *contact)
// This check is actually unnecessary, since this slot is only called
if (m_isFollowing) // for the 'following' list
{
QStringList contactsToAdd;
contactsToAdd.append(contact->getId());
QStringList contactsToAdd = QStringList{ contact->getId() };
m_pumpController->updateInternalFollowingIdList(contactsToAdd);
// Add also to GlobalObject's model for nick completion
......
......@@ -46,12 +46,15 @@ void FilterChecker::setFilters(QVariantList newFiltersList)
// Define new filter values
foreach (QVariant filter, newFiltersList)
{
QString actionType = filter.toMap().value("action").toString();
int filterType = filter.toMap().value("type").toInt();
QString filterText = filter.toMap().value("text").toString();
const int filterType = filter.toMap().value(QStringLiteral("type"))
.toInt();
QStringList pair;
pair << filterText << actionType;
QStringList pair = QStringList{ filter.toMap()
.value(QStringLiteral("text"))
.toString(),
filter.toMap()
.value(QStringLiteral("action"))
.toString() };
switch (filterType)
{
......@@ -156,11 +159,16 @@ int FilterChecker::validateActivity(ASActivity *activity)
}
filterMatches.insert("filterAction", filterAction);
filterMatches.insert("matchingContent", matchingContent);
filterMatches.insert("matchingAuthor", matchingAuthor);
filterMatches.insert("matchingGenerator", matchingGenerator);
filterMatches.insert("matchingDescription", matchingDescription);
filterMatches.insert(QStringLiteral("filterAction"),
filterAction);
filterMatches.insert(QStringLiteral("matchingContent"),
matchingContent);
filterMatches.insert(QStringLiteral("matchingAuthor"),
matchingAuthor);
filterMatches.insert(QStringLiteral("matchingGenerator"),
matchingGenerator);
filterMatches.insert(QStringLiteral("matchingDescription"),
matchingDescription);
activity->setFilterMatches(filterMatches);
......
Markdown is supported
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