diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-07-27 17:37:33 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-07-27 17:44:12 +0200 |
commit | 1ca437fa5c27c54b8a4f193e04cdc4ea9cc68ce1 (patch) | |
tree | 0642b179ac4a15f5828fc5498f25dd9911cd37f5 | |
parent | SVN_SILENT made messages (.desktop file) (diff) | |
download | rekonq-1ca437fa5c27c54b8a4f193e04cdc4ea9cc68ce1.tar.xz |
Fix search engine(s) for KDE 4.9
This is basically Johannes patch with checks added for kde version and
with code duplicated for kwebapp.
PS: I tried using KUriFilterData API to do it, without positive results.
Postponing a code review here for KDE 5, hoping variables won't change
another time name...
CCBUG: 303872
CCMAIL: fritz_van_tom@hotmail.com
REVIEW: 303872
-rw-r--r-- | kwebapp/searchengine.cpp | 20 | ||||
-rw-r--r-- | src/opensearch/searchengine.cpp | 22 |
2 files changed, 31 insertions, 11 deletions
diff --git a/kwebapp/searchengine.cpp b/kwebapp/searchengine.cpp index 6f7f6edc..212f0ee8 100644 --- a/kwebapp/searchengine.cpp +++ b/kwebapp/searchengine.cpp @@ -48,15 +48,20 @@ K_GLOBAL_STATIC(SearchEnginePrivate, d) void SearchEngine::reload() { - KConfig config("kuriikwsfilterrc"); //Shared with konqueror + KConfig config("kuriikwsfilterrc"); KConfigGroup cg = config.group("General"); - //load delimiter + // load delimiter d->delimiter = cg.readEntry("KeywordDelimiter", ":"); - //load favorite engines + // load favorite engines QStringList favoriteEngines; +#if KDE_IS_VERSION(4,9,0) + favoriteEngines = cg.readEntry("PreferredWebShortcuts", favoriteEngines); +#else favoriteEngines = cg.readEntry("FavoriteSearchEngines", favoriteEngines); +#endif + KService::List favorites; KService::Ptr service; Q_FOREACH(const QString & engine, favoriteEngines) @@ -69,8 +74,13 @@ void SearchEngine::reload() } d->favorites = favorites; - //load default engine - QString dse = cg.readEntry("DefaultSearchEngine"); + // load default engine + QString dse; +#if KDE_IS_VERSION(4,9,0) + dse = cg.readEntry("DefaultWebShortcut"); +#else + dse = cg.readEntry("DefaultSearchEngine"); +#endif d->defaultEngine = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(dse)); d->isLoaded = true; diff --git a/src/opensearch/searchengine.cpp b/src/opensearch/searchengine.cpp index aef06a7b..2614b603 100644 --- a/src/opensearch/searchengine.cpp +++ b/src/opensearch/searchengine.cpp @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2008-2011 by Andrea Diamantini <adjam7 at gmail dot com> +* Copyright (C) 2008-2012 by Andrea Diamantini <adjam7 at gmail dot com> * Copyright (C) 2009-2011 by Lionel Chauvin <megabigbug@yahoo.fr> * * @@ -53,15 +53,20 @@ K_GLOBAL_STATIC(SearchEnginePrivate, d) void SearchEngine::reload() { - KConfig config("kuriikwsfilterrc"); //Shared with konqueror + KConfig config("kuriikwsfilterrc"); KConfigGroup cg = config.group("General"); - //load delimiter + // load delimiter d->delimiter = cg.readEntry("KeywordDelimiter", ":"); - //load favorite engines + // load favorite engines QStringList favoriteEngines; +#if KDE_IS_VERSION(4,9,0) + favoriteEngines = cg.readEntry("PreferredWebShortcuts", favoriteEngines); +#else favoriteEngines = cg.readEntry("FavoriteSearchEngines", favoriteEngines); +#endif + KService::List favorites; KService::Ptr service; Q_FOREACH(const QString & engine, favoriteEngines) @@ -77,8 +82,13 @@ void SearchEngine::reload() } d->favorites = favorites; - //load default engine - QString dse = cg.readEntry("DefaultSearchEngine"); + // load default engine + QString dse; +#if KDE_IS_VERSION(4,9,0) + dse = cg.readEntry("DefaultWebShortcut"); +#else + dse = cg.readEntry("DefaultSearchEngine"); +#endif d->defaultEngine = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(dse)); d->isLoaded = true; |