diff options
| author | Andrea Diamantini <adjam7@gmail.com> | 2011-09-29 23:03:27 +0200 | 
|---|---|---|
| committer | Andrea Diamantini <adjam7@gmail.com> | 2011-09-29 23:03:27 +0200 | 
| commit | 38a7b735f50805e1194c22975a678d3f614f208f (patch) | |
| tree | 22627c7b597efd3121e47fdf92a16fe685ac0175 /src | |
| parent | Fix session manager restore (diff) | |
| download | rekonq-38a7b735f50805e1194c22975a678d3f614f208f.tar.xz | |
This commit fixes urlbar suggestions handling,
while maintaining QCoreApplication::postEvent fix.
Sorry for the noise, guys :)
Diffstat (limited to 'src')
| -rw-r--r-- | src/urlbar/urlbar.cpp | 29 | 
1 files changed, 16 insertions, 13 deletions
| diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 9d8ba02a..0515f58b 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -433,22 +433,25 @@ void UrlBar::loadTyped(const QString &text)  void UrlBar::activateSuggestions(bool b)  { -    if (b && _box.isNull()) +    if (b)      { -        _box = new CompletionWidget(this); -        installEventFilter(_box.data()); -        connect(_box.data(), SIGNAL(chosenUrl(const KUrl &, Rekonq::OpenType)), this, SLOT(activated(const KUrl &, Rekonq::OpenType))); - -        // activate suggestions on edit text -        connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(detectTypedString(const QString &))); +        if (_box.isNull()) +        { +            _box = new CompletionWidget(this); +            installEventFilter(_box.data()); +            connect(_box.data(), SIGNAL(chosenUrl(const KUrl &, Rekonq::OpenType)), this, SLOT(activated(const KUrl &, Rekonq::OpenType))); -        return; +            // activate suggestions on edit text +            connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(detectTypedString(const QString &))); +        } +    } +    else +    { +        disconnect(this, SIGNAL(textChanged(const QString &)), this, SLOT(detectTypedString(const QString &))); +        removeEventFilter(_box.data()); +        if (!_box.isNull()) +            _box.data()->deleteLater();      } - -    disconnect(this, SIGNAL(textChanged(const QString &)), this, SLOT(detectTypedString(const QString &))); -    removeEventFilter(_box.data()); -    if (!_box.isNull()) -        _box.data()->deleteLater();  } | 
