summaryrefslogtreecommitdiff
path: root/src/searchengine.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-30 16:38:18 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-30 16:38:18 +0200
commitc1e00c7f7d0c2911d7529dcc23553f2284f41d8a (patch)
tree8dd18e51217cf13b436c90c65c74a9446d2b1a68 /src/searchengine.cpp
parentFix rsswidget files (diff)
downloadrekonq-c1e00c7f7d0c2911d7529dcc23553f2284f41d8a.tar.xz
Krazy fixes
Diffstat (limited to 'src/searchengine.cpp')
-rw-r--r--src/searchengine.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/searchengine.cpp b/src/searchengine.cpp
index 6541345b..d2bfaf34 100644
--- a/src/searchengine.cpp
+++ b/src/searchengine.cpp
@@ -78,7 +78,8 @@ KService::Ptr SearchEngine::fromString(QString text)
KService::Ptr service;
while (!found && i < providers.size())
{
- foreach(QString key, providers.at(i)->property("Keys").toStringList())
+ QStringList list = providers.at(i)->property("Keys").toStringList();
+ foreach(const QString &key, list)
{
const QString searchPrefix = key + delimiter();
if (text.startsWith(searchPrefix))
@@ -116,16 +117,17 @@ void SearchEngine::loadFavorites()
{
KConfig config("kuriikwsfilterrc"); //Share with konqueror
KConfigGroup cg = config.group("General");
- QStringList f;
- f << "wikipedia" << "google"; //defaults
- f = cg.readEntry("FavoriteSearchEngines", f);
+ QStringList favoriteEngines;
+ favoriteEngines << "wikipedia" << "google"; //defaults
+ favoriteEngines = cg.readEntry("FavoriteSearchEngines", favoriteEngines);
KService::List favorites;
KService::Ptr service;
- foreach(QString e, f)
+ foreach(const QString &engine, favoriteEngines)
{
- service = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(e));
- if (service) favorites << service;
+ service = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(engine));
+ if (service)
+ favorites << service;
}
m_favorites = favorites;
@@ -160,4 +162,3 @@ KService::Ptr SearchEngine::defaultEngine()
return KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(engine));
}
-