Commit 3d5291ae authored by Yuchen Deng's avatar Yuchen Deng Committed by hjk
Browse files

HistoryCompleter: trimmed entry



Change-Id: I39d11e9eaad2bc787281529a56f3520d929ac5ce
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 7b5776d7
......@@ -146,14 +146,15 @@ void HistoryCompleterPrivate::clearHistory()
void HistoryCompleterPrivate::saveEntry(const QString &str)
{
QTC_ASSERT(theSettings, return);
int removeIndex = list.indexOf(str);
const QString &entry = str.trimmed();
int removeIndex = list.indexOf(entry);
if (removeIndex != -1) {
beginRemoveRows(QModelIndex(), removeIndex, removeIndex);
list.removeAt(removeIndex);
endRemoveRows();
}
beginInsertRows (QModelIndex(), list.count(), list.count());
list.prepend(str);
list.prepend(entry);
list = list.mid(0, maxLines);
endInsertRows();
theSettings->setValue(historyKey, list);
......
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