... 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.
Cliff reported that if you apply a macro to "Files" and you had
a "saved project" open at the time, you would get the "not saved
properly" dialog when you next open that "saved project".
This should correct it...
* Don't need TrackFactory to make LabelTrack
* Don't need TrackFactory to make NoteTrack
* Don't need TrackFactory to make TimeTrack, or ZoomInfo in the factory
* Remove some forward declarations
* Rename TrackFactory as WaveTrackFactory, move it out of Track.cpp
Aside from the breakage I added to it during the AUP3 conversion,
there was several other issues discovered in regards to how the
export paths were being handled.
There's still the possibility if a crash happens at just the
right time that the project will be named "<project>_compact_back"
so we should probably look for it during startup.
This also changes all "Vacuum" references to "compact".