| 619 | } |
| 620 | |
| 621 | void |
| 622 | Project::triggerAutoSave() |
| 623 | { |
| 624 | ///Should only be called in the main-thread, that is upon user interaction. |
| 625 | assert( QThread::currentThread() == qApp->thread() ); |
| 626 | |
| 627 | if ( getApp()->isBackground() || !appPTR->isLoaded() || isProjectClosing() ) { |
| 628 | return; |
| 629 | } |
| 630 | |
| 631 | if ( !hasProjectBeenSavedByUser() && !appPTR->getCurrentSettings()->isAutoSaveEnabledForUnsavedProjects() ) { |
| 632 | return; |
| 633 | } |
| 634 | |
| 635 | { |
| 636 | QMutexLocker l(&_imp->isLoadingProjectMutex); |
| 637 | if (_imp->isLoadingProject) { |
| 638 | return; |
| 639 | } |
| 640 | } |
| 641 | |
| 642 | _imp->autoSaveTimer->start( appPTR->getCurrentSettings()->getAutoSaveDelayMS() ); |
| 643 | } |
| 644 | |
| 645 | void |
| 646 | Project::onAutoSaveTimerTriggered() |
no test coverage detected