1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

TabModel: Check return value of beginMoveRows

This commit is contained in:
David Rosca 2018-02-06 14:20:42 +01:00
parent b933e87c99
commit 94e6b98450
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -266,7 +266,10 @@ void TabModel::tabRemoved(int index)
void TabModel::tabMoved(int from, int to) void TabModel::tabMoved(int from, int to)
{ {
beginMoveRows(QModelIndex(), from, from, QModelIndex(), to > from ? to + 1 : to); if (!beginMoveRows(QModelIndex(), from, from, QModelIndex(), to > from ? to + 1 : to)) {
qWarning() << "Invalid beginMoveRows" << from << (to > from ? to + 1 : to);
return;
}
m_tabs.insert(to, m_tabs.takeAt(from)); m_tabs.insert(to, m_tabs.takeAt(from));
endMoveRows(); endMoveRows();
} }