Commit c31d9a7e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against qt5.15

parent 767b0aa8
......@@ -72,7 +72,11 @@ Contact::Contact(const Contact &other):
KContacts::Addressee(other),
d(new Private(*(other.d)))
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList groups = custom(QStringLiteral("GCALENDAR"), QStringLiteral("groupMembershipInfo")).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
const QStringList groups = custom(QStringLiteral("GCALENDAR"), QStringLiteral("groupMembershipInfo")).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
for (const QString &group : groups) {
d->groups.insert(group, false);
}
......@@ -83,7 +87,11 @@ Contact::Contact(const KContacts::Addressee& other):
KContacts::Addressee(other),
d(new Private)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList groups = custom(QStringLiteral("GCALENDAR"), QStringLiteral("groupMembershipInfo")).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
const QStringList groups = custom(QStringLiteral("GCALENDAR"), QStringLiteral("groupMembershipInfo")).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
for (const QString &group : groups) {
d->groups.insert(group, false);
}
......@@ -180,7 +188,11 @@ void Contact::addGroup(const QString &group)
d->groups.insert(group, false);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList groups = custom(QStringLiteral("GCALENDAR"), QStringLiteral("groupMembershipInfo")).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
QStringList groups = custom(QStringLiteral("GCALENDAR"), QStringLiteral("groupMembershipInfo")).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
if (!groups.contains(group)) {
groups.append(group);
}
......@@ -200,7 +212,11 @@ void Contact::setGroups(const QStringList &groups)
QStringList Contact::groups() const
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
return custom(QStringLiteral("GCALENDAR"), QStringLiteral("groupMembershipInfo")).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
return custom(QStringLiteral("GCALENDAR"), QStringLiteral("groupMembershipInfo")).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
}
void Contact::clearGroups()
......
......@@ -120,8 +120,13 @@ void AuthWidget::authenticate()
connect(d->server, &QTcpServer::newConnection, [&]() {
d->connection = d->server->nextPendingConnection();
d->connection->setParent(this);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->connection, static_cast<void (QAbstractSocket::*)(QAbstractSocket::SocketError)>
(&QAbstractSocket::error), d, &AuthWidgetPrivate::socketError);
(&QAbstractSocket::error), d, &AuthWidgetPrivate::socketError);
#else
connect(d->connection, static_cast<void (QAbstractSocket::*)(QAbstractSocket::SocketError)>
(&QAbstractSocket::errorOccurred), d, &AuthWidgetPrivate::socketError);
#endif
connect(d->connection, &QTcpSocket::readyRead, d, &AuthWidgetPrivate::socketReady);
d->server->close();
d->server->deleteLater();
......
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