| 199 | } |
| 200 | |
| 201 | void EffectStackModel::removeEffectWithUndo(const QString &assetId, QString &effectName, int assetRow, Fun &undo, Fun &redo) |
| 202 | { |
| 203 | if (assetRow > -1 && assetRow < rootItem->childCount()) { |
| 204 | std::shared_ptr<EffectItemModel> sourceEffect = std::static_pointer_cast<EffectItemModel>(rootItem->child(assetRow)); |
| 205 | if (assetId == sourceEffect->getAssetId()) { |
| 206 | removeEffectWithUndo(sourceEffect, effectName, undo, redo); |
| 207 | return; |
| 208 | } |
| 209 | } |
| 210 | for (int i = 0; i < rootItem->childCount(); ++i) { |
| 211 | std::shared_ptr<EffectItemModel> sourceEffect = std::static_pointer_cast<EffectItemModel>(rootItem->child(i)); |
| 212 | if (sourceEffect->isBuiltIn()) { |
| 213 | continue; |
| 214 | } |
| 215 | if (assetId == sourceEffect->getAssetId()) { |
| 216 | removeEffectWithUndo(sourceEffect, effectName, undo, redo); |
| 217 | break; |
| 218 | } |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | void EffectStackModel::removeEffectWithUndo(const std::shared_ptr<EffectItemModel> &effect, QString &effectName, Fun &undo, Fun &redo) |
| 223 | { |
no test coverage detected