| 2020 | } |
| 2021 | |
| 2022 | void |
| 2023 | Project::doResetEnd(bool aboutToQuit) |
| 2024 | { |
| 2025 | _imp->runOnProjectCloseCallback(); |
| 2026 | |
| 2027 | QString lockFilePath = getLockAbsoluteFilePath(); |
| 2028 | QString projectPath = QString::fromUtf8( _imp->getProjectPath().c_str() ); |
| 2029 | QString projectFilename = QString::fromUtf8( _imp->getProjectFilename().c_str() ); |
| 2030 | ///Remove the lock file if we own it |
| 2031 | if ( QFile::exists(lockFilePath) ) { |
| 2032 | QString author; |
| 2033 | QString lastsave; |
| 2034 | QString host; |
| 2035 | qint64 pid; |
| 2036 | if ( getLockFileInfos(projectPath, projectFilename, &author, &lastsave, &host, &pid) ) { |
| 2037 | if ( pid == QCoreApplication::applicationPid() ) { |
| 2038 | QFile::remove(lockFilePath); |
| 2039 | } |
| 2040 | } |
| 2041 | } |
| 2042 | |
| 2043 | |
| 2044 | if (aboutToQuit) { |
| 2045 | clearNodesBlocking(); |
| 2046 | } else { |
| 2047 | clearNodesNonBlocking(); |
| 2048 | } |
| 2049 | |
| 2050 | |
| 2051 | if (!aboutToQuit) { |
| 2052 | { |
| 2053 | QMutexLocker l(&_imp->projectLock); |
| 2054 | _imp->autoSetProjectFormat = appPTR->getCurrentSettings()->isAutoProjectFormatEnabled(); |
| 2055 | _imp->hasProjectBeenSavedByUser = false; |
| 2056 | _imp->projectCreationTime = QDateTime::currentDateTime(); |
| 2057 | _imp->setProjectFilename(NATRON_PROJECT_UNTITLED); |
| 2058 | _imp->setProjectPath(""); |
| 2059 | _imp->autoSaveTimer->stop(); |
| 2060 | _imp->additionalFormats.clear(); |
| 2061 | } |
| 2062 | getApp()->removeAllKeyframesIndicators(); |
| 2063 | |
| 2064 | Q_EMIT projectNameChanged(QString::fromUtf8(NATRON_PROJECT_UNTITLED), false); |
| 2065 | const KnobsVec & knobs = getKnobs(); |
| 2066 | |
| 2067 | beginChanges(); |
| 2068 | for (U32 i = 0; i < knobs.size(); ++i) { |
| 2069 | for (int j = 0; j < knobs[i]->getDimension(); ++j) { |
| 2070 | knobs[i]->resetToDefaultValue(j); |
| 2071 | } |
| 2072 | } |
| 2073 | |
| 2074 | |
| 2075 | onOCIOConfigPathChanged(appPTR->getOCIOConfigPath(), true); |
| 2076 | |
| 2077 | endChanges(true); |
| 2078 | } |
| 2079 |
nothing calls this directly
no test coverage detected