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

Method removeLastAutosave

Engine/Project.cpp:1755–1778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1753}
1754
1755void
1756Project::removeLastAutosave()
1757{
1758 /*
1759 * First remove the last auto-save registered for this project.
1760 */
1761 QString filepath = getLastAutoSaveFilePath();
1762
1763 if ( !filepath.isEmpty() ) {
1764 QFile::remove(filepath);
1765 }
1766
1767 /*
1768 * Since we may have saved the project to an old project, overwritting the existing file, there might be
1769 * a oldProject.ntp.autosave file next to it that belonged to the old project, make sure it gets removed too
1770 */
1771 QString projectPath = QString::fromUtf8( _imp->getProjectPath().c_str() );
1772 QString projectFilename = QString::fromUtf8( _imp->getProjectFilename().c_str() );
1773 StrUtils::ensureLastPathSeparator(projectPath);
1774 QString autoSaveFilePath = projectPath + projectFilename + QString::fromUtf8(".autosave");
1775 if ( QFile::exists(autoSaveFilePath) ) {
1776 QFile::remove(autoSaveFilePath);
1777 }
1778}
1779
1780void
1781Project::clearAutoSavesDir()

Callers 1

abortProjectMethod · 0.80

Calls 3

isEmptyMethod · 0.45
getProjectPathMethod · 0.45
getProjectFilenameMethod · 0.45

Tested by

no test coverage detected