change log sandbox/wangzhiqiang/dbus_ws
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Wed, 20 Feb 2019 02:47:29 +0000 (10:47 +0800)
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Wed, 20 Feb 2019 02:47:29 +0000 (10:47 +0800)
Change-Id: Ibf603d51e79b2082d9d0d1442a56246bb0e4865c

launcher/src/applicationmodel.cpp
launcher/src/homescreenhandler.cpp

index a148505..60c2e94 100644 (file)
@@ -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();
 }
index 9035fb1..db63627 100644 (file)
@@ -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)