aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--launcher/src/applicationmodel.cpp3
-rw-r--r--launcher/src/homescreenhandler.cpp26
2 files changed, 27 insertions, 2 deletions
diff --git a/launcher/src/applicationmodel.cpp b/launcher/src/applicationmodel.cpp
index a148505..60c2e94 100644
--- a/launcher/src/applicationmodel.cpp
+++ b/launcher/src/applicationmodel.cpp
@@ -180,7 +180,6 @@ void ApplicationModel::updateApplist(QStringList info)
QString icon = info.at(0);
QString name = info.at(1);
QString id = info.at(2);
- QString appid = id.split('@')[0];
beginResetModel();
if(icon == "") { // uninstall
@@ -195,6 +194,7 @@ void ApplicationModel::updateApplist(QStringList info)
void ApplicationModel::initAppList(QString data)
{
+ HMI_DEBUG("launcher","init application list.");
beginResetModel();
QJsonDocument japps = QJsonDocument::fromJson(data.toUtf8());
for (auto const &app : japps.array()) {
@@ -204,7 +204,6 @@ void ApplicationModel::initAppList(QString data)
auto const icon = get_icon_name(jso);
d->addApp(icon, name, id);
- HMI_DEBUG("launcher","name: %s icon: %s id: %s.", name.toStdString().c_str(), icon.toStdString().c_str(), id.toStdString().c_str());
}
endResetModel();
}
diff --git a/launcher/src/homescreenhandler.cpp b/launcher/src/homescreenhandler.cpp
index 9035fb1..db63627 100644
--- a/launcher/src/homescreenhandler.cpp
+++ b/launcher/src/homescreenhandler.cpp
@@ -59,6 +59,13 @@ void HomescreenHandler::init(int port, const char *token, QLibWindowmanager *qwm
&& json_object_object_get_ex(obj_param, "data", &obj_data)) {
QString oper = json_object_get_string(obj_oper);
if(oper == "uninstall") {
+ /* { "application_id": "launcher",
+ * "type": "application-list-changed",
+ * "parameter":{
+ * "operation": "uninstall",
+ * "data": "onstestapp@0.1"
+ * }
+ * } */
QString id = json_object_get_string(obj_data);
QStringList info;
// icon, name, id
@@ -66,6 +73,25 @@ void HomescreenHandler::init(int port, const char *token, QLibWindowmanager *qwm
emit appListUpdate(info);
}
else if(oper == "install") {
+ /* { "application_id": "launcher",
+ * "type": "application-list-changed",
+ * "parameter": {
+ * "operation": "install",
+ * "data": {
+ * "description":"This is a demo onstestapp application",
+ * "name": "onstestapp",
+ * "shortname": "",
+ * "id": "onstestapp@0.1",
+ * "version": "0.1",
+ * "author": "Qt",
+ * "author-email": "",
+ * "width": "",
+ * "height": "",
+ * "icon": "\/var\/local\/lib\/afm\/applications\/onstestapp\/0.1\/icon.svg",
+ * "http-port": 31022
+ * }
+ * }
+ * } */
struct json_object *obj_icon, *obj_name, *obj_id;
if(json_object_object_get_ex(obj_data, "icon", &obj_icon)
&& json_object_object_get_ex(obj_data, "name", &obj_name)