We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc50078 commit 18e008cCopy full SHA for 18e008c
qml/models/sendrecipientslistmodel.cpp
@@ -93,15 +93,17 @@ void SendRecipientsListModel::remove()
93
return;
94
}
95
beginRemoveRows(QModelIndex(), m_current, m_current);
96
- delete m_recipients.takeAt(m_current);
97
- endRemoveRows();
98
- Q_EMIT countChanged();
99
-
100
if (m_current > 0) {
+ int index_to_remove = m_current;
101
setCurrentIndex(m_current - 1);
+ delete m_recipients.takeAt(index_to_remove);
102
} else {
+ auto removed_recipient = m_recipients.takeAt(m_current);
103
Q_EMIT currentRecipientChanged();
+ delete removed_recipient;
104
105
+ endRemoveRows();
106
+ Q_EMIT countChanged();
107
108
109
SendRecipient* SendRecipientsListModel::currentRecipient() const
0 commit comments