diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-11-07 16:35:41 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-11-07 16:35:41 +0100 |
commit | 65e287ee4a68dcd5019d3fad13b3ebfdd1ef23d4 (patch) | |
tree | 379a3c99565c72a9f7315f2aef093e6a8c3af87e /src/urlbar/listitem.cpp | |
parent | commit the changes by yurchor on the docbook (diff) | |
download | rekonq-65e287ee4a68dcd5019d3fad13b3ebfdd1ef23d4.tar.xz |
First bunch of fixes for the suggestions.
We are now respecting users setting on default engines (if someone chooses NONE
default search engines, searches are NOT performed)
Diffstat (limited to 'src/urlbar/listitem.cpp')
-rw-r--r-- | src/urlbar/listitem.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp index 5fa46470..a0462e76 100644 --- a/src/urlbar/listitem.cpp +++ b/src/urlbar/listitem.cpp @@ -58,6 +58,7 @@ #include <QFile> #include <QTextDocument> + ListItem::ListItem(const UrlSearchItem &item, QWidget *parent) : QWidget(parent) , m_option() @@ -81,7 +82,6 @@ ListItem::~ListItem() } - void ListItem::activate() { m_option.state |= QStyle::State_Selected; @@ -166,11 +166,16 @@ TypeIconLabel::TypeIconLabel(int type, QWidget *parent) hLayout->setAlignment(Qt::AlignRight); setLayout(hLayout); - if (type & UrlSearchItem::Search) hLayout->addWidget(getIcon("edit-find")); - 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")); + if (type & UrlSearchItem::Search) + hLayout->addWidget(getIcon("edit-find")); + 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")); } @@ -204,8 +209,10 @@ IconLabel::IconLabel(const KIcon &icon, QWidget *parent) setPixmap(pixmapIcon); } + // --------------------------------------------------------------- + static QString highlightWordsInText(const QString &text, const QStringList &words) { QString ret = text; @@ -241,6 +248,7 @@ static QString highlightWordsInText(const QString &text, const QStringList &word return ret; } + TextLabel::TextLabel(const QString &text, const QString &textToPointOut, QWidget *parent) : QLabel(parent) { @@ -274,6 +282,7 @@ void TextLabel::setEngineText(const QString &engine, const QString &text) setText( i18nc("%1=search engine, e.g. Google, Wikipedia %2=text to search for", "Search %1 for <b>%2</b>", engine, Qt::escape(text) ) ); } + // --------------------------------------------------------------- @@ -350,6 +359,7 @@ PreviewLabel::PreviewLabel(const QString &url, int width, int height, QWidget *p } } + // --------------------------------------------------------------- @@ -382,6 +392,7 @@ void ImageLabel::slotResult(KJob *) setPixmap(pix); } + // --------------------------------------------------------------- @@ -416,12 +427,6 @@ QString SearchListItem::text() } -// QString SearchListItem::searchItemTitle(QString engine, QString text) -// { -// return QString(i18nc("%1=search engine, e.g. Google, Wikipedia %2=text to search for", "Search %1 for %2", engine, text)); -// } - - void SearchListItem::changeSearchEngine(KService::Ptr engine) { m_titleLabel->setEngineText(engine->name(), m_text); @@ -575,6 +580,7 @@ QString VisualSuggestionListItem::text() return m_text; } + // --------------------------------------------------------------- @@ -627,6 +633,7 @@ ListItem *ListItemFactory::create(const UrlSearchItem &item, const QString &text if (item.type & UrlSearchItem::Suggestion) { + kDebug() << "ITEM URL: " << item.url; if (item.description.isEmpty()) { kDebug() << "Suggestion"; |