The import function was written early on in the rewrite as a multithreaded background task that was considered somewhat flawed. While it worked for the most part, there were possibilities of race conditions that could have potentially been fatal, particularly since media could theoretically be deleted while the import/probe tasks were running in the background. With the save/load functions coming in, it became even more complicated as projects may include metadata about the footage that can't be implemented easily when the footage is imported/probed in the background. Making importing a modal task fixes all of these issues, it's still done in a background thread to not hang the GUI thread, but the GUI thread can be briefly "paused" in a user friendly way so that all these functions can be safer.
25 lines
339 B
C++
25 lines
339 B
C++
#include "projectfilemanagerbase.h"
|
|
|
|
ProjectFileManagerBase::ProjectFileManagerBase() :
|
|
cancelled_(false)
|
|
{
|
|
|
|
}
|
|
|
|
void ProjectFileManagerBase::Start()
|
|
{
|
|
Action();
|
|
|
|
emit Finished();
|
|
}
|
|
|
|
void ProjectFileManagerBase::Cancel()
|
|
{
|
|
cancelled_ = true;
|
|
}
|
|
|
|
const QAtomicInt &ProjectFileManagerBase::IsCancelled() const
|
|
{
|
|
return cancelled_;
|
|
}
|