From 98dab0eebc3dc0f567be3f80ab129cbcc71738db Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Mon, 13 Apr 2020 14:48:20 +0300 Subject: app: Fixes and some monior tweaks to the qml file - app.pro: Remove depends on windowmanager and homescreen when building - app: Fake an event - adjust the window size - add the app state events Signed-off-by: Marius Vlad --- app/onscreenmodel.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'app/onscreenmodel.cpp') diff --git a/app/onscreenmodel.cpp b/app/onscreenmodel.cpp index 184d1a6..c36f0e9 100644 --- a/app/onscreenmodel.cpp +++ b/app/onscreenmodel.cpp @@ -27,34 +27,38 @@ const char _buttons[] = "buttons"; void OnScreenModel::setModel(QVariant data) { - HMI_DEBUG(_modelName, "setModel start!"); + fprintf(stderr, "OnScreenModel::setModel: setModel start!\n"); + clearModel(); struct json_object *j_title = nullptr, *j_type = nullptr, *j_contents = nullptr, *j_buttons = nullptr; struct json_object *j_param = json_tokener_parse(data.toString().toStdString().c_str()); + + fprintf(stderr, "OnScreenModel::setModel receiving end: %s\n", data.toString().toStdString().c_str()); + if(json_object_object_get_ex(j_param, _title, &j_title)) { m_title = json_object_get_string(j_title); } else { - HMI_DEBUG(_modelName, "title input is null"); + fprintf(stderr, "OnScreenModel::setModel: title input is null\n"); } if(json_object_object_get_ex(j_param, _type, &j_type)) { m_type = json_object_get_string(j_type); } else { - HMI_DEBUG(_modelName, "type input is null"); + fprintf(stderr, "OnScreenModel::setModel: type input is null\n"); } if(json_object_object_get_ex(j_param, _contents, &j_contents)) { m_contents = json_object_get_string(j_contents); } else { - HMI_DEBUG(_modelName, "contents input is null"); + fprintf(stderr, "OnScreenModel::setModel: contents input is null\n"); } if(json_object_object_get_ex(j_param, _buttons, &j_buttons)) { if(json_object_get_type(j_buttons) != json_type_array) { - HMI_DEBUG(_modelName, "buttons josn type isn't array!"); + fprintf(stderr, "OnScreenModel::setModel buttons josn type isn't array!\n"); } else { m_buttons.clear(); @@ -67,9 +71,10 @@ void OnScreenModel::setModel(QVariant data) } } else { - HMI_DEBUG("OnScreenModel", "buttons input is null"); + fprintf(stderr, "OnScreenModel::setModel: buttons input is null\n"); } - HMI_DEBUG(_modelName, "setModel end!titile=%s,type=%s,contents=%s,btnNum=%d", + + fprintf(stderr, "OnScreenModel::setModel setModel end!titile=%s,type=%s,contents=%s,btnNum=%d\n", m_title.toStdString().c_str(), m_type.toStdString().c_str(), m_contents.toStdString().c_str(), m_buttons.size()); } -- cgit 1.2.3-korg