summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegabigbug <megabigbug@arrakis.(none)>2010-04-16 22:14:38 +0200
committermegabigbug <megabigbug@arrakis.(none)>2010-04-16 22:14:38 +0200
commit3f43542ea6857760d1da6b78ebc152ca4bfc286b (patch)
tree82913c20df01d6e4fd8dfe66ceccef626372b79b /src
parentFixing Lionel's merge request: (diff)
downloadrekonq-3f43542ea6857760d1da6b78ebc152ca4bfc286b.tar.xz
fix text pointed in the search item
Diffstat (limited to 'src')
-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);
};