[PATCH] BookmarkModel::insert method should not advertise it is inserting.

0 views
Skip to first unread message

Marcelo Lira

unread,
Jun 15, 2012, 2:18:50 PM6/15/12
to snowsh...@googlegroups.com
This method calls QSqlTableModel::insertRecord which goes on to
call beginInsertRows.

In practice this fix prevents BookmarkModel from emitting two
countChanged() signals when inserting bookmarks.

Reviewed-by: ?
---
src/core/BookmarkModel.cpp | 3 ---
1 file changed, 3 deletions(-)

diff --git a/src/core/BookmarkModel.cpp b/src/core/BookmarkModel.cpp
index 0d271fe..9726902 100644
--- a/src/core/BookmarkModel.cpp
+++ b/src/core/BookmarkModel.cpp
@@ -62,10 +62,7 @@ void BookmarkModel::insert(const QString& name, const QString& url)
record.setValue(QLatin1String("url"), url);
record.setValue(QLatin1String("dateAdded"), QDateTime::currentDateTime().toTime_t());

- QModelIndex index = QModelIndex();
- beginInsertRows(index, rowCount(index), rowCount(index));
insertRecord(-1, record);
- endInsertRows();
submitAll();
}

--
1.7.9.5

Hugo Parente Lima

unread,
Jun 15, 2012, 2:21:07 PM6/15/12
to snowsh...@googlegroups.com, Marcelo Lira
r=me
signature.asc
Reply all
Reply to author
Forward
0 new messages