diff options
author | Robert Griebl <robert.griebl@qt.io> | 2019-10-19 00:15:08 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2019-11-07 16:42:13 +0100 |
commit | a69651ca9b3cccc4f48dfa5695498149d6bfdc43 (patch) | |
tree | a61d73a0abc23742a3721a5d0e21cf6f426753e3 /src/main-lib/configuration_p.h | |
parent | 18bf370fb0e510fb3ed516818f793523153204bb (diff) | |
download | qtapplicationmanager-a69651ca9b3cccc4f48dfa5695498149d6bfdc43.tar.gz |
Fully transparent and generic cache for config and app database
The existing caching mechanism for config files was abstracted and extended, so
that it could be re-used to parse and cache the info.yaml files. This results
in a much more robust application database and should get rid of 99.9% of all
the -r/--recreate-database option usages.
Change-Id: Ic37fcd3b0e55d481712d469b6e331b9c433a9c5d
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Diffstat (limited to 'src/main-lib/configuration_p.h')
-rw-r--r-- | src/main-lib/configuration_p.h | 171 |
1 files changed, 171 insertions, 0 deletions
diff --git a/src/main-lib/configuration_p.h b/src/main-lib/configuration_p.h new file mode 100644 index 00000000..e97f9f2f --- /dev/null +++ b/src/main-lib/configuration_p.h @@ -0,0 +1,171 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Application Manager. +** +** $QT_BEGIN_LICENSE:LGPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite 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 The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/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 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: LGPL-3.0 +** +****************************************************************************/ + +#pragma once + +#include <QtAppManCommon/global.h> +#include <QStringList> +#include <QVariantMap> +#include <QVector> +#include <QSet> + +QT_FORWARD_DECLARE_CLASS(QIODevice) + +QT_BEGIN_NAMESPACE_AM + + +// IMPORTANT: if you add/remove/change anything in this struct, you also have to adjust the +// loadFromCache(), saveToCache() and mergeFrom() functions in the cpp file! + +struct ConfigurationData +{ + static ConfigurationData *loadFromSource(QIODevice *source, const QString &fileName); + static QByteArray substituteVars(const QByteArray &sourceContent, const QString &fileName, + QStringList *deploymentWarnings = nullptr); + static ConfigurationData *loadFromCache(QDataStream &ds); + void saveToCache(QDataStream &ds) const; + void mergeFrom(const ConfigurationData *from); + + + struct Runtimes { + QVariantMap configurations; + } runtimes; + + struct { + QVariantMap configurations; + QList<QPair<QString, QString>> selection; + } containers; + + struct { + bool disable = false; + struct { + int disambiguation = 10000; + int startApplication = 3000; + int replyFromApplication = 5000; + int replyFromSystem = 20000; + } timeouts; + } intents; + + struct { + QStringList startup; + QStringList container; + } plugins; + + struct { + struct { + QString id; + QString description; + } dlt; + QStringList rules; + QString messagePattern; + QVariant useAMConsoleLogger; // true / false / invalid + } logging; + + struct { + bool disable = false; + QStringList caCertificates; + struct { + int minUserId = -1; + int maxUserId = -1; + int commonGroupId = -1; + } applicationUserIdSeparation; + } installer; + + struct { + QVariantMap policies; + QVariantMap registrations; + } dbus; + + struct { + double idleLoad = 0.; + int runtimesPerContainer = 0; + } quicklaunch; + + struct { + QVariantMap opengl; + bool enableTouchEmulation = false; + QStringList iconThemeSearchPaths; + QString iconThemeName; + QString style; + bool loadDummyData = false; + QStringList importPaths; + QStringList pluginPaths; + QString windowIcon; + bool fullscreen = false; + QString mainQml; + QStringList resources; + } ui; + + struct { + QStringList builtinAppsManifestDir; + QString installationDir; + QString documentDir; + } applications; // TODO: rename to package? + + QVariantList installationLocations; + + QVariantMap crashAction; + QVariantMap systemProperties; + + struct { + bool forceSingleProcess = false; + bool forceMultiProcess = false; + bool noSecurity = false; + bool developmentMode = false; + bool noUiWatchdog = false; + } flags; + + // command-line only: + struct { + QString waylandSocketName; + bool noFullscreen = false; + bool verbose = false; + bool slowAnimations = false; + bool noDltLogging = false; + bool singlePackage = false; + bool qmlDebug = false; + bool touchEmulation = false; + } commandLine; +}; + +QT_END_NAMESPACE_AM |