From 12f0c6ee179282df0c9a9d0777929e5a171df244 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sun, 26 Jul 2020 03:09:12 -0500 Subject: [PATCH] AUP3: Write doc to autosave table when compacting temporary projects This keeps them temporary if they need to be recovered. --- src/ProjectFileIO.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ProjectFileIO.cpp b/src/ProjectFileIO.cpp index d2959f8dd..ce1095f3a 100644 --- a/src/ProjectFileIO.cpp +++ b/src/ProjectFileIO.cpp @@ -896,8 +896,12 @@ Connection ProjectFileIO::CopyTo(const FilePath &destpath, } } - // Write the project doc - if (!WriteDoc("project", doc, "outbound")) + // Write the doc. + // + // If we're compacting a temporary project (user initiated from the File + // menu), then write the doc to the "autosave" table since temporary + // projects do not have a "project" doc. + if (!WriteDoc(mTemporary ? "autosave" : "project", doc, "outbound")) { return nullptr; }