mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-31 16:09:28 +02:00
When saving new project, put correct file name into MRU submenu...
... bug was introduced at 590d8c6d09fa2989f1e35ad3125965c801ece506
This commit is contained in:
parent
70ab645647
commit
7ad8849d32
@ -288,7 +288,10 @@ void ProjectFileIO::SaveConnection()
|
||||
DiscardConnection();
|
||||
|
||||
mPrevDB = mDB;
|
||||
mPrevFileName = mFileName;
|
||||
|
||||
mDB = nullptr;
|
||||
SetFileName({});
|
||||
}
|
||||
|
||||
// Close any set-aside connection
|
||||
@ -305,6 +308,7 @@ void ProjectFileIO::DiscardConnection()
|
||||
);
|
||||
}
|
||||
mPrevDB = nullptr;
|
||||
mPrevFileName.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -323,12 +327,17 @@ void ProjectFileIO::RestoreConnection()
|
||||
}
|
||||
}
|
||||
mDB = mPrevDB;
|
||||
SetFileName(mPrevFileName);
|
||||
|
||||
mPrevDB = nullptr;
|
||||
mPrevFileName.clear();
|
||||
}
|
||||
|
||||
void ProjectFileIO::UseConnection( sqlite3 *db )
|
||||
void ProjectFileIO::UseConnection( sqlite3 *db, const FilePath &filePath )
|
||||
{
|
||||
wxASSERT(mDB == nullptr);
|
||||
mDB = db;
|
||||
SetFileName( filePath );
|
||||
}
|
||||
|
||||
sqlite3 *ProjectFileIO::OpenDB(FilePath fileName)
|
||||
@ -1350,7 +1359,7 @@ bool ProjectFileIO::SaveProject(const FilePath &fileName)
|
||||
// (also ensuring closing of one of the connections, with the cooperation
|
||||
// of the finally above)
|
||||
SaveConnection();
|
||||
UseConnection( newDB );
|
||||
UseConnection( newDB, fileName );
|
||||
}
|
||||
|
||||
auto db = DB();
|
||||
|
@ -134,7 +134,7 @@ private:
|
||||
void RestoreConnection();
|
||||
|
||||
// Use a connection that is already open rather than invoke OpenDB
|
||||
void UseConnection( sqlite3 *db );
|
||||
void UseConnection( sqlite3 *db, const FilePath &filePath );
|
||||
|
||||
sqlite3 *OpenDB(FilePath fileName = {});
|
||||
bool CloseDB();
|
||||
@ -185,8 +185,9 @@ private:
|
||||
bool mBypass;
|
||||
|
||||
sqlite3 *mPrevDB;
|
||||
FilePath mPrevFileName;
|
||||
|
||||
sqlite3 *mDB;
|
||||
FilePath mDBPath;
|
||||
TranslatableString mLastError;
|
||||
TranslatableString mLibraryError;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user