summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/search/searchengine.cpp9
-rw-r--r--src/search/searchengine.h6
-rw-r--r--src/urlbar/listitem.cpp6
3 files changed, 9 insertions, 12 deletions
diff --git a/src/search/searchengine.cpp b/src/search/searchengine.cpp
index 8eecfa52..89e62dee 100644
--- a/src/search/searchengine.cpp
+++ b/src/search/searchengine.cpp
@@ -111,7 +111,7 @@ KService::Ptr SearchEngine::defaultEngine()
}
-KService::Ptr SearchEngine::fromString(QString text)
+KService::Ptr SearchEngine::fromString(const QString &text)
{
KService::List providers = KServiceTypeTrader::self()->query("SearchProvider");
int i = 0;
@@ -136,7 +136,7 @@ KService::Ptr SearchEngine::fromString(QString text)
}
-QString SearchEngine::extractQuery(QString text)
+QString SearchEngine::extractQuery(const QString &text)
{
QString query = text;
KService::Ptr engine = SearchEngine::fromString(text);
@@ -149,12 +149,9 @@ QString SearchEngine::extractQuery(QString text)
}
-QString SearchEngine::buildQuery(KService::Ptr engine, QString text)
+QString SearchEngine::buildQuery(KService::Ptr engine, const QString &text)
{
QString query = engine->property("Query").toString();
query = query.replace("\\{@}", KUrl::toPercentEncoding(text));
return query;
}
-
-
-
diff --git a/src/search/searchengine.h b/src/search/searchengine.h
index aa7d7a8b..d813666b 100644
--- a/src/search/searchengine.h
+++ b/src/search/searchengine.h
@@ -45,9 +45,9 @@ public:
static QString delimiter();
static KService::Ptr defaultEngine();
static KService::List favorites();
- static KService::Ptr fromString(QString text);
- static QString buildQuery(KService::Ptr engine, QString text);
- static QString extractQuery(QString text);
+ static KService::Ptr fromString(const QString &text);
+ static QString buildQuery(KService::Ptr engine, const QString &text);
+ static QString extractQuery(const QString &text);
private:
static bool m_loaded;
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index 75b47949..0df080ae 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -286,14 +286,14 @@ PreviewLabel::PreviewLabel(const QString &url, int width, int height, QWidget *p
// ---------------------------------------------------------------
-SearchListItem::SearchListItem(const UrlSearchItem &item, const QString &text, QWidget *paren)
- : ListItem(item, paren)
+SearchListItem::SearchListItem(const UrlSearchItem &item, const QString &text, QWidget *parent)
+ : ListItem(item, parent)
, m_text(text)
{
m_iconLabel = new IconLabel(SearchEngine::buildQuery(UrlResolver::searchEngine(), ""), this);
QString query = SearchEngine::extractQuery(text);
m_titleLabel = new TextLabel(searchItemTitle(item.title, query), query, this);
- m_engineBar = new EngineBar(UrlResolver::searchEngine(), paren);
+ m_engineBar = new EngineBar(UrlResolver::searchEngine(), parent);
QHBoxLayout *hLayout = new QHBoxLayout;
hLayout->setSpacing(4);