1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-07 15:05:38 +01:00

AUP3: Detect and delete orphan blocks at startup

This commit is contained in:
Leland Lucius
2020-07-08 00:18:05 -05:00
parent f7d9513f8d
commit af6a23696b
3 changed files with 115 additions and 28 deletions

View File

@@ -98,6 +98,8 @@ public:
void Bypass(bool bypass);
bool ShouldBypass();
void LoadedBlock(int64_t blockID);
private:
// XMLTagHandler callback methods
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
@@ -139,13 +141,16 @@ private:
bool TransactionCommit(const wxString &name);
bool TransactionRollback(const wxString &name);
wxString GetValue(const char *sql);
bool GetValue(const char *sql, wxString &value);
bool GetBlob(const char *sql, wxMemoryBuffer &buffer);
bool CheckVersion();
bool InstallSchema();
bool UpgradeSchema();
// Checks for orphan blocks. This will go away at a future date
bool CheckForOrphans();
// Return a database connection if successful, which caller must close
sqlite3 *CopyTo(const FilePath &destpath);
@@ -177,6 +182,9 @@ private:
TranslatableString mLastError;
TranslatableString mLibraryError;
// Track the highest blockid while loading a project
int64_t mHighestBlockID;
friend SqliteSampleBlock;
};