File indexing completed on 2024-04-28 05:41:40

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 QCachegrind
0011  */
0012 
0013 #ifndef QCGCONFIG_H
0014 #define QCGCONFIG_H
0015 
0016 #include "config.h"
0017 
0018 class QSettings;
0019 class QCGConfigStorage;
0020 
0021 class QCGConfigGroup: public ConfigGroup
0022 {
0023     friend class QCGConfigStorage;
0024 
0025 public:
0026     ~QCGConfigGroup() override;
0027 
0028     void setValue(const QString& key, const QVariant& value,
0029                   const QVariant& defaultValue = QVariant()) override;
0030     QVariant value(const QString& key, const QVariant& defaultValue) const override;
0031 
0032 private:
0033     QCGConfigGroup(QSettings*, QString prefix, bool);
0034 
0035     QSettings* _settings;
0036     QString _prefix;
0037     bool _readOnly;
0038 };
0039 
0040 
0041 class QCGConfigStorage : public ConfigStorage
0042 {
0043 public:
0044     QCGConfigStorage();
0045     ~QCGConfigStorage() override;
0046 
0047 private:
0048     ConfigGroup* getGroup(const QString& group,
0049                           const QString& optSuffix) override;
0050 
0051     QSettings* _settings;
0052 };
0053 
0054 #endif // QCGCONFIG_H