From ec207330d5bd61799a47092bf555a523ab000f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9ven=20Car?= Date: Thu, 5 Mar 2020 10:02:46 +0100 Subject: KconfigXT: Add a value attribute to Enum field choices Summary: Allow to write choices such as : ``` ``` Test Plan: ctest Reviewers: ervin, bport, crossi, #frameworks Reviewed By: ervin Subscribers: ngraham, davidre, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27463 --- src/core/kcoreconfigskeleton.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/kcoreconfigskeleton.h') diff --git a/src/core/kcoreconfigskeleton.h b/src/core/kcoreconfigskeleton.h index 02473fb4..9d84583e 100644 --- a/src/core/kcoreconfigskeleton.h +++ b/src/core/kcoreconfigskeleton.h @@ -802,9 +802,20 @@ public: void writeConfig(KConfig *config) override; // Source compatibility with 4.x + // TODO KF6 remove typedef Choice Choice2; QList choices2() const; + /** + * Returns the value for for the choice with the given name + */ + QString valueForChoice(const QString &name) const; + + /** + * Stores a choice value for name + */ + void setValueForChoice(const QString &name, const QString &valueForChoice); + private: QList mChoices; }; -- cgit v1.2.1