summaryrefslogtreecommitdiffstats
path: root/src/oauth/qoauth2authorizationcodeflow.cpp
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@idiap.ch>2024-10-13 11:21:20 +0200
committerSamuel Gaist <samuel.gaist@idiap.ch>2024-10-17 09:24:56 +0200
commit5b2fca1e93474686167eeada59eae56d7856d23c (patch)
tree5b5af9f7ca1ae9b349f5d375ee972bf95c05d9fd /src/oauth/qoauth2authorizationcodeflow.cpp
parent365ddff74c22ece6ff5bb3d28ea911f9f9c3d197 (diff)
Add errorOccurred and deprecate error signal
Using just error as a signal name makes things confusing as it sounds rather like a getter name (e.g. lastError from QSqlQuery). It has been decided quite some time ago to use errorOccurred as a replacement in other placed in the Qt code base as this name makes it clearer that an error happened and is more in line with the Qt standard that wants clear naming. [ChangeLog][QAbstractOAuth2] The error signal is now deprecated and replaced by errorOccurred. This will make the code handling errors clearer to write and read. Change-Id: Ibd6a4056735f6e9e4bec32525a2576cf41579a08 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/oauth/qoauth2authorizationcodeflow.cpp')
-rw-r--r--src/oauth/qoauth2authorizationcodeflow.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/oauth/qoauth2authorizationcodeflow.cpp b/src/oauth/qoauth2authorizationcodeflow.cpp
index 121362a..06d6b90 100644
--- a/src/oauth/qoauth2authorizationcodeflow.cpp
+++ b/src/oauth/qoauth2authorizationcodeflow.cpp
@@ -103,7 +103,12 @@ void QOAuth2AuthorizationCodeFlowPrivate::_q_handleCallback(const QVariantMap &d
const QString description = data.value(Key::errorDescription).toString();
qCWarning(loggingCategory, "Authorization stage: AuthenticationError: %s(%s): %s",
qPrintable(error), qPrintable(uri), qPrintable(description));
- Q_EMIT q->error(error, description, uri);
+
+#if QT_DEPRECATED_SINCE(6, 13)
+ QT_IGNORE_DEPRECATIONS(Q_EMIT q->error(error, description, uri);)
+#endif
+ Q_EMIT q->errorOccurred(error, description, uri);
+
// Emit also requestFailed() so that it is a signal for all errors
emit q->requestFailed(QAbstractOAuth::Error::ServerError);
return;