2 * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "include/appframework.hpp"
19 AppInfo::AppInfo(QObject *parent) :
24 AppInfo::AppInfo(const AppInfo &other) :
25 QObject(other.parent()),
26 name(other.getName()),
27 iconPath(other.getIconPath()),
28 description(other.getDescription())
32 AppInfo& AppInfo::operator=(const AppInfo &other)
34 setParent(other.parent());
35 name = other.getName();
36 iconPath = other.getIconPath();
37 description = other.getDescription();
46 void AppInfo::registerMetaType()
48 qRegisterMetaType<AppInfo>("AppInfo");
49 qDBusRegisterMetaType<AppInfo>();
53 // Marshall the MyStructure data into a D-Bus argument
54 QDBusArgument &operator<<(QDBusArgument &argument, const AppInfo &appInfo)
56 argument.beginStructure();
57 argument << appInfo.name << appInfo.iconPath << appInfo.description;
58 argument.endStructure();
59 qDebug("appInfo.name:<< %s", appInfo.name.toStdString().c_str());
63 // Retrieve the MyStructure data from the D-Bus argument
64 const QDBusArgument &operator>>(const QDBusArgument &argument, AppInfo &appInfo)
66 argument.beginStructure();
67 argument >> appInfo.name >> appInfo.iconPath >> appInfo.description;
68 argument.endStructure();
69 qDebug("appInfo.name:>> %s", appInfo.name.toStdString().c_str());