{
if (name.empty()) {
auto h = self->contextInfo.lock();
- name = h->rootName;
+ this->name = h->rootName;
searchForAnyChange = true;
} else {
this->name = std::move(name);
bool predicate() override
{
auto h = self->contextInfo.lock();
- auto res = h.waitForCondition(timeout, [&]() {
+ auto pred = [&]() {
return (searchForAnyChange && name != h->rootName) || (!searchForAnyChange && name == h->rootName);
- });
-
+ };
+ if (pred()) return true;
+ auto res = h.waitForCondition(timeout, pred);
if (!res) {
throw EvaluationFailure{} << "wait for gui ('" << name << "'): operation timeouted, " <<
"current root name is '" << h->rootName << "'";
const std::vector<EvaluationValue> &defaultArguments,
size_t consumeOnlyArguments = std::numeric_limits<size_t>::max())
{
- DEBUG("%d %d", (int)I, (int)consumeOnlyArguments);
if (I >= consumeOnlyArguments) return;
try {
auto &s = I < sourceArgs.size() ? sourceArgs[I] : defaultArguments[I - firstDefaultArgIndex];