summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-07-28 10:23:46 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:04 +0100
commit14e028ca8cff8795c24aff3e9c131d4351be83f7 (patch)
tree3ebfbc2224e85ab13c12efbf8a12dbb14cb64e5a
parentAdded NEW UrlResolver class (from kwebapp) and SearchEngine old one... (diff)
downloadrekonq-14e028ca8cff8795c24aff3e9c131d4351be83f7.tar.xz
Update SearchEngine class to fix it with KDE 4.9 changes
-rw-r--r--src/searchengine.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/searchengine.cpp b/src/searchengine.cpp
index 6f7f6edc..9f0dd847 100644
--- a/src/searchengine.cpp
+++ b/src/searchengine.cpp
@@ -54,9 +54,14 @@ void SearchEngine::reload()
//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,14 @@ 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;