diff options
author | kh1 <karsten.heimrich@digia.com> | 2012-10-25 12:39:28 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2012-10-25 17:45:54 +0200 |
commit | 597118b2a2736e7c5696025b6ac89c576ca31268 (patch) | |
tree | 49522d88d5ef1f6d1fcccc481d2bc69249077c15 /src/libs/installer/packagemanagercoredata.h | |
parent | 7f6fb7e915d742216aca9a6a5b06ab0b5c4c0fe5 (diff) |
Have a new class to control user set value access.
Since both the settings object and the core engine hold user
set'able values, we need to channel access thru a common object.
Change-Id: I4583a8ee4639cd204a778ee125b19f69a1def710
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'src/libs/installer/packagemanagercoredata.h')
-rw-r--r-- | src/libs/installer/packagemanagercoredata.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/libs/installer/packagemanagercoredata.h b/src/libs/installer/packagemanagercoredata.h new file mode 100644 index 000000000..be7cac865 --- /dev/null +++ b/src/libs/installer/packagemanagercoredata.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Installer Framework. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef PACKAGEMANAGERCOREDATA_H +#define PACKAGEMANAGERCOREDATA_H + +#include "settings.h" + +namespace QInstaller { + +class PackageManagerCoreData +{ +public: + PackageManagerCoreData() {} + explicit PackageManagerCoreData(const QHash<QString, QString> &variables); + + void clear(); + + Settings &settings() const; + QList<QString> keys() const; + + bool contains(const QString &key) const; + bool setValue(const QString &key, const QString &normalizedValue); + QVariant value(const QString &key, const QVariant &_default = QVariant()) const; + + QString replaceVariables(const QString &str) const; + QByteArray replaceVariables(const QByteArray &ba) const; + +private: + mutable Settings m_settings; + QHash<QString, QString> m_variables; +}; + +} // namespace QInstaller + +#endif // PACKAGEMANAGERCOREDATA_H |