summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-10-28 23:54:09 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-10-28 23:54:09 +0200
commita3c6101c8aec18dcfca90b99965b9a2e94b13ade (patch)
tree93f48582e252c986f31a05c784f9635c0c29408a
parentMerge branch 'Open_last_tab_with_history' into NEWMASTER (diff)
downloadrekonq-a3c6101c8aec18dcfca90b99965b9a2e94b13ade.tar.xz
Fix KDE webshortcuts handling with new highlight system. (no more hangs)
-rw-r--r--src/opensearch/searchengine.cpp10
-rw-r--r--src/urlbar/listitem.cpp51
2 files changed, 35 insertions, 26 deletions
diff --git a/src/opensearch/searchengine.cpp b/src/opensearch/searchengine.cpp
index 89e62dee..415e5b35 100644
--- a/src/opensearch/searchengine.cpp
+++ b/src/opensearch/searchengine.cpp
@@ -140,10 +140,12 @@ QString SearchEngine::extractQuery(const QString &text)
{
QString query = text;
KService::Ptr engine = SearchEngine::fromString(text);
- if (engine)
- {
- query = query.remove(0, text.indexOf(SearchEngine::delimiter()) + 1);
- }
+
+ // WARNING: this lets rekonq hangs on kde: urlbar typing..
+// if (engine)
+// {
+// query = query.remove(0, text.indexOf(SearchEngine::delimiter()) + 1);
+// }
return query;
}
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index df9ef286..8406c792 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -465,7 +465,7 @@ SuggestionListItem::SuggestionListItem(const UrlSearchItem &item, const QString
hLayout->setSpacing(4);
hLayout->addWidget(new IconLabel(item.url, this));
- hLayout->addWidget(new TextLabel(item.title, SearchEngine::extractQuery(text), this));
+ hLayout->addWidget(new TextLabel(item.title, text, this));
hLayout->addWidget(new TypeIconLabel(item.type, this));
setLayout(hLayout);
@@ -502,32 +502,39 @@ BrowseListItem::BrowseListItem(const UrlSearchItem &item, const QString &text, Q
ListItem *ListItemFactory::create(const UrlSearchItem &item, const QString &text, QWidget *parent)
-{
- ListItem *newItem;
+{
+ if (item.type & UrlSearchItem::Search)
+ {
+ kDebug() << "Search";
+ return new SearchListItem(item, text, parent);
+ }
+
if (item.type & UrlSearchItem::Browse)
{
- newItem = new BrowseListItem(item, text, parent);
+ kDebug() << "Browse";
+ return new BrowseListItem(item, text, parent);
}
- else
+
+ if (item.type & UrlSearchItem::History)
{
- if (item.type & UrlSearchItem::Search)
- {
- newItem = new SearchListItem(item, text, parent);
- }
- else
- {
-
- if (item.type & UrlSearchItem::Suggestion)
- {
- newItem = new SuggestionListItem(item, text, parent);
- }
- else
- {
- newItem = new PreviewListItem(item, text, parent);
- }
- }
+ kDebug() << "History";
+ return new PreviewListItem(item, text, parent);
+ }
+
+ if (item.type & UrlSearchItem::Bookmark)
+ {
+ kDebug() << "Bookmark";
+ return new PreviewListItem(item, text, parent);
+ }
+
+ if (item.type & UrlSearchItem::Suggestion)
+ {
+ kDebug() << "Suggestion";
+ return new SuggestionListItem(item, text, parent);
}
- return newItem;
+ kDebug() << "Undefined";
+ return new PreviewListItem(item, text, parent);
+
}