本文整理汇总了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;
}