summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2017-02-10 13:05:24 (GMT)
committerAleix Pol <aleixpol@kde.org>2017-02-10 13:05:24 (GMT)
commit1a5a9b5f1fa6ead2e3c4f50f1fb0b16e1ac14394 (patch)
tree275080be22f82882ffa978bf02b38defe7ce2bb6
parent50c2262db128718add60ce8683f5b11fe850b93e (diff)
Improve local packages display on local packages
CCBUG: 376276
-rw-r--r--libdiscover/backends/PackageKitBackend/LocalFilePKResource.cpp11
-rw-r--r--libdiscover/backends/PackageKitBackend/LocalFilePKResource.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/libdiscover/backends/PackageKitBackend/LocalFilePKResource.cpp b/libdiscover/backends/PackageKitBackend/LocalFilePKResource.cpp
index 6b65d5f..044d4b6 100644
--- a/libdiscover/backends/PackageKitBackend/LocalFilePKResource.cpp
+++ b/libdiscover/backends/PackageKitBackend/LocalFilePKResource.cpp
@@ -33,3 +33,14 @@ int LocalFilePKResource::size()
const QFileInfo info(m_path.toLocalFile());
return info.size();
}
+
+QString LocalFilePKResource::name()
+{
+ const QFileInfo info(m_path.toLocalFile());
+ return info.baseName();
+}
+
+QString LocalFilePKResource::comment()
+{
+ return m_path.toLocalFile();
+}
diff --git a/libdiscover/backends/PackageKitBackend/LocalFilePKResource.h b/libdiscover/backends/PackageKitBackend/LocalFilePKResource.h
index 9b35afe..b238b7e 100644
--- a/libdiscover/backends/PackageKitBackend/LocalFilePKResource.h
+++ b/libdiscover/backends/PackageKitBackend/LocalFilePKResource.h
@@ -29,6 +29,9 @@ class LocalFilePKResource : public PackageKitResource
public:
LocalFilePKResource(QUrl path, PackageKitBackend* parent);
+ QString name() override;
+ QString comment() override;
+
QString availableVersion() const override { return QStringLiteral(" "); }
AbstractResource::State state() override { return m_state; }
int size() override;