If user presses delete and then F2 in very quick succession, the
inline rename field will get stuck in place, due to the animation
moving the actual item in different place.
To avoid any confusion, disallow starting role editing while any
animations are running.
BUG: 497125
void KItemListView::editRole(int index, const QByteArray &role)
{
KStandardItemListWidget *widget = qobject_cast<KStandardItemListWidget *>(m_visibleItems.value(index));
- if (!widget || m_editingRole) {
+ if (!widget) {
+ return;
+ }
+ if (m_editingRole || m_animation->isStarted(widget)) {
+ Q_EMIT widget->roleEditingCanceled(index, role, QVariant());
return;
}
if (animate) {
if (m_animation->isStarted(widget, KItemListViewAnimation::MovingAnimation)) {
+ if (m_editingRole) {
+ Q_EMIT widget->roleEditingCanceled(widget->index(), QByteArray(), QVariant());
+ }
m_animation->start(widget, KItemListViewAnimation::MovingAnimation, newPos);
applyNewPos = false;
}