diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2012-09-20 10:31:34 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-09-20 11:11:45 +0200 |
commit | 938612c35e82bec69868e1bf6490c1b331085d82 (patch) | |
tree | 695b915720cc20a6524e0ea2f28a54a9fb24af7f /src/plugins/texteditor/snippets/snippetssettingspage.cpp | |
parent | 1b3d637c1ba12cb9b8880000d05d1c864f81ce86 (diff) | |
download | qt-creator-938612c35e82bec69868e1bf6490c1b331085d82.tar.gz |
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>
Diffstat (limited to 'src/plugins/texteditor/snippets/snippetssettingspage.cpp')
-rw-r--r-- | src/plugins/texteditor/snippets/snippetssettingspage.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/texteditor/snippets/snippetssettingspage.cpp b/src/plugins/texteditor/snippets/snippetssettingspage.cpp index 54d0bb82fb..7128b2598f 100644 --- a/src/plugins/texteditor/snippets/snippetssettingspage.cpp +++ b/src/plugins/texteditor/snippets/snippetssettingspage.cpp @@ -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) |