Commit 2f8ff889 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent 7de3475d
......@@ -58,11 +58,7 @@ void ContactMetaData::load(const Akonadi::Item &contact)
ContactMetaDataAttribute *attribute = contact.attribute<ContactMetaDataAttribute>();
const QVariantMap metaData = attribute->metaData();
if (metaData.contains(QStringLiteral("DisplayNameMode"))) {
d->mDisplayNameMode = metaData.value(QStringLiteral("DisplayNameMode")).toInt();
} else {
d->mDisplayNameMode = -1;
}
d->mDisplayNameMode = metaData.value(QStringLiteral("DisplayNameMode"), -1).toInt();
d->mCustomFieldDescriptions = metaData.value(QStringLiteral("CustomFieldDescriptions")).toList();
}
......
......@@ -567,11 +567,11 @@ void StandardContactActionManager::setItemSelectionModel(QItemSelectionModel *se
QAction *StandardContactActionManager::createAction(Type type)
{
if (d->mActions.contains(type)) {
return d->mActions.value(type);
QAction *action = d->mActions.value(type);
if (action) {
return action;
}
QAction *action = nullptr;
switch (type) {
case CreateContact:
......
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