| 1882 | } |
| 1883 | |
| 1884 | void |
| 1885 | Project::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 | |
| 1909 | void |
| 1910 | Project::clearAutoSavesDir() |
no test coverage detected