diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-27 16:13:47 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-27 16:13:47 +0200 |
commit | 529db49c496f4f668cec3f7c59d2d0ec78c50c9a (patch) | |
tree | b7622a54b4063f4dc735a8b4061525148377b6c9 /common/resourceconfig.cpp | |
parent | 577c2c344079c1a87d3d93be5f957e5f2d935bff (diff) | |
download | sink-529db49c496f4f668cec3f7c59d2d0ec78c50c9a.tar.gz sink-529db49c496f4f668cec3f7c59d2d0ec78c50c9a.zip |
Don't hardcode the type property.
Diffstat (limited to 'common/resourceconfig.cpp')
-rw-r--r-- | common/resourceconfig.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/resourceconfig.cpp b/common/resourceconfig.cpp index 39f9ddb..68ac0bc 100644 --- a/common/resourceconfig.cpp +++ b/common/resourceconfig.cpp | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <QFile> | 23 | #include <QFile> |
24 | #include <log.h> | 24 | #include <log.h> |
25 | #include <definitions.h> | 25 | #include <definitions.h> |
26 | #include <applicationdomaintype.h> | ||
26 | 27 | ||
27 | static QSharedPointer<QSettings> getConfig(const QByteArray &identifier) | 28 | static QSharedPointer<QSettings> getConfig(const QByteArray &identifier) |
28 | { | 29 | { |
@@ -43,7 +44,7 @@ void ResourceConfig::addResource(const QByteArray &identifier, const QByteArray | |||
43 | { | 44 | { |
44 | auto settings = getConfig("resources"); | 45 | auto settings = getConfig("resources"); |
45 | settings->beginGroup(QString::fromLatin1(identifier)); | 46 | settings->beginGroup(QString::fromLatin1(identifier)); |
46 | settings->setValue("type", type); | 47 | settings->setValue(Sink::ApplicationDomain::SinkResource::ResourceType::name, type); |
47 | settings->endGroup(); | 48 | settings->endGroup(); |
48 | settings->sync(); | 49 | settings->sync(); |
49 | } | 50 | } |
@@ -64,7 +65,7 @@ QMap<QByteArray, QByteArray> ResourceConfig::getResources() | |||
64 | auto settings = getConfig("resources"); | 65 | auto settings = getConfig("resources"); |
65 | for (const auto &identifier : settings->childGroups()) { | 66 | for (const auto &identifier : settings->childGroups()) { |
66 | settings->beginGroup(identifier); | 67 | settings->beginGroup(identifier); |
67 | const auto type = settings->value("type").toByteArray(); | 68 | const auto type = settings->value(Sink::ApplicationDomain::SinkResource::ResourceType::name).toByteArray(); |
68 | resources.insert(identifier.toLatin1(), type); | 69 | resources.insert(identifier.toLatin1(), type); |
69 | settings->endGroup(); | 70 | settings->endGroup(); |
70 | } | 71 | } |