当前位置: 首页>>代码示例>>C++>>正文


C++ AMListAction3::shouldLogSubActionsSeparately方法代码示例

本文整理汇总了C++中AMListAction3::shouldLogSubActionsSeparately方法的典型用法代码示例。如果您正苦于以下问题:C++ AMListAction3::shouldLogSubActionsSeparately方法的具体用法?C++ AMListAction3::shouldLogSubActionsSeparately怎么用?C++ AMListAction3::shouldLogSubActionsSeparately使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AMListAction3的用法示例。


在下文中一共展示了AMListAction3::shouldLogSubActionsSeparately方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

// Copy constructor. Takes care of making copies of the sub-actions
AMListAction3::AMListAction3(const AMListAction3& other)
	: AMAction3(other)
{
	currentSubActionIndex_ = -1; // prior to running an subactions
	subActionMode_ = other.subActionMode_;
	if(subActionMode_ == AMListAction3::Parallel)
		AMAction3::info()->setIconFileName(":/32x32/format-line-spacing-triple.png");
	logSubActionsSeparately_ = other.shouldLogSubActionsSeparately();
	logActionId_ = other.logActionId();
	skipAfterCurrentAction_ = false;
	loggingDatabase_ = other.loggingDatabase();

	if (subActionMode_ == Sequential)
		skipOptions_.append("After current action");

	foreach(AMAction3* action, other.subActions_)
		subActions_ << action->createCopy();
	foreach(AMAction3* action, subActions_)
		action->setParentAction(this);
}
开发者ID:Cpppro,项目名称:acquaman,代码行数:21,代码来源:AMListAction3.cpp

示例2: currentActionStateChanged

void AMActionRunner3::onCurrentActionStateChanged(int state, int previousState)
{
	emit currentActionStateChanged(state, previousState);

	if(state == AMAction3::Starting){

		AMListAction3* listAction = qobject_cast<AMListAction3*>(currentAction_);

		if(listAction){

			int parentLogId = -1;
			AMListAction3* parentAction = qobject_cast<AMListAction3*>(listAction->parentAction());

			if(parentAction)
				parentLogId = parentAction->logActionId();

			if(!AMActionLog3::logUncompletedAction(currentAction_, loggingDatabase_, parentLogId)) {
				AMErrorMon::report(AMErrorReport(this, AMErrorReport::Alert, -200, "There was a problem logging the uncompleted action to your database.  Please report this problem to the Acquaman developers."));
			}
		}

		if (isScanAction())
			emit scanActionCreated((AMScanAction *)currentAction());
	}

	if ( (state == AMAction3::Running) && (previousState != AMAction3::Resuming) ){

		if (isScanAction())
			emit scanActionStarted((AMScanAction *)currentAction());
	}

	if(state == AMAction3::Failed) {
		// What should we do?
		int failureResponse = currentAction_->failureResponseInActionRunner();
		if(failureResponse == AMAction3::PromptUserResponse)
			failureResponse = internalAskUserWhatToDoAboutFailedAction(currentAction_);

		if(failureResponse == AMAction3::AttemptAnotherCopyResponse) {
			// make a fresh copy of this action and put it at the front of the queue to run again.
			insertActionInQueue(currentAction_->createCopy(), 0);
		}
		// other failure response is to MoveOn, which we'll do anyway.
	}

	if(state == AMAction3::Cancelled) {
		// Usability guess for now: If the user intervened to cancel, they probably want to make some changes to something. Let's pause the workflow for now to let them do that, rather than automatically go on to the next.
		setQueuePaused(true);
	}

	// for all three final states, this is how we wrap things up for the current action:
	if(state == AMAction3::Failed ||
			state == AMAction3::Cancelled ||
			state == AMAction3::Succeeded) {

		// log it, unless it's a list action that wants to take care of logging its sub-actions itself.
		AMListAction3* listAction = qobject_cast<AMListAction3*>(currentAction_);
		int parentLogId = -1;
		AMListAction3* parentAction = qobject_cast<AMListAction3*>(currentAction_->parentAction());
		if(parentAction)
			parentLogId = parentAction->logActionId();
		if(!(listAction && listAction->shouldLogSubActionsSeparately())) {
			if(!AMActionLog3::logCompletedAction(currentAction_, loggingDatabase_, parentLogId)) {
				AMErrorMon::report(AMErrorReport(this, AMErrorReport::Alert, -200, "There was a problem logging the completed action to your database.  Please report this problem to the Acquaman developers."));
			}
		}
		else if(listAction){
			if(!AMActionLog3::updateCompletedAction(currentAction_, loggingDatabase_)) {
				AMErrorMon::report(AMErrorReport(this, AMErrorReport::Alert, -200, "There was a problem updating the log of the completed action to your database.  Please report this problem to the Acquaman developers."));
			}
		}

		if (isScanAction())
			emit scanActionFinished((AMScanAction *)currentAction());

		// move onto the next, if there is one, and disconnect and delete the old one.
		internalDoNextAction();
	}
}
开发者ID:Cpppro,项目名称:acquaman,代码行数:78,代码来源:AMActionRunner3.cpp


注:本文中的AMListAction3::shouldLogSubActionsSeparately方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。