summaryrefslogtreecommitdiff
path: root/src/urlbar/listitem.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-06-01 00:14:15 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-06-01 00:14:15 +0200
commitee31a35db40d3936b592f7e8444b4c83a62fbb49 (patch)
tree408a226c20a5425cce2073e6e799cfa1a26c9d98 /src/urlbar/listitem.cpp
parentMerge commit 'refs/merge-requests/128' of git://gitorious.org/rekonq/mainline (diff)
parentkeep the selected engine when the user types (diff)
downloadrekonq-ee31a35db40d3936b592f7e8444b4c83a62fbb49.tar.xz
Merge commit 'refs/merge-requests/109' of git://gitorious.org/rekonq/mainline into SearchItemFixes
Diffstat (limited to 'src/urlbar/listitem.cpp')
-rw-r--r--src/urlbar/listitem.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index 3114c16a..78a929a8 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -266,8 +266,6 @@ SearchListItem::SearchListItem(const UrlSearchItem &item, const QString &text, Q
: ListItem(item, parent)
, m_text(text)
{
- KService::Ptr currentEngine = SearchEngine::defaultEngine();
-
QString query = text;
KService::Ptr engine = SearchEngine::fromString(text);
if (engine)
@@ -276,14 +274,14 @@ SearchListItem::SearchListItem(const UrlSearchItem &item, const QString &text, Q
}
else
{
- engine = currentEngine;
+ engine = qobject_cast<CompletionWidget *>(parent)->searchEngine();
}
m_url = SearchEngine::buildQuery(engine, query);
m_iconLabel = new IconLabel("edit-find", this); //TODO: get the default engine icon
m_titleLabel = new TextLabel(searchItemTitle(engine->name(), query), QString(), this);
- m_engineBar = new EngineBar(currentEngine, parent);
+ m_engineBar = new EngineBar(engine, parent);
QHBoxLayout *hLayout = new QHBoxLayout;
hLayout->setSpacing(4);
@@ -311,9 +309,7 @@ void SearchListItem::changeSearchEngine(KService::Ptr engine)
m_titleLabel->setText(searchItemTitle(engine->name(), m_text));
m_iconLabel->setPixmap(Application::icon(KUrl(engine->property("Query").toString())).pixmap(16));
m_url = SearchEngine::buildQuery(engine, m_text);
-
- CompletionWidget *w = qobject_cast<CompletionWidget *>(parent());
- w->setCurrentEngine(engine);
+ qobject_cast<CompletionWidget *>(parent())->setSearchEngine(engine);
}