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


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

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


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

示例1: actionLog

bool AMActionHistoryModel3::logUncompletedAction(const AMAction3 *uncompletedAction, AMDatabase *database, int parentLogId){
	if(uncompletedAction && !uncompletedAction->inFinalState()){

		if(database == AMDatabase::database("scanActions") && AMActionRunner3::scanActionRunner()->cachedLogCount() > 200){
			database->commitTransaction();
			AMActionRunner3::scanActionRunner()->resetCachedLogCount();
		}
		if(database == AMDatabase::database("scanActions")){
			if(!database->transactionInProgress())
				database->startTransaction();
			AMActionRunner3::scanActionRunner()->incrementCachedLogCount();
		}

		/*
		AMActionLog3 actionLog(uncompletedAction);
		actionLog.setParentId(parentLogId);
		bool success = actionLog.storeToDb(database);
		*/
		AMActionLog3 *actionLog = new AMActionLog3(uncompletedAction);
		infosToLogsForUncompletedActions_.insert(uncompletedAction->info(), actionLog);
		actionLog->setParentId(parentLogId);
		bool success = actionLog->storeToDb(database);
		const AMListAction3 *listAction = qobject_cast<const AMListAction3*>(uncompletedAction);
		if(success && listAction){
			AMListAction3 *modifyListAction = const_cast<AMListAction3*>(listAction);
			modifyListAction->setLogActionId(actionLog->id());
		}

		AMActionLogItem3* item = new AMActionLogItem3(*actionLog);
		emit modelAboutToBeRefreshed();
		/// \todo Ordering... This may end up at the wrong spot until a full refresh is done.  Most of the time, any actions added will be the most recent ones, however that is not guaranteed.
		appendItem(item);
		visibleActionsCount_++;
		emit modelRefreshed();

		return success;
	}
	return false;
}
开发者ID:acquaman,项目名称:acquaman,代码行数:39,代码来源:AMActionHistoryModel.cpp


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