summaryrefslogtreecommitdiff
path: root/src/urlbar/listitem.cpp
diff options
context:
space:
mode:
authorlionelc <lionelc@lionelc.(none)>2010-08-12 18:31:16 +0200
committerlionelc <lionelc@lionelc.(none)>2010-08-12 18:31:16 +0200
commite9d099f4c5efa41fafd16408f13400cb37616f18 (patch)
tree460e901d72921103f6d66e5e4edeb6e233a99969 /src/urlbar/listitem.cpp
parentMerge commit 'refs/merge-requests/165' of git://gitorious.org/rekonq/mainline (diff)
downloadrekonq-e9d099f4c5efa41fafd16408f13400cb37616f18.tar.xz
introduce a new SuggestionListItem
introduce an opensearch engine
Diffstat (limited to 'src/urlbar/listitem.cpp')
-rw-r--r--src/urlbar/listitem.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index f10cefd7..c9946257 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -36,7 +36,7 @@
#include "application.h"
#include "websnap.h"
#include "completionwidget.h"
-#include "searchengine.h"
+#include "search/searchengine.h"
// KDE Includes
#include <KIcon>
@@ -161,6 +161,7 @@ TypeIconLabel::TypeIconLabel(int type, QWidget *parent)
if (type & UrlSearchItem::Browse) hLayout->addWidget(getIcon("applications-internet"));
if (type & UrlSearchItem::Bookmark) hLayout->addWidget(getIcon("rating"));
if (type & UrlSearchItem::History) hLayout->addWidget(getIcon("view-history"));
+ if (type & UrlSearchItem::Suggestion) hLayout->addWidget(getIcon("help-hint"));
}
@@ -390,6 +391,23 @@ void EngineBar::selectNextEngine()
// ---------------------------------------------------------------
+SuggestionListItem::SuggestionListItem(const UrlSearchItem &item, const QString &text, QWidget *parent)
+ : ListItem(item, parent)
+{
+ QHBoxLayout *hLayout = new QHBoxLayout;
+ hLayout->setSpacing(4);
+
+ hLayout->addWidget(new IconLabel(item.url, this));
+ hLayout->addWidget(new TextLabel(item.title, text, this));
+ hLayout->addWidget(new TypeIconLabel(item.type, this));
+
+ setLayout(hLayout);
+}
+
+
+// ---------------------------------------------------------------
+
+
BrowseListItem::BrowseListItem(const UrlSearchItem &item, const QString &text, QWidget *parent)
: ListItem(item, parent)
{
@@ -427,7 +445,15 @@ ListItem *ListItemFactory::create(const UrlSearchItem &item, const QString &text
}
else
{
- newItem = new PreviewListItem(item, text, parent);
+
+ if (item.type & UrlSearchItem::Suggestion)
+ {
+ newItem = new SuggestionListItem(item, text, parent);
+ }
+ else
+ {
+ newItem = new PreviewListItem(item, text, parent);
+ }
}
}