Commit 91dc7ddb authored by Yuchen Deng's avatar Yuchen Deng Committed by hjk
Browse files

HistoryCompleter: Fix removeRows scope



Change-Id: Ia951c1e816a4c333ebf099d774405c41003c4966
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 3d5291ae
...@@ -129,8 +129,12 @@ QVariant HistoryCompleterPrivate::data(const QModelIndex &index, int role) const ...@@ -129,8 +129,12 @@ QVariant HistoryCompleterPrivate::data(const QModelIndex &index, int role) const
bool HistoryCompleterPrivate::removeRows(int row, int count, const QModelIndex &parent) bool HistoryCompleterPrivate::removeRows(int row, int count, const QModelIndex &parent)
{ {
beginRemoveRows (parent, row, row + count); QTC_ASSERT(theSettings, return false);
list.removeAt(row); if (row + count > list.count())
return false;
beginRemoveRows(parent, row, row + count -1);
for (int i = 0; i < count; ++i)
list.removeAt(row);
theSettings->setValue(historyKey, list); theSettings->setValue(historyKey, list);
endRemoveRows(); endRemoveRows();
return true; return true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment