mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Various Fixes/Updates (#1549)
* Update FindWindowsSDK.cmake * cmake support libcec without version * Ensure Light-Ids are strings * Fix type - do not have dbus as requried * Fixing #1544 * Cleanup * CleanupFix #1551 * Consistently return instance number with JSON replies (#1504) * hyperion-remote- Fix extracting reply for configGet request * Qt 6.6 - Fix iterator finds * Fix test_image2ledsmap * Ensure window.currentHyperionInstanceName is set, cleanup system/log clipboard report * Address protobuf cmake warning * Update License * Update ChangeLog * Address CodeQL and clang findings
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
#include <grabber/QtGrabber.h>
|
||||
|
||||
#include <utils/WeakConnect.h>
|
||||
|
||||
#if defined(ENABLE_MF)
|
||||
#include <grabber/MFGrabber.h>
|
||||
#elif defined(ENABLE_V4L2)
|
||||
@@ -1453,7 +1455,7 @@ void JsonAPI::handleAuthorizeCommand(const QJsonObject &message, const QString &
|
||||
void JsonAPI::handleInstanceCommand(const QJsonObject &message, const QString &command, int tan)
|
||||
{
|
||||
const QString &subc = message["subcommand"].toString();
|
||||
const quint8 &inst = message["instance"].toInt();
|
||||
const quint8 &inst = static_cast<quint8>(message["instance"].toInt());
|
||||
const QString &name = message["name"].toString();
|
||||
|
||||
if (subc == "switchTo")
|
||||
@@ -1471,7 +1473,12 @@ void JsonAPI::handleInstanceCommand(const QJsonObject &message, const QString &c
|
||||
|
||||
if (subc == "startInstance")
|
||||
{
|
||||
connect(this, &API::onStartInstanceResponse, [=] (const int &tan) { sendSuccessReply(command + "-" + subc, tan); });
|
||||
//Only send update once
|
||||
weakConnect(this, &API::onStartInstanceResponse, [this, command, subc] (int tan)
|
||||
{
|
||||
sendSuccessReply(command + "-" + subc, tan);
|
||||
});
|
||||
|
||||
if (!API::startInstance(inst, tan))
|
||||
sendErrorReply("Can't start Hyperion instance index " + QString::number(inst), command + "-" + subc, tan);
|
||||
|
||||
@@ -1825,6 +1832,7 @@ void JsonAPI::sendSuccessReply(const QString &command, int tan)
|
||||
{
|
||||
// create reply
|
||||
QJsonObject reply;
|
||||
reply["instance"] = _hyperion->getInstanceIndex();
|
||||
reply["success"] = true;
|
||||
reply["command"] = command;
|
||||
reply["tan"] = tan;
|
||||
@@ -1836,6 +1844,7 @@ void JsonAPI::sendSuccessReply(const QString &command, int tan)
|
||||
void JsonAPI::sendSuccessDataReply(const QJsonDocument &doc, const QString &command, int tan)
|
||||
{
|
||||
QJsonObject reply;
|
||||
reply["instance"] = _hyperion->getInstanceIndex();
|
||||
reply["success"] = true;
|
||||
reply["command"] = command;
|
||||
reply["tan"] = tan;
|
||||
@@ -1851,6 +1860,7 @@ void JsonAPI::sendErrorReply(const QString &error, const QString &command, int t
|
||||
{
|
||||
// create reply
|
||||
QJsonObject reply;
|
||||
reply["instance"] = _hyperion->getInstanceIndex();
|
||||
reply["success"] = false;
|
||||
reply["error"] = error;
|
||||
reply["command"] = command;
|
||||
|
Reference in New Issue
Block a user