| 1753 | } |
| 1754 | |
| 1755 | void |
| 1756 | Project::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 | |
| 1780 | void |
| 1781 | Project::clearAutoSavesDir() |
no test coverage detected