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

Method removeLastAutosave

Engine/Project.cpp:1884–1907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1882}
1883
1884void
1885Project::removeLastAutosave()
1886{
1887 /*
1888 * First remove the last auto-save registered for this project.
1889 */
1890 QString filepath = getLastAutoSaveFilePath();
1891
1892 if ( !filepath.isEmpty() ) {
1893 QFile::remove(filepath);
1894 }
1895
1896 /*
1897 * Since we may have saved the project to an old project, overwriting the existing file, there might be
1898 * a oldProject.ntp.autosave file next to it that belonged to the old project, make sure it gets removed too
1899 */
1900 QString projectPath = QString::fromUtf8( _imp->getProjectPath().c_str() );
1901 QString projectFilename = QString::fromUtf8( _imp->getProjectFilename().c_str() );
1902 StrUtils::ensureLastPathSeparator(projectPath);
1903 QString autoSaveFilePath = projectPath + projectFilename + QString::fromUtf8(".autosave");
1904 if ( QFile::exists(autoSaveFilePath) ) {
1905 QFile::remove(autoSaveFilePath);
1906 }
1907}
1908
1909void
1910Project::clearAutoSavesDir()

Callers 1

abortProjectMethod · 0.80

Calls 3

isEmptyMethod · 0.45
getProjectPathMethod · 0.45
getProjectFilenameMethod · 0.45

Tested by

no test coverage detected