diff options
author | Yuchen Deng <loaden@gmail.com> | 2012-10-28 12:13:09 +0800 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-02-07 01:16:41 +0100 |
commit | ba920143efebe3cdf568a13102666c7cd5f56877 (patch) | |
tree | 2a037dd325728fe7347ba2a5ecde50e1afbb60cd | |
parent | de8d4e89466ec0e20c4c3e2e2e7b6eccf5e8da99 (diff) | |
download | qt-creator-ba920143efebe3cdf568a13102666c7cd5f56877.tar.gz |
HistoryCompleter: Refactor saveEntry
Change-Id: I21f4706aecc3aa7119be954709a1ce1f3b37d580
Reviewed-by: hjk <hjk121@nokiamail.com>
-rw-r--r-- | src/libs/utils/historycompleter.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libs/utils/historycompleter.cpp b/src/libs/utils/historycompleter.cpp index 7b297058b4..942cca8ee4 100644 --- a/src/libs/utils/historycompleter.cpp +++ b/src/libs/utils/historycompleter.cpp @@ -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); |