diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-04-13 14:48:20 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-04-14 22:26:39 +0300 |
commit | 7ad4b093049453a54e4e0711d9e73ea693b85eea (patch) | |
tree | cb90acc0f07a3ca3c2b6c85a7c29c693327af732 /app/onscreenmodel.cpp | |
parent | 69ab2870ea1fbac6808dac791e141f3009e98724 (diff) |
app/: Fixes and some monior tweaks to the qml file
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Diffstat (limited to 'app/onscreenmodel.cpp')
-rw-r--r-- | app/onscreenmodel.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
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()); } |