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

Method doResetEnd

Engine/Project.cpp:1891–1953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1889}
1890
1891void
1892Project::doResetEnd(bool aboutToQuit)
1893{
1894 _imp->runOnProjectCloseCallback();
1895
1896 QString lockFilePath = getLockAbsoluteFilePath();
1897 QString projectPath = QString::fromUtf8( _imp->getProjectPath().c_str() );
1898 QString projectFilename = QString::fromUtf8( _imp->getProjectFilename().c_str() );
1899 ///Remove the lock file if we own it
1900 if ( QFile::exists(lockFilePath) ) {
1901 QString author;
1902 QString lastsave;
1903 QString host;
1904 qint64 pid;
1905 if ( getLockFileInfos(projectPath, projectFilename, &author, &lastsave, &host, &pid) ) {
1906 if ( pid == QCoreApplication::applicationPid() ) {
1907 QFile::remove(lockFilePath);
1908 }
1909 }
1910 }
1911
1912
1913 if (aboutToQuit) {
1914 clearNodesBlocking();
1915 } else {
1916 clearNodesNonBlocking();
1917 }
1918
1919
1920 if (!aboutToQuit) {
1921 {
1922 QMutexLocker l(&_imp->projectLock);
1923 _imp->autoSetProjectFormat = appPTR->getCurrentSettings()->isAutoProjectFormatEnabled();
1924 _imp->hasProjectBeenSavedByUser = false;
1925 _imp->projectCreationTime = QDateTime::currentDateTime();
1926 _imp->setProjectFilename(NATRON_PROJECT_UNTITLED);
1927 _imp->setProjectPath("");
1928 _imp->autoSaveTimer->stop();
1929 _imp->additionalFormats.clear();
1930 }
1931 getApp()->removeAllKeyframesIndicators();
1932
1933 Q_EMIT projectNameChanged(QString::fromUtf8(NATRON_PROJECT_UNTITLED), false);
1934 const KnobsVec & knobs = getKnobs();
1935
1936 beginChanges();
1937 for (U32 i = 0; i < knobs.size(); ++i) {
1938 for (int j = 0; j < knobs[i]->getDimension(); ++j) {
1939 knobs[i]->resetToDefaultValue(j);
1940 }
1941 }
1942
1943
1944 onOCIOConfigPathChanged(appPTR->getOCIOConfigPath(), true);
1945
1946 endChanges(true);
1947 }
1948

Callers

nothing calls this directly

Calls 13

getAppFunction · 0.85
getCurrentSettingsMethod · 0.80
setProjectFilenameMethod · 0.80
setProjectPathMethod · 0.80
resetToDefaultValueMethod · 0.80
getProjectPathMethod · 0.45
getProjectFilenameMethod · 0.45
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected