UI: Add some debug helpers

This commit is contained in:
Nodir Temirkhodjaev 2023-08-26 13:31:28 +05:00
parent c89d82846a
commit 57f2490cfe
4 changed files with 15 additions and 0 deletions

View File

@ -172,6 +172,8 @@ bool ControlManager::processRequest(Control::Command command, const QVariantList
if (Q_UNLIKELY(!w)) if (Q_UNLIKELY(!w))
return false; return false;
// DBG: qCDebug(LC) << "Client requested: id:" << w->id() << command << args.size();
OsUtil::setThreadIsBusy(true); OsUtil::setThreadIsBusy(true);
QString errorMessage; QString errorMessage;

View File

@ -239,6 +239,8 @@ bool ControlWorker::sendCommandData(const QByteArray &commandData)
bool ControlWorker::sendCommand(Control::Command command, const QVariantList &args) bool ControlWorker::sendCommand(Control::Command command, const QVariantList &args)
{ {
// DBG: qCDebug(LC) << "Send Command: id:" << id() << command << args.size();
const QByteArray buffer = buildCommandData(command, args); const QByteArray buffer = buildCommandData(command, args);
if (buffer.isEmpty()) { if (buffer.isEmpty()) {
qCWarning(LC) << "Bad RPC command to send:" << command << args; qCWarning(LC) << "Bad RPC command to send:" << command << args;

View File

@ -2,6 +2,7 @@
#include <QFont> #include <QFont>
#include <QIcon> #include <QIcon>
#include <QLoggingCategory>
#include <sqlite/sqlitedb.h> #include <sqlite/sqlitedb.h>
#include <sqlite/sqlitestmt.h> #include <sqlite/sqlitestmt.h>
@ -15,6 +16,12 @@
#include <util/ioc/ioccontainer.h> #include <util/ioc/ioccontainer.h>
#include <util/net/netutil.h> #include <util/net/netutil.h>
namespace {
const QLoggingCategory LC("connBlockListModel");
}
ConnBlockListModel::ConnBlockListModel(QObject *parent) : ConnBlockListModel::ConnBlockListModel(QObject *parent) :
TableSqlModel(parent), m_resolveAddress(false) TableSqlModel(parent), m_resolveAddress(false)
{ {

View File

@ -673,6 +673,8 @@ bool RpcManager::waitResult()
void RpcManager::sendResult(ControlWorker *w, bool ok, const QVariantList &args) void RpcManager::sendResult(ControlWorker *w, bool ok, const QVariantList &args)
{ {
// DBG: qCDebug(LC) << "Send Result to Client: id:" << w->id() << ok << args.size();
w->sendCommand(ok ? Control::Rpc_Result_Ok : Control::Rpc_Result_Error, args); w->sendCommand(ok ? Control::Rpc_Result_Ok : Control::Rpc_Result_Error, args);
} }
@ -720,6 +722,8 @@ void RpcManager::invokeOnClients(Control::Command cmd, const QVariantList &args)
return; return;
} }
// DBG: qCDebug(LC) << "Invoke On Clients:" << cmd << args.size() << clients.size();
if (!sendCommandDataToClients(buffer, clients)) { if (!sendCommandDataToClients(buffer, clients)) {
qCWarning(LC) << "Invoke on clients error:" << cmd << args; qCWarning(LC) << "Invoke on clients error:" << cmd << args;
} }