mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed crash in completer of MimeTextEdit (Patch from Phenom)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6483 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4ce08bee38
commit
e9db631f8f
@ -33,6 +33,8 @@ MimeTextEdit::MimeTextEdit(QWidget *parent)
|
||||
{
|
||||
mCompleterKeyModifiers=Qt::ControlModifier;
|
||||
mCompleterKey=Qt::Key_Space;
|
||||
mForceCompleterShowNextKeyEvent=false;
|
||||
mCompleterStartString="";
|
||||
}
|
||||
|
||||
bool MimeTextEdit::canInsertFromMimeData(const QMimeData* source) const
|
||||
@ -150,13 +152,15 @@ void MimeTextEdit::keyPressEvent(QKeyEvent *e)
|
||||
if (!mCompleter || !isShortcut) // do not process the shortcut when we have a completer
|
||||
QTextEdit::keyPressEvent(e);
|
||||
|
||||
if (!mCompleter) return; //Nothing else to do if not mCompleter initialized
|
||||
|
||||
if (!isShortcut && (mCompleter && !mCompleter->popup()->isVisible())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mForceCompleterShowNextKeyEvent) {
|
||||
static QString eow(" ~!@#$%^&*()_+{}|:\"<>?,./;'[]\\-="); // end of word
|
||||
if (!isShortcut && ( e->text().isEmpty() || eow.contains(e->text().right(1)))){
|
||||
if (!isShortcut && !e->text().isEmpty() && eow.contains(e->text())){
|
||||
mCompleter->popup()->hide();
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user