diff options
Diffstat (limited to 'common/resourceconfig.cpp')
-rw-r--r-- | common/resourceconfig.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/resourceconfig.cpp b/common/resourceconfig.cpp index 3554b76..a0f39a8 100644 --- a/common/resourceconfig.cpp +++ b/common/resourceconfig.cpp | |||
@@ -33,6 +33,15 @@ static QSharedPointer<QSettings> getResourceConfig(const QByteArray &identifier) | |||
33 | return QSharedPointer<QSettings>::create(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/akonadi2/" + identifier, QSettings::IniFormat); | 33 | return QSharedPointer<QSettings>::create(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/akonadi2/" + identifier, QSettings::IniFormat); |
34 | } | 34 | } |
35 | 35 | ||
36 | QByteArray ResourceConfig::newIdentifier(const QByteArray &type) | ||
37 | { | ||
38 | auto settings = getSettings(); | ||
39 | const auto counter = settings->value("instanceCounter", 0).toInt() + 1; | ||
40 | const QByteArray identifier = type + ".instance" + QByteArray::number(counter); | ||
41 | settings->setValue("instanceCounter", counter); | ||
42 | settings->sync(); | ||
43 | return identifier; | ||
44 | } | ||
36 | 45 | ||
37 | void ResourceConfig::addResource(const QByteArray &identifier, const QByteArray &type) | 46 | void ResourceConfig::addResource(const QByteArray &identifier, const QByteArray &type) |
38 | { | 47 | { |