2 * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
3 * Copyright (C) 2016 The Qt Company Ltd.
4 * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include <QtCore/QJsonObject>
23 class AppInfo::Private : public QSharedData
27 Private(const Private &other);
40 AppInfo::Private::Private()
46 AppInfo::Private::Private(const Private &other)
49 , version(other.version)
51 , height(other.height)
53 , description(other.description)
54 , shortname(other.shortname)
55 , author(other.author)
56 , iconPath(other.iconPath)
65 AppInfo::AppInfo(const QString &icon, const QString &name, const QString &id)
73 AppInfo::AppInfo(const AppInfo &other)
82 AppInfo &AppInfo::operator =(const AppInfo &other)
88 QString AppInfo::id() const
93 QString AppInfo::version() const
98 int AppInfo::width() const
103 int AppInfo::height() const
108 QString AppInfo::name() const
113 QString AppInfo::description() const
115 return d->description;
118 QString AppInfo::shortname() const
123 QString AppInfo::author() const
128 QString AppInfo::iconPath() const
133 void AppInfo::read(const QJsonObject &json)
135 d->id = json["id"].toString();
136 d->version = json["version"].toString();
137 d->width = json["width"].toInt();
138 d->height = json["height"].toInt();
139 d->name = json["name"].toString();
140 d->description = json["description"].toString();
141 d->shortname = json["shortname"].toString();
142 d->author = json["author"].toString();
143 d->iconPath = json["iconPath"].toString();