Skip to content

Re-organize KdenliveDoc constructor

Eric Jiang requested to merge erjiang/kdenlive:kdenlivedoc-open into master

This patch re-organizes big chunks of the code in kdenlivedoc.cpp along
with the calling code in projectmanager.cpp to make it clearer and more
testable.

  • Split out the KdenliveDoc ctor into two ctors, one for opening a file
    (private) and one for creating a new file (public).
  • Add KdenliveDoc::Open factory method, which returns several flags plus
    a pointer to the doc only if it was successful. Callers should use
    Open so that the actual constructor won't have so much code that can
    fail.
  • Lift all GUI interactions into the caller (projectmanager.cpp) so that
    creating a KdenliveDoc can be unit tested.
  • Set DropInvalidChars when opening files only if the user chose to try to recover an unreadable file. This should fix BUG:435768 in which non-BMP Unicode characters are silently dropped from files.
  • Add a unit test for BUG:435768
Edited by Eric Jiang

Merge request reports

Loading