Merge pull request #46 from PhenomRetroShare/Fix_ChatWidgetSearchTextThreshold

Fix chat widget search text threshold
This commit is contained in:
Cyril Soler 2015-08-26 19:43:56 -04:00
commit ef499cd570

View File

@ -586,14 +586,14 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
if (keyEvent) {
QString qsTextToFind=ui->leSearch->text();
if (((qsTextToFind.length()>iCharToStartSearch) || (keyEvent->key()==Qt::Key_Return)) && (keyEvent->text().length()>0))
if (keyEvent->key()==Qt::Key_Backspace) {
qsTextToFind=qsTextToFind.left(qsTextToFind.length()-1);// "\010"
} else if (keyEvent->key()==Qt::Key_Tab) { // "\011"
} else if (keyEvent->key()==Qt::Key_Return) { // "\015"
} else if (keyEvent->text().length()==1)
qsTextToFind+=keyEvent->text();
if (((qsTextToFind.length()>=iCharToStartSearch) || (keyEvent->key()==Qt::Key_Return)) && (keyEvent->text().length()>0))
{
if (keyEvent->key()==Qt::Key_Backspace) {
qsTextToFind=qsTextToFind.left(qsTextToFind.length()-1);// "\010"
} else if (keyEvent->key()==Qt::Key_Tab) { // "\011"
} else if (keyEvent->key()==Qt::Key_Return) { // "\015"
} else if (keyEvent->text().length()==1)
qsTextToFind+=keyEvent->text();
findText(qsTextToFind);
} else {