X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Finputline.cpp;h=6ea156aa16d9c2910c48e8a906a2eb2d9767fed5;hb=f17ec992d090204ea62f9c601ca1f521737ce034;hp=c297694ce8acc42743e4082cec1cd0d259f34c92;hpb=c030e0d5e910fe8af376e5462c9e58d45fd59e40;p=quassel.git diff --git a/src/uisupport/inputline.cpp b/src/uisupport/inputline.cpp index c297694c..6ea156aa 100644 --- a/src/uisupport/inputline.cpp +++ b/src/uisupport/inputline.cpp @@ -27,37 +27,25 @@ InputLine::InputLine(QWidget *parent) idx(0), tabCompleter(new TabCompleter(this)) { - -#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();