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:
@ -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);
|
||||
}
|
||||
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user