Commit 1bc3955a authored by Laurent Montel's avatar Laurent Montel
Browse files

Port some qt6 compile errors

parent 4cfa7d01
Pipeline #245994 passed with stage
in 9 minutes and 11 seconds
......@@ -42,6 +42,7 @@ static const QString distinguishedIdNames[] = {
QStringLiteral("archiverecoverableitemspurges"),
};
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
class EwsIdComparatorRegistrar
{
public:
......@@ -51,7 +52,7 @@ public:
}
};
const EwsIdComparatorRegistrar ewsIdComparatorRegistrar;
#endif
EwsId::EwsId(QXmlStreamReader &reader)
: mDid(EwsDIdCalendar)
{
......
......@@ -269,7 +269,7 @@ void EwsRequest::requestData(KIO::Job *job, const QByteArray &data)
bool EwsRequest::parseResponseMessage(QXmlStreamReader &reader, const QString &reqName, ContentReaderFn contentReader)
{
if (reader.name() != reqName + QStringLiteral("Response") || reader.namespaceUri() != ewsMsgNsUri) {
if (reader.name().toString() != reqName + QStringLiteral("Response") || reader.namespaceUri() != ewsMsgNsUri) {
return setErrorMsg(QStringLiteral("Failed to read EWS request - expected %1 element.").arg(reqName + QStringLiteral("Response")));
}
......@@ -277,12 +277,12 @@ bool EwsRequest::parseResponseMessage(QXmlStreamReader &reader, const QString &r
return setErrorMsg(QStringLiteral("Failed to read EWS request - expected a child element in %1 element.").arg(reqName + QStringLiteral("Response")));
}
if (reader.name() != QLatin1String("ResponseMessages") || reader.namespaceUri() != ewsMsgNsUri) {
if (reader.name().toString() != QLatin1String("ResponseMessages") || reader.namespaceUri() != ewsMsgNsUri) {
return setErrorMsg(QStringLiteral("Failed to read EWS request - expected %1 element.").arg(QStringLiteral("ResponseMessages")));
}
while (reader.readNextStartElement()) {
if (reader.name() != reqName + QStringLiteral("ResponseMessage") || reader.namespaceUri() != ewsMsgNsUri) {
if (reader.name().toString() != reqName + QStringLiteral("ResponseMessage") || reader.namespaceUri() != ewsMsgNsUri) {
return setErrorMsg(QStringLiteral("Failed to read EWS request - expected %1 element.").arg(reqName + QStringLiteral("ResponseMessage")));
}
......
......@@ -40,7 +40,11 @@
#include <KLocalizedString>
#include <KMessageBox>
#include <KUser>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QNetworkInformation>
#else
#include <QNetworkConfigurationManager>
#endif
#include <QPushButton>
#include <KIdentityManagement/IdentityCombo>
......@@ -118,7 +122,9 @@ SetupServer::SetupServer(ImapResourceBase *parentResource, WId parent)
, m_ui(new Ui::SetupServerView)
, mValidator(this)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
auto networkConfigMgr = new QNetworkConfigurationManager(QCoreApplication::instance());
#endif
m_parentResource->settings()->setWinId(parent);
auto mainWidget = new QWidget(this);
......@@ -192,7 +198,19 @@ SetupServer::SetupServer(ImapResourceBase *parentResource, WId parent)
slotTestChanged();
slotComplete();
slotCustomSieveChanged();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
connect(networkConfigMgr, &QNetworkConfigurationManager::onlineStateChanged, this, &SetupServer::slotTestChanged);
QT_WARNING_POP
#else
QNetworkInformation::instance()->load(QNetworkInformation::Feature::Reachability);
connect(QNetworkInformation::instance(), &QNetworkInformation::reachabilityChanged, this, [this](QNetworkInformation::Reachability newReachability) {
slotTestChanged();
});
#endif
}
SetupServer::~SetupServer()
......
......@@ -328,7 +328,7 @@ void O1::onTokenRequestFinished()
Q_EMIT openBrowser(url);
}
void O1::onVerificationReceived(const QMap<QString, QString> &params)
void O1::onVerificationReceived(const QMultiMap<QString, QString> &params)
{
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "O1::onVerificationReceived";
Q_EMIT closeBrowser();
......
......@@ -107,7 +107,7 @@ Q_SIGNALS:
protected Q_SLOTS:
/// Handle verification received from the reply server.
virtual void onVerificationReceived(const QMap<QString, QString> &params);
virtual void onVerificationReceived(const QMultiMap<QString, QString> &params);
/// Handle token request error.
virtual void onTokenRequestError(QNetworkReply::NetworkError error);
......
......@@ -227,7 +227,7 @@ void O2::unlink()
Q_EMIT linkingSucceeded();
}
void O2::onVerificationReceived(const QMap<QString, QString> &response)
void O2::onVerificationReceived(const QMultiMap<QString, QString> &response)
{
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "O2::onVerificationReceived:" << response;
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "O2::onVerificationReceived: Emitting closeBrowser()";
......
......@@ -126,7 +126,7 @@ Q_SIGNALS:
protected Q_SLOTS:
/// Handle verification response.
virtual void onVerificationReceived(const QMap<QString, QString> &);
virtual void onVerificationReceived(const QMultiMap<QString, QString> &);
/// Handle completion of a token request.
virtual void onTokenReplyFinished();
......
......@@ -41,13 +41,13 @@ void O2ReplyServer::onBytesReady()
socket->write(reply);
QByteArray data = socket->readAll();
QMap<QString, QString> queryParams = parseQueryParams(&data);
QMultiMap<QString, QString> queryParams = parseQueryParams(&data);
socket->disconnectFromHost();
close();
Q_EMIT verificationReceived(queryParams);
}
QMap<QString, QString> O2ReplyServer::parseQueryParams(QByteArray *data)
QMultiMap<QString, QString> O2ReplyServer::parseQueryParams(QByteArray *data)
{
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "O2ReplyServer::parseQueryParams";
......
......@@ -23,12 +23,12 @@ public:
void setReplyContent(const QByteArray &value);
Q_SIGNALS:
void verificationReceived(QMap<QString, QString>);
void verificationReceived(const QMultiMap<QString, QString> &);
public Q_SLOTS:
void onIncomingConnection();
void onBytesReady();
QMap<QString, QString> parseQueryParams(QByteArray *data);
QMultiMap<QString, QString> parseQueryParams(QByteArray *data);
protected:
QByteArray replyContent_;
......
......@@ -12,7 +12,7 @@
TomboyServerAuthenticateJob::TomboyServerAuthenticateJob(KIO::Integration::AccessManager *manager, QObject *parent)
: TomboyJobBase(manager, parent)
, mWebView(new QWebEngineView(nullptr))
, mWebView(new QWebEngineView((QWidget *)nullptr))
{
mWebView->setContextMenuPolicy(Qt::NoContextMenu);
// Connect the o2 authenfication signals
......
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