Commit 58419bd8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix more compile error against qt6

parent 6bc280c2
Pipeline #115854 passed with stage
in 7 minutes and 49 seconds
......@@ -56,8 +56,11 @@ std::optional<DBus::AgentService> DBus::parseAgentServiceName(const QString &ser
if (!serviceName.startsWith(AKONADI_DBUS_SERVER_SERVICE ".")) {
return std::nullopt;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const auto parts = serviceName.midRef(QStringView(AKONADI_DBUS_SERVER_SERVICE ".").length()).split(QLatin1Char('.'));
#else
const auto parts = QStringView(serviceName).mid(QStringView(AKONADI_DBUS_SERVER_SERVICE ".").length()).split(QLatin1Char('.'));
#endif
if ((parts.size() == 2 && !Akonadi::Instance::hasIdentifier())
|| (parts.size() == 3 && Akonadi::Instance::hasIdentifier() && Akonadi::Instance::identifier() == parts.at(2))) {
// switch on parts.at( 0 )
......@@ -117,7 +120,11 @@ std::optional<QString> DBus::parseInstanceIdentifier(const QString &serviceName)
}
if (serviceName.startsWith(QStringView{AKONADI_DBUS_SERVER_SERVICE})) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const auto split = serviceName.splitRef(QLatin1Char('.'));
#else
const auto split = QStringView(serviceName).split(QLatin1Char('.'));
#endif
if (split.size() <= 3) {
return std::nullopt;
}
......
......@@ -160,13 +160,13 @@ ImapSet::ImapSet(Id id)
{
add(QVector<Id>() << id);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
ImapSet::ImapSet(const QVector<qint64> &ids)
: d(new ImapSetPrivate)
{
add(ids);
}
#endif
ImapSet::ImapSet(const QList<qint64> &ids)
: d(new ImapSetPrivate)
{
......@@ -208,12 +208,12 @@ bool ImapSet::operator==(const ImapSet &other) const
{
return d->intervals == other.d->intervals;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void ImapSet::add(const QVector<Id> &values)
{
d->add(values);
}
#endif
void ImapSet::add(const QList<Id> &values)
{
d->add(values);
......
......@@ -147,7 +147,9 @@ public:
ImapSet(qint64 Id); // krazy:exclude=explicit
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
ImapSet(const QVector<qint64> &ids); // krazy:exclude=explicit
#endif
ImapSet(const QList<qint64> &ids); // krazy:exclude=explicit
......@@ -181,7 +183,9 @@ public:
No interval merging is performed.
@param values List of positive integer numbers in arbitrary order
*/
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void add(const QVector<Id> &values);
#endif
void add(const QList<Id> &values);
/**
......
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