diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-09-20 09:50:13 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-09-20 09:50:13 +0200 |
commit | 138332c9f51c12ff6e11ebf80d80db793d93e034 (patch) | |
tree | f4fa947f7c3705e95ccbf0968026d522e6ae9e0c /src/urlbar | |
parent | Licensing issues fix: part #2 (diff) | |
download | rekonq-138332c9f51c12ff6e11ebf80d80db793d93e034.tar.xz |
QCoreApplication::postEvent fixes
This commit should clean up some strange calls on close to
QCA::postEvent, returning a strange "Unexpected null receiver"
QT_FATAL_WARNINGS=1 macro helped very well here :D
Diffstat (limited to 'src/urlbar')
-rw-r--r-- | src/urlbar/urlbar.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 04e48d1b..ed00c84c 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -433,24 +433,22 @@ void UrlBar::loadTyped(const QString &text) void UrlBar::activateSuggestions(bool b) { - if (b) + if (b && _box.isNull()) { - 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))); + _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 &))); - } + // activate suggestions on edit text + connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(detectTypedString(const QString &))); + + return; } - else - { - disconnect(this, SIGNAL(textChanged(const QString &)), this, SLOT(detectTypedString(const QString &))); - removeEventFilter(_box.data()); + + disconnect(this, SIGNAL(textChanged(const QString &)), this, SLOT(detectTypedString(const QString &))); + removeEventFilter(_box.data()); + if (!_box.isNull()) _box.data()->deleteLater(); - } } |