Commit 02024d94 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated method

parent cf9fb26c
......@@ -63,9 +63,9 @@ static const char warningFile[] = "WARNING_README.txt";
#define DEBUG_DATA(func) \
qCDebug(KALARMDIRRESOURCE_LOG)<<func<<"ID:Files:"; \
foreach (const QString &id, mEvents.uniqueKeys()) { qCDebug(KALARMDIRRESOURCE_LOG)<<id<<":"<<mEvents[id].files; } \
foreach (const QString &id, mEvents.keys()) { qCDebug(KALARMDIRRESOURCE_LOG)<<id<<":"<<mEvents[id].files; } \
qCDebug(KALARMDIRRESOURCE_LOG)<<"File:IDs:"; \
foreach (const QString &f, mFileEventIds.uniqueKeys()) { qCDebug(KALARMDIRRESOURCE_LOG)<<f<<":"<<mFileEventIds[f]; }
foreach (const QString &f, mFileEventIds.keys()) { qCDebug(KALARMDIRRESOURCE_LOG)<<f<<":"<<mFileEventIds[f]; }
KAlarmDirResource::KAlarmDirResource(const QString &id)
: ResourceBase(id)
......
......@@ -646,9 +646,29 @@ void getRecurrence(T &i, const I &e)
rrule.setEnd(fromDate(defaultRR->endDt(), e.allDay()));
}
rrule.setBysecond(defaultRR->bySeconds().toVector().toStdVector());
rrule.setByminute(defaultRR->byMinutes().toVector().toStdVector());
rrule.setByhour(defaultRR->byHours().toVector().toStdVector());
const QVector<int> bySecondsVector = defaultRR->bySeconds().toVector();
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
rrule.setBysecond(bySecondsVector.toStdVector());
#else
const auto stdVectorBySeconds = std::vector<int>(bySecondsVector.begin(), bySecondsVector.end());
rrule.setBysecond(stdVectorBySeconds);
#endif
const QVector<int> byMinutesVector = defaultRR->byMinutes().toVector();
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
rrule.setByminute(byMinutesVector.toStdVector());
#else
const auto stdVectorByMinutes = std::vector<int>(byMinutesVector.begin(), byMinutesVector.end());
rrule.setByminute(stdVectorByMinutes);
#endif
const QVector<int> byHoursVector = defaultRR->byHours().toVector();
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
rrule.setByhour(byHoursVector.toStdVector());
#else
const auto stdVectorByHours = std::vector<int>(byHoursVector.begin(), byHoursVector.end());
rrule.setByhour(stdVectorByHours);
#endif
std::vector<Kolab::DayPos> daypos;
daypos.reserve(defaultRR->byDays().count());
......@@ -657,10 +677,42 @@ void getRecurrence(T &i, const I &e)
}
rrule.setByday(daypos);
rrule.setBymonthday(defaultRR->byMonthDays().toVector().toStdVector());
rrule.setByyearday(defaultRR->byYearDays().toVector().toStdVector());
rrule.setByweekno(defaultRR->byWeekNumbers().toVector().toStdVector());
rrule.setBymonth(defaultRR->byMonths().toVector().toStdVector());
const QVector<int> bymonthdayVector = defaultRR->byMonthDays().toVector();
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
rrule.setBymonthday(bymonthdayVector.toStdVector());
#else
const auto stdByMonthDayVector = std::vector<int>(bymonthdayVector.begin(), bymonthdayVector.end());
rrule.setBymonthday(stdByMonthDayVector);
#endif
const QVector<int> byYearDaysVector = defaultRR->byYearDays().toVector();
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
rrule.setByyearday(byYearDaysVector.toStdVector());
#else
const auto stdByYearDayVector = std::vector<int>(byYearDaysVector.begin(), byYearDaysVector.end());
rrule.setByyearday(stdByYearDayVector);
#endif
const QVector<int> byWeekNumberVector = defaultRR->byWeekNumbers().toVector();
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
rrule.setByweekno(byWeekNumberVector.toStdVector());
#else
const auto stdWeekNumberVector = std::vector<int>(byWeekNumberVector.begin(), byWeekNumberVector.end());
rrule.setByweekno(stdWeekNumberVector);
#endif
const QVector<int> byMonthVector = defaultRR->byMonths().toVector();
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
rrule.setBymonth(byMonthVector.toStdVector());
#else
const auto stdByMonthVector = std::vector<int>(byMonthVector.begin(), byMonthVector.end());
rrule.setBymonth(stdByMonthVector);
#endif
i.setRecurrenceRule(rrule);
std::vector<Kolab::cDateTime> rdates;
......
......@@ -260,7 +260,11 @@ void O1::link()
request.setRawHeader(O2_HTTP_AUTHORIZATION_HEADER, buildAuthorizationHeader(headers));
request.setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String(O2_MIME_TYPE_XFORM));
QNetworkReply *reply = manager_->post(request, QByteArray());
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), this, &O1::onTokenRequestError);
#else
connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::errorOccurred), this, &O1::onTokenRequestError);
#endif
connect(reply, &QNetworkReply::finished, this, &O1::onTokenRequestFinished);
}
......@@ -345,7 +349,11 @@ void O1::exchangeToken()
request.setRawHeader(O2_HTTP_AUTHORIZATION_HEADER, buildAuthorizationHeader(oauthParams));
request.setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String(O2_MIME_TYPE_XFORM));
QNetworkReply *reply = manager_->post(request, QByteArray());
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), this, &O1::onTokenExchangeError);
#else
connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::errorOccurred), this, &O1::onTokenExchangeError);
#endif
connect(reply, &QNetworkReply::finished, this, &O1::onTokenExchangeFinished);
}
......
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