... but still disallow it for .aup3 files.
The fix is a simple moving of the check for a FAT filesystem after several
other checks that distinguish types of imported files.
... Now new project windows are opened when .aup3 files are opened; but
behavior chages only in that case.
Wherever opening of other files invoked import code, we still do or do
not make a new project in exactly the same cases as before; such as, when
opening multiple files with File > Open, be sure each imported file still opens
in its own separate window.
This means the decision whether to open a new project must be lowered into
ProjectFileManager, where the type of the file is discovered, and we pass it a
function object so it avoids a dependency cycle with ProjectManager.
It also means the checking for errors and closing of new projects in case of
failure must be replicated at all places where ProjectFileManager::OpenProject
is called directly.
The class ProjectManager::ProjectChooser simplifies this.
Recently introduced calls to SafeToOpenProjectInto(), before
ProjectManager::OpenProject(), are now lowered into that class, delaying the
safety check so it might also be called where ProjectFileManager is used
directly.
... This makes it impossible to forget to include the EXPERIMENTAL definitions
(such as when cutting and pasting code) and so get unintended quiet changes of
behavior.
The EXPERIMENTAL flags are now specified instead in new file Experimental.cmake
... Breaking dependency of ProjectFileIO on on TimeTrack, and reusing the same
functions that implement cross-document copy and paste of tracks.
Also changing behavior, so that if a TimeTrack exists but another is imported,
then the import quietly replaces the existing completely.
I've added the comment 'REVIEW:' where I have some concern that
the database and our copy of it could get out of step, or simply that
we fail to report a problem to the user.
I'd like these reviewed and turned into comments that make it
easier to check for correctness, for example saying where an
error is reported, or why it is OK to do no further recovery action.
... This only cuts and pastes some functions from FileNames to another new file
and namespace, and changes namespace qualifiers where they are called.
The cycle resulted because of the need to include widgets/ErrorDialog.h
... The error message eliminated here describes what should be ruled out by
the loop before this line, which already checks that no previous file of the
chosen name exists.
So just give the generic write failure message.
... but not always as much, as before the part of the fix for Bug2579, which is
at 7edbad3cd1
The last saved undo state and the current state must (both) be saved (if
different).
... So that if you save, edit, compact, close without saving, then reopen,
you recover the saved state as expected, not the compacted state.
Implications:
Do not push an undo state for compaction. Discard redo states instead.
Do not purge undo states after the last saved. The database still needs them.
So we might reclaim less space than before.