Commit 5b19d1ad authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Revert "Port some deprecated methods"

This reverts commit d547b86f.
parent e53f8604
......@@ -163,12 +163,7 @@ void EwsOAuthUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *request)
void EwsOAuthReplyHandler::networkReplyFinished(QNetworkReply *reply)
{
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
const auto networkError = reply->error();
#else
const auto networkError = reply->networkError();
#endif
if (networkError != QNetworkReply::NoError) {
if (reply->error() != QNetworkReply::NoError) {
Q_EMIT replyError(reply->errorString());
return;
} else if (reply->header(QNetworkRequest::ContentTypeHeader).isNull()) {
......
......@@ -114,12 +114,7 @@ void EwsPKeyAuthJob::sendAuthRequest(const QByteArray &respToken, const QUrl &su
void EwsPKeyAuthJob::authRequestFinished()
{
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
const auto networkError = mAuthReply->error();
#else
const auto networkError = mAuthReply->networkError();
#endif
if (networkError == QNetworkReply::NoError) {
if (mAuthReply->error() == QNetworkReply::NoError) {
mResultUri = mAuthReply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
if (!mResultUri.isValid()) {
setErrorMsg(QStringLiteral("Incorrect or missing redirect URI in PKeyAuth response"));
......
......@@ -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.keys()) { qCDebug(KALARMDIRRESOURCE_LOG)<<id<<":"<<mEvents[id].files; } \
foreach (const QString &id, mEvents.uniqueKeys()) { qCDebug(KALARMDIRRESOURCE_LOG)<<id<<":"<<mEvents[id].files; } \
qCDebug(KALARMDIRRESOURCE_LOG)<<"File:IDs:"; \
foreach (const QString &f, mFileEventIds.keys()) { qCDebug(KALARMDIRRESOURCE_LOG)<<f<<":"<<mFileEventIds[f]; }
foreach (const QString &f, mFileEventIds.uniqueKeys()) { qCDebug(KALARMDIRRESOURCE_LOG)<<f<<":"<<mFileEventIds[f]; }
KAlarmDirResource::KAlarmDirResource(const QString &id)
: ResourceBase(id)
......
......@@ -275,13 +275,8 @@ void O1::onTokenRequestFinished()
{
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "O1::onTokenRequestFinished";
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
reply->deleteLater();
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
const auto networkError = reply->error();
#else
const auto networkError = reply->networkError();
#endif
if (networkError != QNetworkReply::NoError) {
reply->deleteLater();
if (reply->error() != QNetworkReply::NoError) {
qCWarning(TOMBOYNOTESRESOURCE_LOG) << "O1::onTokenRequestFinished: " << reply->errorString();
return;
}
......@@ -367,12 +362,7 @@ void O1::onTokenExchangeFinished()
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
reply->deleteLater();
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
const auto networkError = reply->error();
#else
const auto networkError = reply->networkError();
#endif
if (networkError != QNetworkReply::NoError) {
if (reply->error() != QNetworkReply::NoError) {
qCWarning(TOMBOYNOTESRESOURCE_LOG) << "O1::onTokenExchangeFinished: " << reply->errorString();
return;
}
......
......@@ -279,12 +279,7 @@ void O2::onTokenReplyFinished()
{
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "O2::onTokenReplyFinished";
QNetworkReply *tokenReply = qobject_cast<QNetworkReply *>(sender());
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
const auto networkError = tokenReply->error();
#else
const auto networkError = tokenReply->networkError();
#endif
if (networkError == QNetworkReply::NoError) {
if (tokenReply->error() == QNetworkReply::NoError) {
QByteArray replyData = tokenReply->readAll();
QVariantMap tokens = parseTokenResponse(replyData);
......@@ -395,13 +390,8 @@ void O2::refresh()
void O2::onRefreshFinished()
{
QNetworkReply *refreshReply = qobject_cast<QNetworkReply *>(sender());
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
const auto networkError = refreshReply->error();
#else
const auto networkError = refreshReply->networkError();
#endif
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "O2::onRefreshFinished: Error" << (int)networkError << refreshReply->errorString();
if (networkError == QNetworkReply::NoError) {
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "O2::onRefreshFinished: Error" << (int)refreshReply->error() << refreshReply->errorString();
if (refreshReply->error() == QNetworkReply::NoError) {
QByteArray reply = refreshReply->readAll();
QVariantMap tokens = parseTokenResponse(reply);
setToken(tokens.value(QLatin1String(O2_OAUTH2_ACCESS_TOKEN)).toString());
......
......@@ -82,18 +82,14 @@ void O2Requestor::onRefreshFinished(QNetworkReply::NetworkError error)
void O2Requestor::onRequestFinished()
{
QNetworkReply *senderReply = qobject_cast<QNetworkReply *>(sender());
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
const auto networkError = senderReply->error();
#else
const auto networkError = senderReply->networkError();
#endif
QNetworkReply::NetworkError error = senderReply->error();
if (status_ == Idle) {
return;
}
if (reply_ != senderReply) {
return;
}
if (networkError == QNetworkReply::NoError) {
if (error == QNetworkReply::NoError) {
QTimer::singleShot(10, this, &O2Requestor::finish);
}
}
......
......@@ -42,12 +42,7 @@ void TomboyJobBase::setAuthentication(const QString &token, const QString &secre
void TomboyJobBase::checkReplyError()
{
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
const auto networkError = mReply->error();
#else
const auto networkError = mReply->networkError();
#endif
switch (networkError) {
switch (mReply->error()) {
case QNetworkReply::NoError:
setError(TomboyJobError::NoError);
break;
......
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