refactor: use ArchDaemonWindows::daemonRunning directly

removes:
  unused DAEMON_RUNNING define in App.h
  unused ArchMiscWindows::daemonRunning
update copyright years
This commit is contained in:
sithlord48 2026-01-03 08:58:28 -05:00 committed by Chris Rizzitello
parent 09c1bd1582
commit c7da833f07
7 changed files with 25 additions and 32 deletions

View file

@ -1,6 +1,6 @@
/*
* 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) 2002 Chris Schoeneman
* 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 must call \c ArchMiscWindows::runDaemon() to finally
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
\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()
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()

View file

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2026 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016, 2024 - 2025 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -69,11 +70,6 @@ int ArchMiscWindows::runDaemon(RunFunc runFunc)
return ArchDaemonWindows::runDaemon(runFunc);
}
void ArchMiscWindows::daemonRunning(bool running)
{
ArchDaemonWindows::daemonRunning(running);
}
void ArchMiscWindows::daemonFailed(int result)
{
ArchDaemonWindows::daemonFailed(result);

View file

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2026 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -46,12 +47,6 @@ public:
*/
static int runDaemon(RunFunc runFunc);
//! Indicate daemon is in main loop
/*!
Delegates to ArchDaemonWindows.
*/
static void daemonRunning(bool running);
//! Indicate failure of running daemon
/*!
Delegates to ArchDaemonWindows.

View file

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2026 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2025 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -118,12 +119,6 @@ private:
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
constexpr static auto s_helpNoWayland = //
"\nYour Linux distribution does not support Wayland EI (emulated input)\n"

View file

@ -1,6 +1,6 @@
/*
* 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) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -23,7 +23,7 @@
#include "net/TCPSocketFactory.h"
#if SYSAPI_WIN32
#include "arch/win32/ArchMiscWindows.h"
#include "arch/win32/ArchDaemonWindows.h"
#endif
#if WINAPI_MSWINDOWS
@ -306,7 +306,9 @@ int ClientApp::mainLoop()
// run event loop. if startClient() failed we're supposed to retry
// later. the timer installed by startClient() will take care of
// that.
DAEMON_RUNNING(true);
#if SYSAPI_WIN32
ArchDaemonWindows::daemonRunning(true);
#endif
#if WINAPI_CARBON
@ -321,7 +323,9 @@ int ClientApp::mainLoop()
getEvents()->loop();
#endif
DAEMON_RUNNING(false);
#if SYSAPI_WIN32
ArchDaemonWindows::daemonRunning(false);
#endif
// close down
LOG_DEBUG1("stopping client");

View file

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2026 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2025 Symless Ltd.
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
@ -12,7 +13,6 @@
#include "base/LogOutputters.h"
#include "common/ExitCodes.h"
#include "common/Settings.h"
#include "deskflow/App.h"
#include "deskflow/ipc/DaemonIpcServer.h"
#if SYSAPI_WIN32
@ -177,10 +177,9 @@ int DaemonApp::mainLoop()
LOG_ERR("watchdog not initialized");
return s_exitFailed;
}
ArchDaemonWindows::daemonRunning(true);
#endif
DAEMON_RUNNING(true);
try {
#if SYSAPI_WIN32
// Install the platform event queue to handle service stop events.
@ -211,9 +210,9 @@ int DaemonApp::mainLoop()
} catch (...) { // NOSONAR - Catching remaining exceptions
LOG_CRIT("daemon stop watchdog unknown error");
}
ArchDaemonWindows::daemonRunning(false);
#endif
DAEMON_RUNNING(false);
return s_exitSuccess;
}

View file

@ -1,6 +1,6 @@
/*
* 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) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -31,7 +31,7 @@
#include <QFileInfo>
#if SYSAPI_WIN32
#include "arch/win32/ArchMiscWindows.h"
#include "arch/win32/ArchDaemonWindows.h"
#endif
#if WINAPI_MSWINDOWS
@ -556,7 +556,9 @@ int ServerApp::mainLoop()
// run event loop. if startServer() failed we're supposed to retry
// later. the timer installed by startServer() will take care of
// that.
DAEMON_RUNNING(true);
#if SYSAPI_WIN32
ArchDaemonWindows::daemonRunning(true);
#endif
#if WINAPI_CARBON
@ -571,7 +573,9 @@ int ServerApp::mainLoop()
getEvents()->loop();
#endif
DAEMON_RUNNING(false);
#if SYSAPI_WIN32
ArchDaemonWindows::daemonRunning(false);
#endif
// close down
LOG_DEBUG1("stopping server");