X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Finputline.cpp;h=6ea156aa16d9c2910c48e8a906a2eb2d9767fed5;hb=0e04bcf8b70e86b66020be74dcae4c210a97ea25;hp=e559a93084fc193fa6dca0da1fdd99a24e689a37;hpb=486bdd0ee6a197d0dfb0a1ca51785b8139a712a9;p=quassel.git diff --git a/src/uisupport/inputline.cpp b/src/uisupport/inputline.cpp index e559a930..6ea156aa 100644 --- a/src/uisupport/inputline.cpp +++ b/src/uisupport/inputline.cpp @@ -27,39 +27,25 @@ InputLine::InputLine(QWidget *parent) idx(0), tabCompleter(new TabCompleter(this)) { - - installEventFilter(tabCompleter); - -#ifdef Q_WS_MAC - bindModifier = Qt::ControlModifier | Qt::AltModifier; - jumpModifier = Qt::ControlModifier; -#else - bindModifier = Qt::ControlModifier; - jumpModifier = Qt::AltModifier; -#endif - connect(this, SIGNAL(returnPressed()), this, SLOT(on_returnPressed())); connect(this, SIGNAL(textChanged(QString)), this, SLOT(on_textChanged(QString))); - } InputLine::~InputLine() { } void InputLine::keyPressEvent(QKeyEvent * event) { - if((event->modifiers() == jumpModifier || event->modifiers() == bindModifier) && - (Qt::Key_0 <= event->key() && event->key() <= Qt::Key_9)) { - event->ignore(); - return; - } - if(event->key() == Qt::Key_Up) { if(idx > 0) { idx--; setText(history[idx]); } event->accept(); } else if(event->key() == Qt::Key_Down) { if(idx < history.count()) idx++; if(idx < history.count()) setText(history[idx]); - else setText(""); + else if(!text().isEmpty()) { + history << text(); + idx = history.count(); + setText(""); + } event->accept(); } else if(event->key() == Qt::Key_Select) { // for Qtopia emit returnPressed();