figments: mainloop: print warning if task couldnt be found
This commit is contained in:
parent
1e2f60201d
commit
7970192c1a
@ -24,17 +24,23 @@ MainLoop::dispatchSync(const InputEvent& evt)
|
||||
{
|
||||
if (evt.intent == InputEvent::StartThing || evt.intent == InputEvent::StopThing) {
|
||||
const bool jobState = (evt.intent == InputEvent::StartThing);
|
||||
bool wasFound = false;
|
||||
for(auto figmentJob: scheduler.tasks) {
|
||||
if (!strcmp(figmentJob->name, evt.asString())) {
|
||||
if (jobState) {
|
||||
Log.trace("** Starting %s", figmentJob->name);
|
||||
figmentJob->start();
|
||||
wasFound = true;
|
||||
} else {
|
||||
Log.trace("** Stopping %s", figmentJob->name);
|
||||
figmentJob->stop();
|
||||
wasFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!wasFound) {
|
||||
Log.warning("** Unable to find task %s", evt.asString());
|
||||
}
|
||||
}
|
||||
|
||||
for(Task* task : scheduler) {
|
||||
|
Loading…
Reference in New Issue
Block a user