Commit dc74ef75 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Remove a bunch of unused API

parent e829908a
......@@ -119,16 +119,6 @@ QString DummyResource::packageName() const
return m_name;
}
QUrl DummyResource::screenshotUrl()
{
return m_screenshots.at(0);
}
QUrl DummyResource::thumbnailUrl()
{
return m_screenshotThumbnails.at(0);
}
QString DummyResource::section()
{
return QStringLiteral("dummy");
......
......@@ -38,8 +38,6 @@ public:
QString installedVersion() const override;
QString license() override;
int size() override;
QUrl screenshotUrl() override;
QUrl thumbnailUrl() override;
QUrl homepage() override;
QStringList categories() override;
AbstractResource::State state() override;
......
......@@ -328,11 +328,6 @@ static QUrl screenshot(AppStream::Component *comp, AppStream::Image::Kind kind)
return ret;
}
QUrl FlatpakResource::screenshotUrl()
{
return screenshot(m_appdata, AppStream::Image::KindSource);
}
QString FlatpakResource::section()
{
return QString();
......@@ -374,11 +369,6 @@ AbstractResource::State FlatpakResource::state()
return m_state;
}
QUrl FlatpakResource::thumbnailUrl()
{
return screenshot(m_appdata, AppStream::Image::KindThumbnail);
}
FlatpakResource::ResourceType FlatpakResource::type() const
{
return m_type;
......
......@@ -95,12 +95,10 @@ public:
PropertyState propertyState(PropertyKind kind) const;
QUrl resourceFile() const;
QString runtime() const;
QUrl screenshotUrl() override;
QString section() override;
int size() override;
QString sizeDescription() override;
AbstractResource::State state() override;
QUrl thumbnailUrl() override;
ResourceType type() const;
QString typeAsString() const;
QString uniqueId() const;
......
......@@ -114,16 +114,6 @@ QUrl KNSResource::homepage()
return m_entry.homepage();
}
QUrl KNSResource::thumbnailUrl()
{
return QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall1));
}
QUrl KNSResource::screenshotUrl()
{
return QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewBig1));
}
void KNSResource::setEntry(const KNSCore::EntryInternal& entry)
{
const bool diff = entry.status() != m_entry.status();
......
......@@ -42,8 +42,6 @@ public:
QString packageName() const override;
QStringList categories() override;
QUrl homepage() override;
QUrl thumbnailUrl() override;
QUrl screenshotUrl() override;
QString license() override;
QString longDescription() override;
QList<PackageState> addonsInformation() override { return QList<PackageState>(); }
......
......@@ -96,8 +96,6 @@ void KNSBackendTest::testRetrieval()
QVERIFY(res->homepage().isValid() && !res->homepage().isEmpty());
QVERIFY(res->state() > AbstractResource::Broken);
QVERIFY(res->addonsInformation().isEmpty());
QVERIFY(res->thumbnailUrl().isValid() || res->thumbnailUrl().isEmpty());
QVERIFY(res->screenshotUrl().isValid() || res->screenshotUrl().isEmpty());
QSignalSpy spy(res, &AbstractResource::screenshotsFetched);
res->fetchScreenshots();
......
......@@ -154,16 +154,6 @@ static QUrl screenshot(const AppStream::Component& comp, AppStream::Image::Kind
return ret;
}
QUrl AppPackageKitResource::screenshotUrl()
{
return screenshot(m_appdata, AppStream::Image::KindSource);
}
QUrl AppPackageKitResource::thumbnailUrl()
{
return screenshot(m_appdata, AppStream::Image::KindThumbnail);
}
void AppPackageKitResource::fetchScreenshots()
{
QList<QUrl> thumbnails, screenshots;
......
......@@ -42,8 +42,6 @@ class AppPackageKitResource : public PackageKitResource
QStringList executables() const override;
QString comment() override;
QString license() override;
QUrl screenshotUrl() override;
QUrl thumbnailUrl() override;
QStringList allPackageNames() const override;
QList<PackageState> addonsInformation() override;
QStringList extends() const override;
......
......@@ -129,16 +129,6 @@ QString PackageKitResource::section()
return QString();
}
QUrl PackageKitResource::screenshotUrl()
{
return {};
}
QUrl PackageKitResource::thumbnailUrl()
{
return {};
}
AbstractResource::State PackageKitResource::state()
{
if (backend()->isPackageNameUpgradeable(this))
......
......@@ -49,9 +49,6 @@ class PackageKitResource : public AbstractResource
QList<PackageState> addonsInformation() override;
State state() override;
QUrl screenshotUrl() override;
QUrl thumbnailUrl() override;
QString installedVersion() const override;
QString availableVersion() const override;
virtual QStringList allPackageNames() const;
......
......@@ -114,16 +114,6 @@ QString SnapResource::packageName() const
return m_snap->name();
}
QUrl SnapResource::screenshotUrl()
{
return {};
}
QUrl SnapResource::thumbnailUrl()
{
return {};
}
QString SnapResource::section()
{
return QStringLiteral("snap");
......
......@@ -40,8 +40,6 @@ public:
QString installedVersion() const override;
QString license() override;
int size() override;
QUrl screenshotUrl() override;
QUrl thumbnailUrl() override;
QUrl homepage() override;
QStringList categories() override;
AbstractResource::State state() override;
......
......@@ -78,13 +78,7 @@ bool AbstractResource::isInstalled()
void AbstractResource::fetchScreenshots()
{
QList<QUrl> thumbs, screens;
QUrl thumbnail = thumbnailUrl();
if(!thumbnail.isEmpty()) {
thumbs << thumbnail;
screens << screenshotUrl();
}
emit screenshotsFetched(thumbs, screens);
emit screenshotsFetched({}, {});
}
QStringList AbstractResource::mimetypes() const
......
......@@ -56,8 +56,6 @@ class DISCOVERCOMMON_EXPORT AbstractResource : public QObject
Q_PROPERTY(QStringList category READ categories CONSTANT)
Q_PROPERTY(bool isTechnical READ isTechnical CONSTANT)
Q_PROPERTY(QUrl homepage READ homepage CONSTANT)
Q_PROPERTY(QUrl thumbnailUrl READ thumbnailUrl CONSTANT)
Q_PROPERTY(QUrl screenshotUrl READ screenshotUrl CONSTANT)
Q_PROPERTY(bool canUpgrade READ canUpgrade NOTIFY stateChanged)
Q_PROPERTY(bool isInstalled READ isInstalled NOTIFY stateChanged)
Q_PROPERTY(QString license READ license CONSTANT)
......@@ -131,9 +129,6 @@ class DISCOVERCOMMON_EXPORT AbstractResource : public QObject
virtual bool isTechnical() const;
virtual QUrl thumbnailUrl() = 0;
virtual QUrl screenshotUrl() = 0;
virtual int size() = 0;
virtual QString sizeDescription();
virtual QString license() = 0;
......
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