Commit ba920143 authored by Yuchen Deng's avatar Yuchen Deng Committed by hjk

HistoryCompleter: Refactor saveEntry

Change-Id: I21f4706aecc3aa7119be954709a1ce1f3b37d580
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent de8d4e89
......@@ -152,11 +152,8 @@ void HistoryCompleterPrivate::saveEntry(const QString &str)
QTC_ASSERT(theSettings, return);
const QString &entry = str.trimmed();
int removeIndex = list.indexOf(entry);
if (removeIndex != -1) {
beginRemoveRows(QModelIndex(), removeIndex, removeIndex);
list.removeAt(removeIndex);
endRemoveRows();
}
if (removeIndex != -1)
removeRow(removeIndex);
beginInsertRows (QModelIndex(), list.count(), list.count());
list.prepend(entry);
list = list.mid(0, maxLines);
......
Markdown is supported
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