Commit 76a6c137 authored by Filipe Azevedo's avatar Filipe Azevedo

Backport std::optional to macOS 10.9

The macOS 10.9 has a limited implementation of C++17.
parent 2faa9de7
......@@ -114,7 +114,7 @@ private Q_SLOTS:
const auto identifier = DBus::parseInstanceIdentifier(serviceName);
QCOMPARE(identifier.has_value(), hasInstance);
if (hasInstance) {
QCOMPARE(identifier.value(), QStringLiteral("instance"));
QCOMPARE(*identifier, QStringLiteral("instance"));
}
}
};
......
......@@ -78,7 +78,7 @@ std::optional<qint64> CommandContext::tagId() const
Tag CommandContext::tag() const
{
return mTagId.has_value() ? Tag::retrieveById(mTagId.value()) : Tag();
return mTagId.has_value() ? Tag::retrieveById(*mTagId) : Tag();
}
bool CommandContext::isEmpty() const
......
......@@ -52,7 +52,7 @@ void ItemQueryHelper::itemSetToQuery(const ImapSet &set, const CommandContext &c
}
qb.addJoin(QueryBuilder::InnerJoin, PimItemTagRelation::tableName(),
PimItem::idFullColumnName(), PimItemTagRelation::leftFullColumnName());
qb.addValueCondition(PimItemTagRelation::rightFullColumnName(), Query::Equals, tagId.value());
qb.addValueCondition(PimItemTagRelation::rightFullColumnName(), Query::Equals, *tagId);
}
}
......@@ -77,7 +77,7 @@ void ItemQueryHelper::remoteIdToQuery(const QStringList &rids, const CommandCont
if (tagId.has_value()) {
qb.addJoin(QueryBuilder::InnerJoin, PimItemTagRelation::tableName(),
PimItem::idFullColumnName(), PimItemTagRelation::leftFullColumnName());
qb.addValueCondition(PimItemTagRelation::rightFullColumnName(), Query::Equals, tagId.value());
qb.addValueCondition(PimItemTagRelation::rightFullColumnName(), Query::Equals, *tagId);
}
}
......@@ -99,7 +99,7 @@ void ItemQueryHelper::gidToQuery(const QStringList &gids, const CommandContext &
}
qb.addJoin(QueryBuilder::InnerJoin, PimItemTagRelation::tableName(),
PimItem::idFullColumnName(), PimItemTagRelation::leftFullColumnName());
qb.addValueCondition(PimItemTagRelation::rightFullColumnName(), Query::Equals, tagId.value());
qb.addValueCondition(PimItemTagRelation::rightFullColumnName(), Query::Equals, *tagId);
}
}
......
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