refactor: move ClientApp::handleScreenError / ServerApp::handleScreenError to base App Class

This commit is contained in:
sithlord48
2025-08-03 00:00:20 -04:00
committed by Nick Bolton
parent 229fedf347
commit b2eb3a036d
6 changed files with 8 additions and 14 deletions

View File

@ -184,6 +184,12 @@ void App::initApp(int argc, const char **argv)
loadConfig();
}
void App::handleScreenError() const
{
LOG((CLOG_CRIT "error on screen"));
getEvents()->addEvent(Event(EventTypes::Quit));
}
void App::runEventsLoop(void *)
{
m_events->loop();

View File

@ -109,6 +109,8 @@ public:
return *s_instance;
}
void handleScreenError() const;
protected:
void runEventsLoop(void *);
void (*m_bye)(int);

View File

@ -200,12 +200,6 @@ void ClientApp::updateStatus(const std::string_view &) const
// do nothing
}
void ClientApp::handleScreenError()
{
LOG((CLOG_CRIT "error on screen"));
getEvents()->addEvent(Event(EventTypes::Quit));
}
deskflow::Screen *ClientApp::openClientScreen()
{
deskflow::Screen *screen = createScreen();

View File

@ -65,7 +65,6 @@ public:
void updateStatus() const;
void updateStatus(const std::string_view &) const;
void handleScreenError();
deskflow::Screen *openClientScreen();
void closeClientScreen(deskflow::Screen *screen);
void handleClientRestart(const Event &, EventQueueTimer *vtimer);

View File

@ -519,12 +519,6 @@ PrimaryClient *ServerApp::openPrimaryClient(const std::string &name, deskflow::S
return new PrimaryClient(name, screen);
}
void ServerApp::handleScreenError()
{
LOG((CLOG_CRIT "error on screen"));
getEvents()->addEvent(Event(EventTypes::Quit));
}
void ServerApp::handleSuspend()
{
if (!m_suspended) {

View File

@ -98,7 +98,6 @@ public:
void retryHandler();
deskflow::Screen *openServerScreen();
PrimaryClient *openPrimaryClient(const std::string &name, deskflow::Screen *screen);
void handleScreenError();
void handleSuspend();
void handleResume();
ClientListener *openClientListener(const NetworkAddress &address);