MCPcopy Create free account
hub / github.com/KDE/kdenlive / applyAssetCommand

Method applyAssetCommand

src/effects/effectstack/model/effectstackmodel.cpp:2065–2083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2063}
2064
2065void EffectStackModel::applyAssetCommand(int row, const QModelIndex &index, const QString &previousValue, QString value, QUndoCommand *command)
2066{
2067
2068 auto item = getEffectStackRow(row);
2069 if (!item || item->childCount() > 0) {
2070 // group, error
2071 return;
2072 }
2073 std::shared_ptr<EffectItemModel> eff = std::static_pointer_cast<EffectItemModel>(item);
2074 const std::shared_ptr<AssetParameterModel> effectParamModel = std::static_pointer_cast<AssetParameterModel>(eff);
2075 if (KdenliveSettings::applyEffectParamsToGroupWithSameValue()) {
2076 const QString currentValue = effectParamModel->data(index, AssetParameterModel::ValueRole).toString();
2077 if (previousValue != currentValue) {
2078 // Don't apply change on this effect, the start value is not the same
2079 return;
2080 }
2081 }
2082 new AssetCommand(effectParamModel, index, value, command);
2083}
2084
2085void EffectStackModel::applyAssetKeyframeCommand(int row, const QModelIndex &index, GenTime pos, const QVariant &previousValue, QVariant value, int ix,
2086 QUndoCommand *command)

Callers 2

Calls 3

childCountMethod · 0.80
toStringMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected