summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-09-29 23:03:27 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-09-29 23:03:27 +0200
commit38a7b735f50805e1194c22975a678d3f614f208f (patch)
tree22627c7b597efd3121e47fdf92a16fe685ac0175
parentFix session manager restore (diff)
downloadrekonq-38a7b735f50805e1194c22975a678d3f614f208f.tar.xz
This commit fixes urlbar suggestions handling,
while maintaining QCoreApplication::postEvent fix. Sorry for the noise, guys :)
-rw-r--r--src/urlbar/urlbar.cpp29
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();
}