summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-17 15:54:14 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-17 15:54:14 +0200
commit3739aa111b231cab0dacfa8ce4a2268f2a4a8a1a (patch)
tree9e7b02769401dc03e25198161f2478a62c133db7
parentMerge commit 'refs/merge-requests/79' of git://gitorious.org/rekonq/mainline ... (diff)
parentfix text pointed in the search item (diff)
downloadrekonq-3739aa111b231cab0dacfa8ce4a2268f2a4a8a1a.tar.xz
Merge commit 'refs/merge-requests/81' of git://gitorious.org/rekonq/mainline into m81
-rw-r--r--src/urlbar/listitem.cpp8
-rw-r--r--src/urlbar/listitem.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index 7d1d39b2..6f91aabd 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -199,7 +199,9 @@ ItemText::ItemText(const QString &text, const QString &textToPointOut, QWidget *
: QLabel(parent)
{
QString t = text;
- t = t.replace(QRegExp("(" + textToPointOut + ")", Qt::CaseInsensitive), "<b>\\1</b>");
+ if (!textToPointOut.isEmpty())
+ t = t.replace(QRegExp("(" + textToPointOut + ")", Qt::CaseInsensitive), "<b>\\1</b>");
+
setText(t);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
}
@@ -279,7 +281,7 @@ SearchListItem::SearchListItem(const UrlSearchItem &item, const QString &text, Q
if (m_currentEngine == "") m_currentEngine = EngineBar::defaultEngine();
m_iconLabel = new ItemIcon("edit-find", this); //TODO: get the default engine icon
- m_titleLabel = new ItemText(searchItemTitle(m_currentEngine, text), text);
+ m_titleLabel = new ItemText(searchItemTitle(m_currentEngine, text));
m_engineBar = new EngineBar(text, m_currentEngine, this);
// without this it will not work :)
@@ -297,7 +299,7 @@ SearchListItem::SearchListItem(const UrlSearchItem &item, const QString &text, Q
QString SearchListItem::searchItemTitle(QString engine, QString text)
{
- return QString("Search "+ engine +" for <u>"+text+"</u>");
+ return QString("Search "+ engine +" for <b>"+text+"</b>");
}
diff --git a/src/urlbar/listitem.h b/src/urlbar/listitem.h
index e355160a..2f6f898a 100644
--- a/src/urlbar/listitem.h
+++ b/src/urlbar/listitem.h
@@ -114,7 +114,7 @@ class ItemText : public QLabel
Q_OBJECT
public:
- ItemText(const QString &text, const QString &textToPointOut, QWidget *parent = 0);
+ ItemText(const QString &text, const QString &textToPointOut = QString(), QWidget *parent = 0);
};