summaryrefslogtreecommitdiffstats
path: root/common/resource.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-15 17:26:59 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-15 17:26:59 +0100
commit7bd037fae43c963d5f67e9447b3ee6875591a2c7 (patch)
treee2537369bb21d12e77668f0b2e878cffc1b9b423 /common/resource.cpp
parent20b4d255509d5a490619afef50e49477ea09c71d (diff)
downloadsink-7bd037fae43c963d5f67e9447b3ee6875591a2c7.tar.gz
sink-7bd037fae43c963d5f67e9447b3ee6875591a2c7.zip
Don't set capabilities as property on creation.
Instead we make it part of the plugin. This ensure we also have access to the proper capabilities when creating a resource via sinksh.
Diffstat (limited to 'common/resource.cpp')
-rw-r--r--common/resource.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/common/resource.cpp b/common/resource.cpp
index 533a132..32a92ca 100644
--- a/common/resource.cpp
+++ b/common/resource.cpp
@@ -55,19 +55,20 @@ void Resource::setLowerBoundRevision(qint64 revision)
55class ResourceFactory::Private 55class ResourceFactory::Private
56{ 56{
57public: 57public:
58 QByteArrayList capabilities;
58 static QHash<QString, QPointer<ResourceFactory>> s_loadedFactories; 59 static QHash<QString, QPointer<ResourceFactory>> s_loadedFactories;
59}; 60};
60 61
61QHash<QString, QPointer<ResourceFactory>> ResourceFactory::Private::s_loadedFactories; 62QHash<QString, QPointer<ResourceFactory>> ResourceFactory::Private::s_loadedFactories;
62 63
63ResourceFactory::ResourceFactory(QObject *parent) : QObject(parent), d(0) 64ResourceFactory::ResourceFactory(QObject *parent, const QByteArrayList &capabilities) : QObject(parent), d(new ResourceFactory::Private)
64{ 65{
65 Q_UNUSED(d); 66 d->capabilities = capabilities;
66} 67}
67 68
68ResourceFactory::~ResourceFactory() 69ResourceFactory::~ResourceFactory()
69{ 70{
70 // delete d; 71 delete d;
71} 72}
72 73
73ResourceFactory *ResourceFactory::load(const QByteArray &resourceName) 74ResourceFactory *ResourceFactory::load(const QByteArray &resourceName)
@@ -117,6 +118,11 @@ ResourceFactory *ResourceFactory::load(const QByteArray &resourceName)
117 return nullptr; 118 return nullptr;
118} 119}
119 120
121QByteArrayList ResourceFactory::capabilities() const
122{
123 return d->capabilities;
124}
125
120} // namespace Sink 126} // namespace Sink
121 127
122// Ignore warning I don't know how to fix in a moc file 128// Ignore warning I don't know how to fix in a moc file