From 87169e10cb7ebe732ef388552bb0c057c09767ef Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Fri, 13 Mar 2026 18:20:35 +0100 Subject: Unified socket slots, --wire-debug CLI flag, fix mock TX and disconnect logging Collapse 12 per-socket slots into 4 sender()-based slots. Replace runtime wireDebug QML property with static --wire-debug CLI flag on both demo and mock server. Route MockServer::sendKaPing through sendReply so KA_PING TX shows wire bytes. Simplify sendReply to deduce command token from wire data. Fix Xpl2Client disconnect logging (logTag takes pointer, null-sender fallback). --- demo/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'demo/main.cpp') diff --git a/demo/main.cpp b/demo/main.cpp index 64c4f22..3100254 100644 --- a/demo/main.cpp +++ b/demo/main.cpp @@ -2,6 +2,9 @@ * @file main.cpp * @brief Entry point for the QtXpl2 demo application. */ +#include "Xpl2Client.h" + +#include #include #include @@ -11,8 +14,18 @@ Q_IMPORT_QML_PLUGIN (Xpl2Plugin) int main (int argc, char *argv[]) { + qSetMessagePattern ("Demo [%{time HH:mm:ss.zzz}] %{message}"); + QGuiApplication app (argc, argv); + QCommandLineParser parser; + parser.addOption ({ "wire-debug", "Log raw wire TX/RX to dev log" }); + parser.addHelpOption (); + parser.process (app); + + if (parser.isSet ("wire-debug")) + Xpl2Client::enableWireDebug (); + QQmlApplicationEngine engine; QObject::connect ( &engine, &QQmlApplicationEngine::objectCreationFailed, &app, -- cgit v1.2.3