Commit 8ba67a1f authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

kns: Remove code to support a KF5 version older than our minimum supported

Now we are depending on 5.94.
parent d97c9d0f
......@@ -95,10 +95,6 @@ KNSBackend::KNSBackend(QObject *parent, const QString &iconName, const QString &
const KConfigGroup group = conf.group("KNewStuff3");
m_extends = group.readEntry("Extends", QStringList());
#if KNEWSTUFFCORE_VERSION < QT_VERSION_CHECK(5, 92, 0)
m_reviews->setProviderUrl(QUrl(group.readEntry("ProvidersUrl", QString())));
#endif
setFetching(true);
// This ensures we have something to track when checking after the initialization timeout
......
......@@ -18,21 +18,6 @@
#include <attica/providermanager.h>
#include <resources/AbstractResource.h>
class SharedManager : public QObject
{
Q_OBJECT
public:
SharedManager()
{
atticaManager.loadDefaultProviders();
}
public:
Attica::ProviderManager atticaManager;
};
Q_GLOBAL_STATIC(SharedManager, s_shared)
KNSReviews::KNSReviews(KNSBackend *backend)
: AbstractReviewsBackend(backend)
, m_backend(backend)
......@@ -179,31 +164,15 @@ QString KNSReviews::userName() const
return user;
}
void KNSReviews::setProviderUrl(const QUrl &url)
{
#if KNEWSTUFFCORE_VERSION < QT_VERSION_CHECK(5, 92, 0)
m_providerUrl = url;
if (!m_providerUrl.isEmpty() && !s_shared->atticaManager.providerFiles().contains(url)) {
s_shared->atticaManager.addProviderFile(url);
}
#endif
}
Attica::Provider KNSReviews::provider() const
{
#if KNEWSTUFFCORE_VERSION < QT_VERSION_CHECK(5, 92, 0)
return s_shared->atticaManager.providerFor(m_providerUrl);
#else
if (m_backend->engine()->atticaProviders().isEmpty()) {
return {};
}
return *m_backend->engine()->atticaProviders().constFirst();
#endif
}
bool KNSReviews::isResourceSupported(AbstractResource *res) const
{
return qobject_cast<KNSResource *>(res);
}
#include "KNSReviews.moc"
......@@ -37,7 +37,6 @@ public:
bool hasCredentials() const override;
QString userName() const override;
void setProviderUrl(const QUrl &url);
bool isResourceSupported(AbstractResource *res) const override;
private Q_SLOTS:
......@@ -50,9 +49,6 @@ private:
KNSBackend *const m_backend;
int m_fetching = 0;
#if KNEWSTUFFCORE_VERSION < QT_VERSION_CHECK(5, 92, 0)
QUrl m_providerUrl;
#endif
};
#endif // KNSREVIEWS_H
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