1 | // Copyright (C) 2021 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef QQMLTOOLINGSETTINGS_P_H |
5 | #define QQMLTOOLINGSETTINGS_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtCore/qstring.h> |
19 | #include <QtCore/qhash.h> |
20 | #include <QtCore/qvariant.h> |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class QQmlToolingSettings |
25 | { |
26 | public: |
27 | QQmlToolingSettings(const QString &toolName) : m_toolName(toolName) { } |
28 | |
29 | void addOption(const QString &name, const QVariant defaultValue = QVariant()); |
30 | |
31 | bool writeDefaults() const; |
32 | bool search(const QString &path); |
33 | |
34 | QVariant value(QString name) const; |
35 | bool isSet(QString name) const; |
36 | |
37 | private: |
38 | QString m_toolName; |
39 | QString m_currentSettingsPath; |
40 | QHash<QString, QString> m_seenDirectories; |
41 | QVariantHash m_values; |
42 | |
43 | bool read(const QString &settingsFilePath); |
44 | }; |
45 | |
46 | QT_END_NAMESPACE |
47 | |
48 | #endif // QQMLTOOLINGSETTINGS_P_H |
49 | |