MCPcopy Create free account
hub / github.com/MrKepzie/Natron / updateTask

Method updateTask

Gui/ProgressPanel.cpp:529–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527}
528
529bool
530ProgressPanel::updateTask(const NodePtr& node,
531 const double progress)
532{
533 bool isMainThread = QThread::currentThread() == qApp->thread();
534 ProgressTaskInfoPtr foundTask;
535 {
536 QMutexLocker k(&_imp->tasksMutex);
537 foundTask = _imp->findTask(node);
538 }
539
540 if (!foundTask) {
541 return false;
542 }
543 if (!isMainThread) {
544 Q_EMIT s_doProgressUpdateOnMainThread(foundTask, progress);
545 } else {
546 doProgressOnMainThread(foundTask, progress);
547 }
548
549 if ( foundTask->wasCanceled() ) {
550 return false;
551 }
552
553 if (isMainThread) {
554 if (_imp->processEventsRecursionCounter == 0) {
555 ++_imp->processEventsRecursionCounter;
556 QCoreApplication::processEvents();
557 --_imp->processEventsRecursionCounter;
558 }
559 }
560
561 return true;
562}
563
564void
565ProgressPanel::doProgressEndOnMainThread(const NodePtr& node)

Callers 1

progressUpdateMethod · 0.80

Calls 2

findTaskMethod · 0.80
wasCanceledMethod · 0.80

Tested by

no test coverage detected