2015-08-13 10:03:20 +00:00
|
|
|
|
|
|
|
#include "mergeoperation.hpp"
|
|
|
|
|
|
|
|
#include "../doc/state.hpp"
|
2015-08-16 13:24:48 +00:00
|
|
|
#include "../doc/document.hpp"
|
|
|
|
|
|
|
|
#include "mergestages.hpp"
|
2015-08-13 10:03:20 +00:00
|
|
|
|
|
|
|
CSMTools::MergeOperation::MergeOperation (CSMDoc::Document& document)
|
2015-08-16 13:24:48 +00:00
|
|
|
: CSMDoc::Operation (CSMDoc::State_Merging, true), mState (document)
|
2015-08-13 10:03:20 +00:00
|
|
|
{
|
2015-08-16 13:24:48 +00:00
|
|
|
appendStage (new FinishMergedDocumentStage (mState));
|
|
|
|
}
|
2015-08-13 10:03:20 +00:00
|
|
|
|
2015-08-16 13:24:48 +00:00
|
|
|
void CSMTools::MergeOperation::setTarget (std::auto_ptr<CSMDoc::Document> document)
|
|
|
|
{
|
|
|
|
mState.mTarget = document;
|
2015-08-13 10:03:20 +00:00
|
|
|
}
|
|
|
|
|
2015-08-16 13:24:48 +00:00
|
|
|
void CSMTools::MergeOperation::operationDone()
|
2015-08-13 10:03:20 +00:00
|
|
|
{
|
2015-08-16 13:24:48 +00:00
|
|
|
CSMDoc::Operation::operationDone();
|
2015-08-13 10:03:20 +00:00
|
|
|
|
2015-08-16 13:24:48 +00:00
|
|
|
if (mState.mCompleted)
|
|
|
|
emit mergeDone (mState.mTarget.release());
|
2015-08-13 10:03:20 +00:00
|
|
|
}
|