| 1810 | } |
| 1811 | |
| 1812 | bool ProjectFileIO::AutoSaveDelete(sqlite3 *db /* = nullptr */) |
| 1813 | { |
| 1814 | int rc; |
| 1815 | |
| 1816 | if (!db) |
| 1817 | { |
| 1818 | db = DB(); |
| 1819 | } |
| 1820 | |
| 1821 | rc = sqlite3_exec(db, "DELETE FROM autosave;", nullptr, nullptr, nullptr); |
| 1822 | if (rc != SQLITE_OK) |
| 1823 | { |
| 1824 | ADD_EXCEPTION_CONTEXT("sqlite3.rc", std::to_string(rc)); |
| 1825 | ADD_EXCEPTION_CONTEXT("sqlite3.context", "ProjectGileIO::AutoSaveDelete"); |
| 1826 | |
| 1827 | SetDBError( |
| 1828 | XO("Failed to remove the autosave information from the project file.") |
| 1829 | ); |
| 1830 | return false; |
| 1831 | } |
| 1832 | |
| 1833 | mModified = false; |
| 1834 | |
| 1835 | return true; |
| 1836 | } |
| 1837 | |
| 1838 | bool ProjectFileIO::WriteDoc(const char *table, |
| 1839 | const ProjectSerializer &autosave, |
no test coverage detected