File indexing completed on 2024-04-28 05:41:22
0001 /* 0002 This file is part of KCachegrind. 0003 0004 SPDX-FileCopyrightText: 2002-2016 Josef Weidendorfer <Josef.Weidendorfer@gmx.de> 0005 0006 SPDX-License-Identifier: GPL-2.0-only 0007 */ 0008 0009 /* 0010 * Configuration for KCachegrind 0011 */ 0012 0013 #ifndef KDECONFIG_H 0014 #define KDECONFIG_H 0015 0016 #include "config.h" 0017 0018 class KConfig; 0019 class KConfigGroup; 0020 class KDEConfigStorage; 0021 0022 class KDEConfigGroup: public ConfigGroup 0023 { 0024 friend class KDEConfigStorage; 0025 0026 public: 0027 ~KDEConfigGroup() override; 0028 0029 void setValue(const QString& key, const QVariant& value, 0030 const QVariant& defaultValue = QVariant()) override; 0031 QVariant value(const QString& key, const QVariant& defaultValue) const override; 0032 0033 private: 0034 KDEConfigGroup(KConfigGroup*, bool); 0035 0036 KConfigGroup* _kgroup; 0037 bool _readOnly; 0038 }; 0039 0040 0041 class KDEConfigStorage : public ConfigStorage 0042 { 0043 public: 0044 KDEConfigStorage(KConfig*); 0045 0046 private: 0047 ConfigGroup* getGroup(const QString& group, 0048 const QString& optSuffix) override; 0049 0050 KConfig* _kconfig; 0051 }; 0052 0053 #endif