Skip to content
  • Eric Jiang's avatar
    Re-organize KdenliveDoc constructor · c1ca48e3
    Eric Jiang authored and Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle committed
    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.
    c1ca48e3