Fix crash trying to apply an effect on a subclip (6d7eb4a3) · Commits · Multimedia / Kdenlive · GitLab
Admin message
Join us at
Akademy
to celebrate KDE's 30th anniversary!
Travel support requests
are open till May 31st.
Register now
Verified
Commit
6d7eb4a3
authored
Sep 02, 2025
by
Jean-Baptiste Mardelle
Browse files
parent
f4fedad7
Loading
Loading
Loading
Loading
Changes
Pipelines
Loading
Original line number
Diff line number
Diff line
@@ -349,7 +349,6 @@ QVariantMap AssetListWidget::getMimeData(const QString &assetId) const
void
AssetListWidget
::
activate
const
QModelIndex
ix
if
ix
isValid
())
return
Original line number
Diff line number
Diff line
@@ -2937,7 +2937,7 @@ void Bin::clearMonitor()
Q_EMIT
pCore
->
requestShowBinEffectStack
QString
(),
nullptr
QSize
(),
false
);
std
::
vector
QString
Bin
::
selectedClipsIds
bool
allowSubClips
std
::
vector
QString
Bin
::
selectedClipsIds
bool
allowSubClips
bool
allowFolders
const
QModelIndexList
indexes
m_proxyModel
->
selectionModel
()
->
selectedIndexes
();
std
::
vector
QString
ids
@@ -2955,6 +2955,8 @@ std::vector Bin::selectedClipsIds(bool allowSubClips)
else
if
item
->
itemType
()
==
AbstractProjectItem
::
ClipItem
||
item
->
itemType
()
==
AbstractProjectItem
::
SubSequenceItem
ids
push_back
item
->
clipId
());
else
if
allowFolders
&&
item
->
itemType
()
==
AbstractProjectItem
::
FolderItem
ids
push_back
item
->
clipId
());
return
ids
@@ -4104,7 +4106,7 @@ void Bin::slotAddEffect(std::vector ids, const QStringList &effectData)
if
ids
size
()
==
// Apply effect to all selected clips
ids
selectedClipsIds
();
ids
selectedClipsIds
false
true
);
if
ids
size
()
==
pCore
->
displayMessage
i18n
"Select a clip to apply an effect"
),
MessageType
::
ErrorMessage
500
);
@@ -4116,16 +4118,11 @@ void Bin::slotEffectDropped(const QStringList &effectData, const QModelIndex &pa
if
parent
isValid
())
std
::
shared_ptr
AbstractProjectItem
parentItem
m_itemModel
->
getBinItemByIndex
parent
);
if
parentItem
->
itemType
()
==
AbstractProjectItem
::
FolderItem
// effect not supported on folder items
Q_EMIT
displayBinMessage
i18n
"Cannot apply effects on folders"
),
KMessageWidget
::
Information
);
return
if
parentItem
->
itemType
()
==
AbstractProjectItem
::
SubClipItem
||
parentItem
->
itemType
()
==
AbstractProjectItem
::
SubSequenceItem
// effect only supported on clip items
parentItem
std
::
static_pointer_cast
ProjectSubClip
parentItem
->
getMasterClip
();
std
::
vector
QString
ids
selectedClipsIds
();
std
::
vector
QString
ids
selectedClipsIds
false
true
);
const
QString
droppedId
parentItem
->
clipId
();
if
ids
size
()
&&
std
::
find
ids
begin
(),
ids
end
(),
droppedId
!=
ids
end
())
if
effectData
count
()
==
@@ -4172,15 +4169,51 @@ bool Bin::doPasteEffect(std::vector ids, const QStringList &effectData)
bool
res
true
Fun
undo
[]()
return
true
};
Fun
redo
[]()
return
true
};
QList
std
::
shared_ptr
ProjectClip
>>
clipList
for
auto
id
ids
std
::
shared_ptr
AbstractProjectItem
item
m_itemModel
->
getItemByBinId
id
);
if
item
continue
std
::
shared_ptr
ProjectClip
clip
nullptr
switch
item
->
itemType
())
case
AbstractProjectItem
::
ClipItem
clip
std
::
static_pointer_cast
ProjectClip
item
);
break
case
AbstractProjectItem
::
SubClipItem
std
::
shared_ptr
ProjectSubClip
subClip
std
::
static_pointer_cast
ProjectSubClip
item
);
if
subClip
clip
subClip
->
getMasterClip
();
break
case
AbstractProjectItem
::
FolderItem
std
::
shared_ptr
ProjectFolder
folder
std
::
static_pointer_cast
ProjectFolder
item
);
if
folder
QList
std
::
shared_ptr
ProjectClip
>>
children
folder
->
childClips
();
for
auto
children
if
clipList
contains
))
clipList
<<
break
default
break
if
clip
&&
clipList
contains
clip
))
clipList
<<
clip
if
effectData
count
()
==
// Paste effect from another stack
std
::
shared_ptr
EffectStackModel
sourceStack
pCore
->
getItemEffectStack
QUuid
effectData
at
)),
effectData
at
).
toInt
(),
effectData
at
).
toInt
());
for
auto
id
ids
res
res
&&
m_itemModel
->
getClipByBinID
id
->
copyEffectWithUndo
sourceStack
effectData
at
).
toInt
(),
undo
redo
);
for
auto
clipList
res
res
&&
->
copyEffectWithUndo
sourceStack
effectData
at
).
toInt
(),
undo
redo
);
else
for
auto
id
ids
res
res
&&
m_itemModel
->
getClipByBinID
id
->
getEffectStack
()
->
appendEffectWithUndo
effectData
constFirst
(),
undo
redo
).
first
for
auto
clipList
res
res
&&
->
getEffectStack
()
->
appendEffectWithUndo
effectData
constFirst
(),
undo
redo
).
first
if
res
Original line number
Diff line number
Diff line
@@ -236,7 +236,7 @@ public:
/** @brief Returns a list of selected clip ids.
* @param allowSubClips: if true, will include subclip ids in the form: "master clip id/in/out"
*/
std
::
vector
QString
selectedClipsIds
bool
allowSubClips
false
);
std
::
vector
QString
selectedClipsIds
bool
allowSubClips
false
bool
allowFolders
false
);
// Returns the selected clips
QList
std
::
shared_ptr
ProjectClip
>>
selectedClips
();
Original line number
Diff line number
Diff line
@@ -3394,7 +3394,7 @@ void MainWindow::slotAddEffect(QAction *result)
void
MainWindow
::
addEffect
const
QString
effectId
if
m_assetPanel
->
effectStackOwner
().
type
==
KdenliveObjectType
::
BinClip
if
m_assetPanel
->
effectStackOwner
().
type
==
KdenliveObjectType
::
BinClip
||
m_clipMonitor
->
isActive
()
// Pass the command to bin
pCore
->
activeBin
()
->
slotAddEffect
({},
effectId
});
else
if
m_assetPanel
->
effectStackOwner
().
type
==
KdenliveObjectType
::
TimelineTrack
||
Loading