refactor: move ClientApp::handleScreenError / ServerApp::handleScreenError to base App Class
This commit is contained in:
@ -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();
|
||||
|
||||
@ -109,6 +109,8 @@ public:
|
||||
return *s_instance;
|
||||
}
|
||||
|
||||
void handleScreenError() const;
|
||||
|
||||
protected:
|
||||
void runEventsLoop(void *);
|
||||
void (*m_bye)(int);
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user