Commit d4d1f77d authored by Laurent Montel's avatar Laurent Montel
Browse files

Fix some compile error (qt6)

parent ea055c52
......@@ -57,7 +57,7 @@ template<typename Req, typename ReqItem, typename RespItem>
template<typename ReqSetupFn, typename RespGetFn, typename ProgressFn, typename ResultFn>
void EwsAbstractChunkedJob<Req, ReqItem, RespItem>::start(ReqSetupFn reqSetupFn, RespGetFn respGetFn, ProgressFn progressFn, ResultFn resultFn)
{
int itemsToDo = qMin(mItems.size() - mItemsDone, mChunkSize);
int itemsToDo = qMin<int>(mItems.size() - mItemsDone, mChunkSize);
if (itemsToDo == 0) {
resultFn(true, QString());
return;
......
......@@ -118,8 +118,11 @@ public:
~EwsOAuthPrivate() override = default;
bool authenticate(bool interactive);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void modifyParametersFunction(QAbstractOAuth::Stage stage, QVariantMap *parameters);
#else
void modifyParametersFunction(QAbstractOAuth::Stage stage, QMultiMap<QString, QVariant> *parameters);
#endif
void authorizeWithBrowser(const QUrl &url);
void redirectUriIntercepted(const QUrl &url);
void granted();
......@@ -280,7 +283,7 @@ void EwsOAuthRequestInterceptor::setPKeyAuthInputArguments(const QString &pkeyCe
EwsOAuthPrivate::EwsOAuthPrivate(EwsOAuth *parent, const QString &email, const QString &appId, const QString &redirectUri)
: QObject(nullptr)
, mWebView(nullptr)
, mWebView((QWidget *)nullptr)
, mWebProfile()
, mWebPage(&mWebProfile)
, mReplyHandler(this, redirectUri)
......@@ -298,10 +301,15 @@ EwsOAuthPrivate::EwsOAuthPrivate(EwsOAuth *parent, const QString &email, const Q
mWebProfile.installUrlSchemeHandler("urn", &mSchemeHandler);
mWebView.setPage(&mWebPage);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
mOAuth2.setModifyParametersFunction([&](QAbstractOAuth::Stage stage, QVariantMap *parameters) {
modifyParametersFunction(stage, parameters);
});
#else
mOAuth2.setModifyParametersFunction([&](QAbstractOAuth::Stage stage, QMultiMap<QString, QVariant> *parameters) {
modifyParametersFunction(stage, parameters);
});
#endif
connect(&mOAuth2, &QOAuth2AuthorizationCodeFlow::authorizeWithBrowser, this, &EwsOAuthPrivate::authorizeWithBrowser);
connect(&mOAuth2, &QOAuth2AuthorizationCodeFlow::granted, this, &EwsOAuthPrivate::granted);
connect(&mOAuth2, &QOAuth2AuthorizationCodeFlow::error, this, &EwsOAuthPrivate::error);
......@@ -328,7 +336,11 @@ bool EwsOAuthPrivate::authenticate(bool interactive)
}
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void EwsOAuthPrivate::modifyParametersFunction(QAbstractOAuth::Stage stage, QVariantMap *parameters)
#else
void EwsOAuthPrivate::modifyParametersFunction(QAbstractOAuth::Stage stage, QMultiMap<QString, QVariant> *parameters)
#endif
{
switch (stage) {
case QAbstractOAuth::Stage::RequestingAccessToken:
......
Supports Markdown
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