From 05ec5acfcaf45784b89184ee32ad06156cfd48c0 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Thu, 13 May 2021 10:40:21 +0300 Subject: [PATCH] UI: RPC: Rename signal enums. --- src/ui/control/control.h | 16 ++++++------ src/ui/rpc/rpcmanager.cpp | 54 +++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/src/ui/control/control.h b/src/ui/control/control.h index 30e5458e..10cdec0f 100644 --- a/src/ui/control/control.h +++ b/src/ui/control/control.h @@ -28,14 +28,14 @@ enum Command : qint8 { Rpc_ConfManager_updateZone, Rpc_ConfManager_updateZoneName, Rpc_ConfManager_updateZoneEnabled, - Rpc_ConfManager_onConfChanged, - Rpc_ConfManager_onAppEndTimesUpdated, - Rpc_ConfManager_onAppAdded, - Rpc_ConfManager_onAppRemoved, - Rpc_ConfManager_onAppUpdated, - Rpc_ConfManager_onZoneAdded, - Rpc_ConfManager_onZoneRemoved, - Rpc_ConfManager_onZoneUpdated, + Rpc_ConfManager_confChanged, + Rpc_ConfManager_appEndTimesUpdated, + Rpc_ConfManager_appAdded, + Rpc_ConfManager_appRemoved, + Rpc_ConfManager_appUpdated, + Rpc_ConfManager_zoneAdded, + Rpc_ConfManager_zoneRemoved, + Rpc_ConfManager_zoneUpdated, Rpc_DriverManager_reinstallDriver, Rpc_DriverManager_uninstallDriver, diff --git a/src/ui/rpc/rpcmanager.cpp b/src/ui/rpc/rpcmanager.cpp index ed358a51..9eaebaa4 100644 --- a/src/ui/rpc/rpcmanager.cpp +++ b/src/ui/rpc/rpcmanager.cpp @@ -88,26 +88,24 @@ void RpcManager::setupConfManagerSignals() { connect(confManager(), &ConfManager::confChanged, this, [&](bool /*onlyFlags*/) { const QVariant confVar = confManager()->conf()->toVariant(true); - invokeOnClients(Control::Rpc_ConfManager_onConfChanged, { confVar }); + invokeOnClients(Control::Rpc_ConfManager_confChanged, { confVar }); }); connect(confManager(), &ConfManager::appEndTimesUpdated, this, - [&] { invokeOnClients(Control::Rpc_ConfManager_onAppEndTimesUpdated); }); - connect(confManager(), &ConfManager::appAdded, this, [&](bool alerted) { - invokeOnClients(Control::Rpc_ConfManager_onAppAdded, { alerted }); - }); + [&] { invokeOnClients(Control::Rpc_ConfManager_appEndTimesUpdated); }); + connect(confManager(), &ConfManager::appAdded, this, + [&](bool alerted) { invokeOnClients(Control::Rpc_ConfManager_appAdded, { alerted }); }); connect(confManager(), &ConfManager::appRemoved, this, - [&] { invokeOnClients(Control::Rpc_ConfManager_onAppRemoved); }); + [&] { invokeOnClients(Control::Rpc_ConfManager_appRemoved); }); connect(confManager(), &ConfManager::appUpdated, this, - [&] { invokeOnClients(Control::Rpc_ConfManager_onAppUpdated); }); + [&] { invokeOnClients(Control::Rpc_ConfManager_appUpdated); }); connect(confManager(), &ConfManager::zoneAdded, this, - [&] { invokeOnClients(Control::Rpc_ConfManager_onZoneAdded); }); - connect(confManager(), &ConfManager::zoneRemoved, this, [&](int zoneId) { - invokeOnClients(Control::Rpc_ConfManager_onZoneRemoved, { zoneId }); - }); + [&] { invokeOnClients(Control::Rpc_ConfManager_zoneAdded); }); + connect(confManager(), &ConfManager::zoneRemoved, this, + [&](int zoneId) { invokeOnClients(Control::Rpc_ConfManager_zoneRemoved, { zoneId }); }); connect(confManager(), &ConfManager::zoneUpdated, this, - [&] { invokeOnClients(Control::Rpc_ConfManager_onZoneUpdated); }); + [&] { invokeOnClients(Control::Rpc_ConfManager_zoneUpdated); }); } void RpcManager::setupDriverManagerSignals() @@ -257,14 +255,14 @@ bool RpcManager::processCommandRpc( if (!checkClientValidated(w)) return false; Q_FALLTHROUGH(); - case Control::Rpc_ConfManager_onConfChanged: - case Control::Rpc_ConfManager_onAppEndTimesUpdated: - case Control::Rpc_ConfManager_onAppAdded: - case Control::Rpc_ConfManager_onAppRemoved: - case Control::Rpc_ConfManager_onAppUpdated: - case Control::Rpc_ConfManager_onZoneAdded: - case Control::Rpc_ConfManager_onZoneRemoved: - case Control::Rpc_ConfManager_onZoneUpdated: + case Control::Rpc_ConfManager_confChanged: + case Control::Rpc_ConfManager_appEndTimesUpdated: + case Control::Rpc_ConfManager_appAdded: + case Control::Rpc_ConfManager_appRemoved: + case Control::Rpc_ConfManager_appUpdated: + case Control::Rpc_ConfManager_zoneAdded: + case Control::Rpc_ConfManager_zoneRemoved: + case Control::Rpc_ConfManager_zoneUpdated: return processConfManagerRpc(w, cmd, args); case Control::Rpc_DriverManager_reinstallDriver: @@ -373,30 +371,30 @@ bool RpcManager::processConfManagerRpc( confManager()->updateZoneEnabled( args.value(0).toLongLong(), args.value(1).toBool())); return true; - case Control::Rpc_ConfManager_onConfChanged: + case Control::Rpc_ConfManager_confChanged: if (auto cm = qobject_cast(confManager())) { cm->onConfChanged(args.value(0)); } return true; - case Control::Rpc_ConfManager_onAppEndTimesUpdated: + case Control::Rpc_ConfManager_appEndTimesUpdated: emit confManager()->appEndTimesUpdated(); return true; - case Control::Rpc_ConfManager_onAppAdded: + case Control::Rpc_ConfManager_appAdded: emit confManager()->appAdded(args.value(0).toBool()); return true; - case Control::Rpc_ConfManager_onAppRemoved: + case Control::Rpc_ConfManager_appRemoved: emit confManager()->appRemoved(); return true; - case Control::Rpc_ConfManager_onAppUpdated: + case Control::Rpc_ConfManager_appUpdated: emit confManager()->appUpdated(); return true; - case Control::Rpc_ConfManager_onZoneAdded: + case Control::Rpc_ConfManager_zoneAdded: emit confManager()->zoneAdded(); return true; - case Control::Rpc_ConfManager_onZoneRemoved: + case Control::Rpc_ConfManager_zoneRemoved: emit confManager()->zoneRemoved(args.value(0).toInt()); return true; - case Control::Rpc_ConfManager_onZoneUpdated: + case Control::Rpc_ConfManager_zoneUpdated: emit confManager()->zoneUpdated(); return true; default: