Skip to content

Commit 30bbaa0

Browse files
committed
refactor: Use member instead of passing param in daemon main loop
1 parent cae96c4 commit 30bbaa0

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/lib/deskflow/DaemonApp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void DaemonApp::run()
7575
{
7676
if (m_foreground) {
7777
LOG_DEBUG("running daemon in foreground");
78-
mainLoop(m_foreground);
78+
mainLoop();
7979
} else {
8080
LOG_DEBUG("running daemon in background (daemonizing)");
8181
ARCH->daemonize(kAppName, daemonLoop);
@@ -209,13 +209,13 @@ DaemonApp::InitResult DaemonApp::init(int argc, char **argv) // NOSONAR - CLI ar
209209
return StartDaemon;
210210
}
211211

212-
void DaemonApp::mainLoop(bool foreground)
212+
void DaemonApp::mainLoop()
213213
{
214214
try {
215215
DAEMON_RUNNING(true);
216216

217217
#if SYSAPI_WIN32
218-
m_watchdog = std::make_unique<MSWindowsWatchdog>(false, foreground);
218+
m_watchdog = std::make_unique<MSWindowsWatchdog>(false, m_foreground);
219219
m_watchdog->setFileLogOutputter(m_fileLogOutputter);
220220

221221
// install the platform event queue to handle service stop events.

src/lib/deskflow/DaemonApp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DaemonApp : public QObject
4848
~DaemonApp();
4949
InitResult init(int argc, char **argv);
5050
void run();
51-
void mainLoop(bool foreground = false);
51+
void mainLoop();
5252
void applyWatchdogCommand();
5353
void clearWatchdogCommand();
5454

0 commit comments

Comments
 (0)