From d8772ef13280033c5ecdb78b478fdda22f4b0d15 Mon Sep 17 00:00:00 2001 From: Fanda Vacek Date: Wed, 18 Sep 2024 18:24:02 +0200 Subject: [PATCH] Bring method tool-tip back, update libshv, APP_VERSION "1.9.8" --- 3rdparty/libshv | 2 +- shvspy/src/appversion.h | 2 +- shvspy/src/attributesmodel/attributesmodel.cpp | 8 ++++---- shvspy/src/attributesmodel/attributesmodel.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/3rdparty/libshv b/3rdparty/libshv index 0fbd9d5..4b10bee 160000 --- a/3rdparty/libshv +++ b/3rdparty/libshv @@ -1 +1 @@ -Subproject commit 0fbd9d5ceb20d4805f88aa0f77dadf905cd846a2 +Subproject commit 4b10beefcea3e4bd22354d9b79d1d8689287f299 diff --git a/shvspy/src/appversion.h b/shvspy/src/appversion.h index 4480708..d09519c 100644 --- a/shvspy/src/appversion.h +++ b/shvspy/src/appversion.h @@ -1,4 +1,4 @@ #pragma once -#define APP_VERSION "1.9.7" +#define APP_VERSION "1.9.8" diff --git a/shvspy/src/attributesmodel/attributesmodel.cpp b/shvspy/src/attributesmodel/attributesmodel.cpp index fde9c90..61484d8 100644 --- a/shvspy/src/attributesmodel/attributesmodel.cpp +++ b/shvspy/src/attributesmodel/attributesmodel.cpp @@ -145,10 +145,10 @@ QVariant AttributesModel::data(const QModelIndex &ix, int role) const return is_notify? tr("Method is notify signal"): QVariant(); } if(ix.column() == ColMethodName) { - auto attrs = m_rows[static_cast(ix.row())][ColAttributes].asMap(); + auto mm = shv::chainpack::MetaMethod::fromRpcValue(m_rows[static_cast(ix.row())][ColMetaMethod]); QStringList lines; - for(const auto &kv : attrs) { - lines << tr("%1: %2").arg(kv.first.c_str(), kv.second.toCpon().c_str()); + for(const auto &[k, v] : mm.toMap()) { + lines << tr("%1: %2").arg(k.c_str(), v.toCpon().c_str()); } return lines.join('\n'); } @@ -308,7 +308,7 @@ void AttributesModel::loadRow(unsigned method_ix) rv[ColFlags] = mtd->flagsStr(); rv[ColAccessLevel] = mtd->accessLevelStr(); rv[ColParams] = mtd->params; - rv[ColAttributes] = mtd->metamethod.toRpcValue(); + rv[ColMetaMethod] = mtd->metamethod.toRpcValue(); shvDebug() << "\t response:" << mtd->response.toCpon() << "is valid:" << mtd->response.isValid(); if(mtd->response.isError()) { rv[ColResult] = mtd->response.error().toRpcValue(); diff --git a/shvspy/src/attributesmodel/attributesmodel.h b/shvspy/src/attributesmodel/attributesmodel.h index 43c593e..0b93d82 100644 --- a/shvspy/src/attributesmodel/attributesmodel.h +++ b/shvspy/src/attributesmodel/attributesmodel.h @@ -17,7 +17,7 @@ class AttributesModel : public QAbstractTableModel private: typedef QAbstractTableModel Super; public: - enum Columns {ColMethodName = 0, ColParamType, ColResultType, ColSignals, ColFlags, ColAccessLevel, ColParams, ColResult, ColBtRun, ColError, ColAttributes, ColCnt}; + enum Columns {ColMethodName = 0, ColParamType, ColResultType, ColSignals, ColFlags, ColAccessLevel, ColParams, ColResult, ColBtRun, ColError, ColMetaMethod, ColCnt}; enum Roles {RpcValueRole = Qt::UserRole }; public: AttributesModel(QObject *parent = nullptr);