From aa6c56306b90e19e9cd4656e9168a3a178c27a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kubern=C3=A1t?= Date: Mon, 2 Dec 2024 12:28:57 +0100 Subject: [PATCH] Update libshv --- 3rdparty/libshv | 2 +- shvspy/src/mainwindow.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/3rdparty/libshv b/3rdparty/libshv index 05cb2f0..0b6cec1 160000 --- a/3rdparty/libshv +++ b/3rdparty/libshv @@ -1 +1 @@ -Subproject commit 05cb2f01b373c5f025c27db087fa6cbcab2cb8f2 +Subproject commit 0b6cec1f0665d41859ea9285f62fca3d8c13f7cf diff --git a/shvspy/src/mainwindow.cpp b/shvspy/src/mainwindow.cpp index 2f5e125..f61b311 100644 --- a/shvspy/src/mainwindow.cpp +++ b/shvspy/src/mainwindow.cpp @@ -417,7 +417,15 @@ void MainWindow::displayValue(const shv::chainpack::RpcValue &rv) view->setAttribute(Qt::WA_DeleteOnClose); view->setWindowIconText(tr("Result")); view->setReadOnly(true); - auto [blob, size] = rv.asData(); + const char* blob; + size_t size; + if (rv.isString()) { + blob = rv.asString().data(); + size = rv.asString().size(); + } else { + blob = reinterpret_cast(rv.asBlob().data()); + size = rv.asBlob().size(); + } auto data = QByteArray::fromRawData(blob, size); if (rv.isString()) { view->setText(QString::fromUtf8(data));