summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-09-02 21:26:39 +0200
committerStefan Dombrowski <stefan@uni-bonn.de>2010-09-02 21:26:39 +0200
commite806e70958f68a3b0dc9c841cacabacf011ac973 (patch)
tree8c1b15316c0892e8754b6a87bd97ce0eec951216 /src
parent76ec7d66c0bb691f3409beb2448718a0bcefcc50 (diff)
downloadmana-e806e70958f68a3b0dc9c841cacabacf011ac973.tar.gz
mana-e806e70958f68a3b0dc9c841cacabacf011ac973.tar.bz2
mana-e806e70958f68a3b0dc9c841cacabacf011ac973.tar.xz
mana-e806e70958f68a3b0dc9c841cacabacf011ac973.zip
Avoiding empty lines in history
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/textfield.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index cffda1e3..4989ae83 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -277,7 +277,8 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
if (mHistory)
{
// If the input is different from previous, put it in the history
- if (mHistory->empty() || !mHistory->matchesLastEntry(getText()))
+ if (!getText().empty() && (mHistory->empty() ||
+ !mHistory->matchesLastEntry(getText())))
{
mHistory->addEntry(getText());
}