forked from qt-creator/qt-creator
Do not use QAbstractItemModel::reset().
Change-Id: Ie49bdf576a6d3543aef6df133b27c8827775c935
Rationale:
a) It is conceptually cleaner to do the changes to the model
in between calls to beginResetModel() and endResetModel,
respectively.
b) The function is deprecated in Qt 5, for exactly that reason.
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -165,8 +165,9 @@ QVariant SnippetsTableModel::headerData(int section, Qt::Orientation orientation
|
||||
|
||||
void SnippetsTableModel::load(const QString &groupId)
|
||||
{
|
||||
beginResetModel();
|
||||
m_activeGroupId = groupId;
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
QList<QString> SnippetsTableModel::groupIds() const
|
||||
@@ -219,14 +220,16 @@ void SnippetsTableModel::revertBuitInSnippet(const QModelIndex &modelIndex)
|
||||
|
||||
void SnippetsTableModel::restoreRemovedBuiltInSnippets()
|
||||
{
|
||||
beginResetModel();
|
||||
m_collection->restoreRemovedSnippets(m_activeGroupId);
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void SnippetsTableModel::resetSnippets()
|
||||
{
|
||||
beginResetModel();
|
||||
m_collection->reset(m_activeGroupId);
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void SnippetsTableModel::replaceSnippet(const Snippet &snippet, const QModelIndex &modelIndex)
|
||||
|
||||
Reference in New Issue
Block a user