Commit 8d6f2faa authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Include the resources' author

parent ae8088d0
......@@ -332,6 +332,20 @@ DiscoverPage {
text: versionString()
}
// Author row
Label {
Layout.alignment: Qt.AlignRight
text: i18n("Author:")
visible: authorLabel.visible
}
Label {
id: authorLabel
Layout.fillWidth: true
elide: Text.ElideRight
visible: text.length>0
text: appInfo.application.author
}
// Size row
Label {
Layout.alignment: Qt.AlignRight
......
......@@ -54,6 +54,7 @@ public:
void fetchChangelog() override;
void fetchScreenshots() override;
QUrl url() const override;
QString author() const override { return QStringLiteral("BananaPerson"); }
void setState(State state);
void setSize(int size) { m_size = size; }
void setAddons(const AddonList& addons);
......
......@@ -548,3 +548,8 @@ QString FlatpakResource::sourceIcon() const
{
return QStringLiteral("flatpak-discover");
}
QString FlatpakResource::author() const
{
return m_appdata.developerName();
}
......@@ -124,6 +124,7 @@ public:
FlatpakResource::Id uniqueId() const;
QUrl url() const override;
QDate releaseDate() const override;
QString author() const override;
FlatpakInstallation* installation() const { return m_id.installation; }
......
......@@ -61,6 +61,7 @@ public:
QString executeLabel() const override;
QDate releaseDate() const override { return m_releaseDate; }
QString sourceIcon() const override { return {}; }
QString author() const override { return {}; }
void setDeviceId(const QString &deviceId) { m_deviceID = deviceId; }
void setIsDeviceLocked(bool locked) { m_isDeviceLocked = locked; }
......
......@@ -266,3 +266,8 @@ Rating * KNSResource::ratingInstance()
}
return m_rating;
}
QString KNSResource::author() const
{
return m_entry.author().name();
}
......@@ -55,6 +55,7 @@ public:
void fetchChangelog() override;
QStringList extends() const override;
AbstractResource::Type type() const override { return Addon; }
QString author() const override;
KNSBackend* knsBackend() const;
......
......@@ -239,3 +239,8 @@ QDate AppPackageKitResource::releaseDate() const
return {};
}
QString AppPackageKitResource::author() const
{
return m_appdata.developerName();
}
......@@ -52,6 +52,7 @@ class AppPackageKitResource : public PackageKitResource
bool canExecute() const override { return true; }
QDate releaseDate() const override;
QString changelog() const override;
QString author() const override;
private:
const AppStream::Component m_appdata;
......
......@@ -46,12 +46,12 @@ class PackageKitResource : public AbstractResource
AbstractResource::Type type() const override;
int size() override;
void fetchChangelog() override;
QList<PackageState> addonsInformation() override;
State state() override;
QString installedVersion() const override;
QString availableVersion() const override;
QString author() const override { return {}; }
virtual QStringList allPackageNames() const;
QString installedPackageId() const;
QString availablePackageId() const;
......
......@@ -356,6 +356,11 @@ QString SnapResource::channel() const
return req->error() ? QString() : req->snap()->trackingChannel();
}
QString SnapResource::author() const
{
return m_snap->publisherDisplayName();
}
void SnapResource::setChannel(const QString& channelName)
{
#ifdef SNAP_CHANNELS
......
......@@ -58,6 +58,7 @@ public:
void invokeApplication() const override;
void fetchChangelog() override;
void fetchScreenshots() override;
QString author() const override;
QList<PackageState> addonsInformation() override { return {}; }
void setSnap(const QSharedPointer<QSnapdSnap> &snap);
......
......@@ -78,6 +78,7 @@ class DISCOVERCOMMON_EXPORT AbstractResource : public QObject
Q_PROPERTY(QUrl url READ url CONSTANT)
Q_PROPERTY(QString executeLabel READ executeLabel CONSTANT)
Q_PROPERTY(QString sourceIcon READ sourceIcon CONSTANT)
Q_PROPERTY(QString author READ author CONSTANT)
Q_PROPERTY(QDate releaseDate READ releaseDate NOTIFY stateChanged)
public:
/**
......@@ -155,6 +156,7 @@ class DISCOVERCOMMON_EXPORT AbstractResource : public QObject
virtual QString origin() const = 0;
QString displayOrigin() const;
virtual QString section() = 0;
virtual QString author() const = 0;
///@returns what kind of mime types the resource can consume
virtual QStringList mimetypes() const;
......
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