aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/historycompleter.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2014-02-06 18:06:24 +0100
committerhjk <hjk121@nokiamail.com>2014-02-06 18:32:53 +0100
commite9cf16b7017248d6567fe363efedb42c2ff7b05a (patch)
tree3d146edf0da85a5f4d6c8c82dc7de8bd65fbcfea /src/libs/utils/historycompleter.cpp
parent242b839375e43501fb5b6e0bc00c1388390c7891 (diff)
HistoryCompleter: Do not overwrite text in the FancyLineEdit
Do only set the first item of the completion list if there is no text in the line edit when the completer gets attached. Otherwise we might overwrite default values that we actually expect to stick around. Task-number: QTCREATORBUG-11291 Change-Id: Iee9aa2a5475b840ede201f306e3b4164c6e88120 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/libs/utils/historycompleter.cpp')
-rw-r--r--src/libs/utils/historycompleter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libs/utils/historycompleter.cpp b/src/libs/utils/historycompleter.cpp
index e47037379d1..687a2b5b07e 100644
--- a/src/libs/utils/historycompleter.cpp
+++ b/src/libs/utils/historycompleter.cpp
@@ -171,7 +171,7 @@ HistoryCompleter::HistoryCompleter(FancyLineEdit *lineEdit, const QString &histo
d->historyKey = QLatin1String("CompleterHistory/") + historyKey;
d->list = theSettings->value(d->historyKey).toStringList();
d->lineEdit = lineEdit;
- if (d->list.count())
+ if (d->list.count() && lineEdit->text().isEmpty())
lineEdit->setText(d->list.at(0));
setModel(d);