refactor: use ArchDaemonWindows::daemonRunning directly
removes: unused DAEMON_RUNNING define in App.h unused ArchMiscWindows::daemonRunning update copyright years
This commit is contained in:
parent
09c1bd1582
commit
c7da833f07
7 changed files with 25 additions and 32 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
* Deskflow -- mouse and keyboard sharing utility
|
||||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
* SPDX-FileCopyrightText: (C) 2025 - 2026 Deskflow Developers
|
||||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||||
|
|
@ -43,9 +43,9 @@ public:
|
||||||
\c func is only called when the service is actually started.
|
\c func is only called when the service is actually started.
|
||||||
\c func must call \c ArchMiscWindows::runDaemon() to finally
|
\c func must call \c ArchMiscWindows::runDaemon() to finally
|
||||||
becoming a service. The \c runFunc function passed to \c runDaemon()
|
becoming a service. The \c runFunc function passed to \c runDaemon()
|
||||||
must call \c ArchMiscWindows::daemonRunning(true) when it
|
must call \c ArchDaemonWindows::daemonRunning(true) when it
|
||||||
enters the main loop (i.e. after initialization) and
|
enters the main loop (i.e. after initialization) and
|
||||||
\c ArchMiscWindows::daemonRunning(false) when it leaves
|
\c ArchDaemonWindows::daemonRunning(false) when it leaves
|
||||||
the main loop. The \c stopFunc function passed to \c runDaemon()
|
the main loop. The \c stopFunc function passed to \c runDaemon()
|
||||||
is called when the daemon must exit the main loop and it must cause
|
is called when the daemon must exit the main loop and it must cause
|
||||||
\c runFunc to return. \c func should return what \c runDaemon()
|
\c runFunc to return. \c func should return what \c runDaemon()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
* Deskflow -- mouse and keyboard sharing utility
|
||||||
|
* SPDX-FileCopyrightText: (C) 2026 Deskflow Developers
|
||||||
* SPDX-FileCopyrightText: (C) 2012 - 2016, 2024 - 2025 Symless Ltd.
|
* SPDX-FileCopyrightText: (C) 2012 - 2016, 2024 - 2025 Symless Ltd.
|
||||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||||
|
|
@ -69,11 +70,6 @@ int ArchMiscWindows::runDaemon(RunFunc runFunc)
|
||||||
return ArchDaemonWindows::runDaemon(runFunc);
|
return ArchDaemonWindows::runDaemon(runFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArchMiscWindows::daemonRunning(bool running)
|
|
||||||
{
|
|
||||||
ArchDaemonWindows::daemonRunning(running);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ArchMiscWindows::daemonFailed(int result)
|
void ArchMiscWindows::daemonFailed(int result)
|
||||||
{
|
{
|
||||||
ArchDaemonWindows::daemonFailed(result);
|
ArchDaemonWindows::daemonFailed(result);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
* Deskflow -- mouse and keyboard sharing utility
|
||||||
|
* SPDX-FileCopyrightText: (C) 2026 Deskflow Developers
|
||||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||||
|
|
@ -46,12 +47,6 @@ public:
|
||||||
*/
|
*/
|
||||||
static int runDaemon(RunFunc runFunc);
|
static int runDaemon(RunFunc runFunc);
|
||||||
|
|
||||||
//! Indicate daemon is in main loop
|
|
||||||
/*!
|
|
||||||
Delegates to ArchDaemonWindows.
|
|
||||||
*/
|
|
||||||
static void daemonRunning(bool running);
|
|
||||||
|
|
||||||
//! Indicate failure of running daemon
|
//! Indicate failure of running daemon
|
||||||
/*!
|
/*!
|
||||||
Delegates to ArchDaemonWindows.
|
Delegates to ArchDaemonWindows.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
* Deskflow -- mouse and keyboard sharing utility
|
||||||
|
* SPDX-FileCopyrightText: (C) 2026 Deskflow Developers
|
||||||
* SPDX-FileCopyrightText: (C) 2012 - 2025 Symless Ltd.
|
* SPDX-FileCopyrightText: (C) 2012 - 2025 Symless Ltd.
|
||||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||||
|
|
@ -118,12 +119,6 @@ private:
|
||||||
QString m_pname;
|
QString m_pname;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if WINAPI_MSWINDOWS
|
|
||||||
#define DAEMON_RUNNING(running_) ArchMiscWindows::daemonRunning(running_)
|
|
||||||
#else
|
|
||||||
#define DAEMON_RUNNING(running_)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(WINAPI_LIBEI) && WINAPI_XWINDOWS
|
#if !defined(WINAPI_LIBEI) && WINAPI_XWINDOWS
|
||||||
constexpr static auto s_helpNoWayland = //
|
constexpr static auto s_helpNoWayland = //
|
||||||
"\nYour Linux distribution does not support Wayland EI (emulated input)\n"
|
"\nYour Linux distribution does not support Wayland EI (emulated input)\n"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
* Deskflow -- mouse and keyboard sharing utility
|
||||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
* SPDX-FileCopyrightText: (C) 2025 - 2026 Deskflow Developers
|
||||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
#include "net/TCPSocketFactory.h"
|
#include "net/TCPSocketFactory.h"
|
||||||
|
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
#include "arch/win32/ArchMiscWindows.h"
|
#include "arch/win32/ArchDaemonWindows.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if WINAPI_MSWINDOWS
|
#if WINAPI_MSWINDOWS
|
||||||
|
|
@ -306,7 +306,9 @@ int ClientApp::mainLoop()
|
||||||
// run event loop. if startClient() failed we're supposed to retry
|
// run event loop. if startClient() failed we're supposed to retry
|
||||||
// later. the timer installed by startClient() will take care of
|
// later. the timer installed by startClient() will take care of
|
||||||
// that.
|
// that.
|
||||||
DAEMON_RUNNING(true);
|
#if SYSAPI_WIN32
|
||||||
|
ArchDaemonWindows::daemonRunning(true);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if WINAPI_CARBON
|
#if WINAPI_CARBON
|
||||||
|
|
||||||
|
|
@ -321,7 +323,9 @@ int ClientApp::mainLoop()
|
||||||
getEvents()->loop();
|
getEvents()->loop();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DAEMON_RUNNING(false);
|
#if SYSAPI_WIN32
|
||||||
|
ArchDaemonWindows::daemonRunning(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// close down
|
// close down
|
||||||
LOG_DEBUG1("stopping client");
|
LOG_DEBUG1("stopping client");
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
* Deskflow -- mouse and keyboard sharing utility
|
||||||
|
* SPDX-FileCopyrightText: (C) 2026 Deskflow Developers
|
||||||
* SPDX-FileCopyrightText: (C) 2012 - 2025 Symless Ltd.
|
* SPDX-FileCopyrightText: (C) 2012 - 2025 Symless Ltd.
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||||
*/
|
*/
|
||||||
|
|
@ -12,7 +13,6 @@
|
||||||
#include "base/LogOutputters.h"
|
#include "base/LogOutputters.h"
|
||||||
#include "common/ExitCodes.h"
|
#include "common/ExitCodes.h"
|
||||||
#include "common/Settings.h"
|
#include "common/Settings.h"
|
||||||
#include "deskflow/App.h"
|
|
||||||
#include "deskflow/ipc/DaemonIpcServer.h"
|
#include "deskflow/ipc/DaemonIpcServer.h"
|
||||||
|
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
|
|
@ -177,10 +177,9 @@ int DaemonApp::mainLoop()
|
||||||
LOG_ERR("watchdog not initialized");
|
LOG_ERR("watchdog not initialized");
|
||||||
return s_exitFailed;
|
return s_exitFailed;
|
||||||
}
|
}
|
||||||
|
ArchDaemonWindows::daemonRunning(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DAEMON_RUNNING(true);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
// Install the platform event queue to handle service stop events.
|
// Install the platform event queue to handle service stop events.
|
||||||
|
|
@ -211,9 +210,9 @@ int DaemonApp::mainLoop()
|
||||||
} catch (...) { // NOSONAR - Catching remaining exceptions
|
} catch (...) { // NOSONAR - Catching remaining exceptions
|
||||||
LOG_CRIT("daemon stop watchdog unknown error");
|
LOG_CRIT("daemon stop watchdog unknown error");
|
||||||
}
|
}
|
||||||
|
ArchDaemonWindows::daemonRunning(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DAEMON_RUNNING(false);
|
|
||||||
return s_exitSuccess;
|
return s_exitSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
* Deskflow -- mouse and keyboard sharing utility
|
||||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
* SPDX-FileCopyrightText: (C) 2025 - 2026 Deskflow Developers
|
||||||
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
||||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
#include "arch/win32/ArchMiscWindows.h"
|
#include "arch/win32/ArchDaemonWindows.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if WINAPI_MSWINDOWS
|
#if WINAPI_MSWINDOWS
|
||||||
|
|
@ -556,7 +556,9 @@ int ServerApp::mainLoop()
|
||||||
// run event loop. if startServer() failed we're supposed to retry
|
// run event loop. if startServer() failed we're supposed to retry
|
||||||
// later. the timer installed by startServer() will take care of
|
// later. the timer installed by startServer() will take care of
|
||||||
// that.
|
// that.
|
||||||
DAEMON_RUNNING(true);
|
#if SYSAPI_WIN32
|
||||||
|
ArchDaemonWindows::daemonRunning(true);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if WINAPI_CARBON
|
#if WINAPI_CARBON
|
||||||
|
|
||||||
|
|
@ -571,7 +573,9 @@ int ServerApp::mainLoop()
|
||||||
getEvents()->loop();
|
getEvents()->loop();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DAEMON_RUNNING(false);
|
#if SYSAPI_WIN32
|
||||||
|
ArchDaemonWindows::daemonRunning(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// close down
|
// close down
|
||||||
LOG_DEBUG1("stopping server");
|
LOG_DEBUG1("stopping server");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue