Skip to content

Commit

Permalink
Update libshv
Browse files Browse the repository at this point in the history
  • Loading branch information
Fanda Vacek committed Dec 17, 2024
1 parent 81bb5b9 commit 7563879
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion shvspy/src/appversion.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once

#define APP_VERSION "1.10.0"
#define APP_VERSION "1.10.1"

14 changes: 3 additions & 11 deletions shvspy/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,20 +417,12 @@ void MainWindow::displayValue(const shv::chainpack::RpcValue &rv)
view->setAttribute(Qt::WA_DeleteOnClose);
view->setWindowIconText(tr("Result"));
view->setReadOnly(true);
const char* blob;
size_t size;
if (rv.isString()) {
blob = rv.asString().data();
size = rv.asString().size();
} else {
blob = reinterpret_cast<const char*>(rv.asBlob().data());
size = rv.asBlob().size();
}
auto data = QByteArray::fromRawData(blob, size);
if (rv.isString()) {
view->setText(QString::fromUtf8(data));
view->setText(QString::fromStdString(rv.asString()));
}
else {
const auto &blob = rv.asBlob();
auto data = QByteArray::fromRawData(reinterpret_cast<const char*>(blob.data()), blob.size());
view->setBlob(data);
}
view->show();
Expand Down

0 comments on commit 7563879

Please sign in to comment.