diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2012-06-15 15:14:24 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2012-06-15 15:23:57 -0300 |
commit | f71bd1ebcc502ed23a25f1994d02e6257f24ec38 (patch) | |
tree | f60ce4f1f601e284a1556fb3c2f3c356965a4b75 | |
parent | 8cdfa0d8cb34c3ef51de628ed51fd45ffc76da2d (diff) |
BookmarkModel::insert method should not advertise it is inserting.
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: Hugo Parente Lima
-rw-r--r-- | src/core/BookmarkModel.cpp | 3 |
1 files changed, 0 insertions, 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(); } |