Commit 673a0087 authored by Laurent Montel's avatar Laurent Montel 😁

Remove QT_CHECK

parent 5f13fffd
......@@ -22,11 +22,7 @@
#include <CollectionModifyJob>
#include <CollectionFilterProxyModel>
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
#include <KRecursiveFilterProxyModel>
#else
#include <QSortFilterProxyModel>
#endif
#include <AkonadiCore/AttributeFactory>
#include <ChangeRecorder>
......@@ -128,12 +124,8 @@ NewMailNotifierSelectCollectionWidget::NewMailNotifierSelectCollectionWidget(QWi
mNewMailNotifierProxyModel = new NewMailNotifierCollectionProxyModel(this);
mNewMailNotifierProxyModel->setSourceModel(mimeTypeProxy);
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
mCollectionFilter = new KRecursiveFilterProxyModel(this);
#else
mCollectionFilter = new QSortFilterProxyModel(this);
mCollectionFilter->setRecursiveFilteringEnabled(true);
#endif
mCollectionFilter->setSourceModel(mNewMailNotifierProxyModel);
mCollectionFilter->setDynamicSortFilter(true);
mCollectionFilter->setFilterCaseSensitivity(Qt::CaseInsensitive);
......
......@@ -24,11 +24,7 @@
#include <Collection>
#include <QModelIndex>
#include <QIdentityProxyModel>
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
class KRecursiveFilterProxyModel;
#else
class QSortFilterProxyModel;
#endif
namespace Akonadi {
class EntityTreeModel;
class ChangeRecorder;
......@@ -73,11 +69,7 @@ private:
QTreeView *mFolderView = nullptr;
Akonadi::EntityTreeModel *mModel = nullptr;
Akonadi::ChangeRecorder *mChangeRecorder = nullptr;
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
KRecursiveFilterProxyModel *mCollectionFilter = nullptr;
#else
QSortFilterProxyModel *mCollectionFilter = nullptr;
#endif
NewMailNotifierCollectionProxyModel *mNewMailNotifierProxyModel = nullptr;
};
......
......@@ -259,11 +259,7 @@ bool EwsOAuthPrivate::authenticate(bool interactive)
qCInfoNC(EWSCLI_LOG) << QStringLiteral("Starting OAuth2 authentication");
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
if (!mOAuth2.refreshToken().isEmpty()) {
#else
if (mOAuth2.status() == QAbstractOAuth::Status::Granted) {
#endif
mOAuth2.refreshAccessToken();
return true;
} else if (interactive) {
......@@ -390,9 +386,7 @@ void EwsOAuthPrivate::granted()
QMap<QString, QString> map;
map[accessTokenMapKey] = mOAuth2.token();
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
map[refreshTokenMapKey] = mOAuth2.refreshToken();
#endif
Q_EMIT q->setWalletMap(map);
Q_EMIT q->authSucceeded();
......@@ -406,9 +400,7 @@ void EwsOAuthPrivate::error(const QString &error, const QString &errorDescriptio
mAuthenticated = false;
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
mOAuth2.setRefreshToken(QString());
#endif
qCInfoNC(EWSCLI_LOG) << QStringLiteral("Authentication failed: ") << error << errorDescription;
Q_EMIT q->authFailed(error);
......@@ -486,11 +478,9 @@ void EwsOAuth::walletMapRequestFinished(const QMap<QString, QString> &map)
d->mPKeyPassword = map[pkeyPasswordMapKey];
}
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
if (map.contains(refreshTokenMapKey)) {
d->mOAuth2.setRefreshToken(map[refreshTokenMapKey]);
}
#endif
if (map.contains(accessTokenMapKey)) {
d->mOAuth2.setToken(map[accessTokenMapKey]);
d->mAuthenticated = true;
......
......@@ -139,11 +139,7 @@ EwsResource::EwsResource(const QString &id)
mTagStore = new EwsTagStore(this);
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &EwsResource::delayedInit, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "delayedInit", Qt::QueuedConnection);
#endif
connect(this, &AgentBase::reloadConfiguration, this, &EwsResource::reloadConfig);
}
......
......@@ -151,16 +151,6 @@ void UtEwsOAuth::initialRefreshSuccessful()
const auto authUrlString = Mock::authUrlString(authUrl, testClientId, testReturnUri, testEmail, resource, testState);
const QStringList expectedEvents = {
Mock::requestWalletMapString(),
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Mock::modifyParamsAuthString(testClientId, testReturnUri, testState),
Mock::authorizeWithBrowserString(authUrlString),
Mock::loadWebPageString(authUrlString),
Mock::interceptRequestString(authUrlString),
Mock::interceptRequestBlockedString(false),
Mock::interceptRequestString(testReturnUri + "?code=" + QUrl::toPercentEncoding(refreshToken1)),
Mock::interceptRequestBlockedString(true),
Mock::authorizationCallbackReceivedString(refreshToken1),
#endif
Mock::modifyParamsTokenString(testClientId, testReturnUri, refreshToken1),
Mock::networkReplyFinishedString(tokenReplyData),
Mock::replyDataCallbackString(tokenReplyData),
......
......@@ -30,11 +30,7 @@ GoogleAccountManager::GoogleAccountManager(QObject *parent)
: QObject(parent)
, m_isReady(false)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &GoogleAccountManager::initManager, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "initManager", Qt::QueuedConnection);
#endif
}
GoogleAccountManager::~GoogleAccountManager()
......
......@@ -103,11 +103,7 @@ GoogleSettingsDialog::GoogleSettingsDialog(GoogleAccountManager *accountManager,
if (m_enableRefresh->isEnabled()) {
m_refreshSpinBox->setValue(Settings::self()->intervalCheckTime());
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &GoogleSettingsDialog::reloadAccounts, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "reloadAccounts", Qt::QueuedConnection);
#endif
}
GoogleSettingsDialog::~GoogleSettingsDialog()
......
......@@ -149,11 +149,7 @@ void ImapIdleManager::onConnectionLost(KIMAP::Session *session)
// the pointer, we don't need to release it once the
// task is done
m_session = nullptr;
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &ImapIdleManager::reconnect, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "reconnect", Qt::QueuedConnection);
#endif
}
}
......
......@@ -147,11 +147,7 @@ ImapResourceBase::ImapResourceBase(const QString &id)
connect(m_statusMessageTimer, &QTimer::timeout, this, &ImapResourceBase::clearStatusMessage);
connect(this, &AgentBase::error, this, &ImapResourceBase::showError);
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &ImapResourceBase::delayedInit, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "delayedInit", Qt::QueuedConnection);
#endif
}
void ImapResourceBase::delayedInit()
......
......@@ -77,11 +77,7 @@ void RetrieveItemsJob::localListDone(KJob *job)
m_entryIterator = new QDirIterator(m_maildir.pathToNew(), QDir::Files);
m_previousMtime = m_collection.remoteRevision().toLongLong();
m_highestMtime = 0;
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &RetrieveItemsJob::processEntry, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "processEntry", Qt::QueuedConnection);
#endif
}
void RetrieveItemsJob::processEntry()
......@@ -141,11 +137,7 @@ void RetrieveItemsJob::processEntry()
}
if (trx != lastTrx) {
lastTrx = trx;
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &RetrieveItemsJob::processEntry, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "processEntry", Qt::QueuedConnection);
#endif
return;
}
}
......
......@@ -180,13 +180,9 @@ void CompactChangeHelper::addChangedItems(const Item::List &items)
if (updateBatch.collection.isValid()) {
d->mPendingUpdates << updateBatch;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, [this]() {
d->processNextBatch();
}, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "processNextBatch", Qt::QueuedConnection);
#endif
}
QString CompactChangeHelper::currentRemoteId(const Item &item) const
......
......@@ -748,11 +748,7 @@ void MixedMaildirResource::restoreTags(const QVariant &arg)
const TagContextList taggedItems = mTagContextByColId[ collection.id() ];
mPendingTagContexts << taggedItems;
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &MixedMaildirResource::processNextTagContext, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "processNextTagContext", Qt::QueuedConnection);
#endif
taskDone();
}
......
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