From 1968669a398f0dc3687e0b5418227b984a7215f3 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Mon, 4 Aug 2025 10:31:16 -0400 Subject: [PATCH] refactor: App make m_bye private access it from the method bye --- src/lib/deskflow/App.h | 2 +- src/lib/deskflow/ClientApp.cpp | 8 ++++---- src/lib/deskflow/ServerApp.cpp | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib/deskflow/App.h b/src/lib/deskflow/App.h index 66378db73..208d6e90d 100644 --- a/src/lib/deskflow/App.h +++ b/src/lib/deskflow/App.h @@ -113,9 +113,9 @@ public: protected: void runEventsLoop(void *); - void (*m_bye)(int); private: + void (*m_bye)(int); IEventQueue *m_events = nullptr; deskflow::ArgsBase *m_args; static App *s_instance; diff --git a/src/lib/deskflow/ClientApp.cpp b/src/lib/deskflow/ClientApp.cpp index 0fdeaa97a..e4c4cdebd 100644 --- a/src/lib/deskflow/ClientApp.cpp +++ b/src/lib/deskflow/ClientApp.cpp @@ -72,9 +72,9 @@ void ClientApp::parseArgs(int argc, const char *const *argv) if (!result || args().m_shouldExitOk || args().m_shouldExitFail) { if (args().m_shouldExitOk) { - m_bye(s_exitSuccess); + bye(s_exitSuccess); } else { - m_bye(s_exitArgs); + bye(s_exitArgs); } } else { // save server address @@ -89,7 +89,7 @@ void ClientApp::parseArgs(int argc, const char *const *argv) // Priddy. if (!args().m_restartable || e.getError() == XSocketAddress::SocketError::BadPort) { LOG((CLOG_CRIT "%s: %s" BYE, args().m_pname, e.what(), args().m_pname)); - m_bye(s_exitFailed); + bye(s_exitFailed); } } } @@ -442,7 +442,7 @@ void ClientApp::startNode() // we shouldn't retry. LOG((CLOG_DEBUG1 "starting client")); if (!startClient()) { - m_bye(s_exitFailed); + bye(s_exitFailed); } } diff --git a/src/lib/deskflow/ServerApp.cpp b/src/lib/deskflow/ServerApp.cpp index a4d8a9989..7f8ad8d3b 100644 --- a/src/lib/deskflow/ServerApp.cpp +++ b/src/lib/deskflow/ServerApp.cpp @@ -80,9 +80,9 @@ void ServerApp::parseArgs(int argc, const char *const *argv) if (!result || args().m_shouldExitOk || args().m_shouldExitFail) { if (args().m_shouldExitOk) { - m_bye(s_exitSuccess); + bye(s_exitSuccess); } else { - m_bye(s_exitArgs); + bye(s_exitArgs); } } else { if (!args().m_deskflowAddress.empty()) { @@ -91,7 +91,7 @@ void ServerApp::parseArgs(int argc, const char *const *argv) m_deskflowAddress->resolve(); } catch (XSocketAddress &e) { LOG((CLOG_CRIT "%s: %s" BYE, args().m_pname, e.what(), args().m_pname)); - m_bye(s_exitArgs); + bye(s_exitArgs); } } } @@ -162,12 +162,12 @@ void ServerApp::loadConfig() const auto path = args().m_configFile; if (path.empty()) { LOG((CLOG_CRIT "no configuration path provided")); - m_bye(s_exitConfig); + bye(s_exitConfig); } if (!loadConfig(path)) { LOG((CLOG_CRIT "%s: failed to load config: %s", args().m_pname, path.c_str())); - m_bye(s_exitConfig); + bye(s_exitConfig); } } @@ -721,6 +721,6 @@ void ServerApp::startNode() // we shouldn't retry. LOG((CLOG_DEBUG1 "starting server")); if (!startServer()) { - m_bye(s_exitFailed); + bye(s_exitFailed); } }