chore(daemon): Make function const and better string compare

- Make `clearSettings` const in daemon app
- Improve readability of empty command check
This commit is contained in:
Nick Bolton
2025-03-04 11:34:50 +00:00
parent 5ee39c9b00
commit 2c433eddd7
2 changed files with 3 additions and 3 deletions

View File

@ -135,7 +135,7 @@ void DaemonApp::clearWatchdogCommand()
#endif
}
void DaemonApp::clearSettings()
void DaemonApp::clearSettings() const
{
LOG_INFO("clearing daemon settings");
ARCH->clearSettings();
@ -228,7 +228,7 @@ void DaemonApp::mainLoop()
std::string command = ARCH->setting("Command");
bool elevate = ARCH->setting("Elevate") == "1";
if (command != "") {
if (!command.empty()) {
LOG_DEBUG("using last known command: %s", command.c_str());
m_watchdog->setProcessConfig(command, elevate);
}

View File

@ -52,7 +52,7 @@ public:
void setCommand(const QString &command);
void applyWatchdogCommand() const;
void clearWatchdogCommand();
void clearSettings();
void clearSettings() const;
std::string logFilename();
static DaemonApp &instance()