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

Method updateTask

Gui/ProgressPanel.cpp:538–576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538bool
539ProgressPanel::updateTask(const NodePtr& node,
540 const double progress)
541{
542 bool isMainThread = QThread::currentThread() == qApp->thread();
543 ProgressTaskInfoPtr foundTask;
544 {
545 QMutexLocker k(&_imp->tasksMutex);
546 foundTask = _imp->findTask(node);
547 }
548
549 if (!foundTask) {
550 return false;
551 }
552 if (!isMainThread) {
553 Q_EMIT s_doProgressUpdateOnMainThread(foundTask, progress);
554 } else {
555 doProgressOnMainThread(foundTask, progress);
556 }
557
558 if ( foundTask->wasCanceled() ) {
559 return false;
560 }
561
562 if (isMainThread) {
563 if (_imp->processEventsRecursionCounter == 0) {
564 ++_imp->processEventsRecursionCounter;
565 {
566#ifdef DEBUG
567 boost_adaptbx::floating_point::exception_trapping trap(0);
568#endif
569 QCoreApplication::processEvents();
570 }
571 --_imp->processEventsRecursionCounter;
572 }
573 }
574
575 return true;
576}
577
578void
579ProgressPanel::doProgressEndOnMainThread(const NodePtr& node)

Callers 1

progressUpdateMethod · 0.80

Calls 2

findTaskMethod · 0.80
wasCanceledMethod · 0.80

Tested by

no test coverage detected