diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-09-13 18:40:41 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-09-14 18:36:47 +0200 |
commit | 0506db8875284f5dc324e8b22674a7d3f1c575fe (patch) | |
tree | 9a47629818631d85bf56ac531f2be9c7f1fd8d16 | |
parent | Adding url to previews (diff) | |
download | rekonq-0506db8875284f5dc324e8b22674a7d3f1c575fe.tar.xz |
Search Engine, first draft
Time to cook, now :)
Hope you glad this "technologic" preview
-rw-r--r-- | src/homepage.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/homepage.cpp b/src/homepage.cpp index 957118f8..430fa9a6 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -38,6 +38,8 @@ #include <KStandardDirs> #include <KIconLoader> #include <KDebug> +#include <KConfig> +#include <KConfigGroup> // Qt Includes #include <QFile> @@ -109,7 +111,29 @@ QString HomePage::speedDial() QString HomePage::searchEngines() { - QString engines = "engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines engines "; + QString engines = "<h2>Search Engines</h2>"; + + KConfig config("kuriikwsfilterrc"); //Share with konqueror + KConfigGroup cg = config.group("General"); + QStringList favoriteEngines; + favoriteEngines << "google" << "wikipedia"; //defaults + favoriteEngines = cg.readEntry("FavoriteSearchEngines", favoriteEngines); + + foreach (const QString &engine, favoriteEngines) + { + if(!engine.isEmpty()) + { + engines += engine + ": <input type=\"text\" name=\"" + engine + "\" /><br />"; +// service = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(engine)); +// const QString searchProviderPrefix = *(service->property("Keys").toStringList().begin()) + keywordDelimiter; +// data.setData(searchProviderPrefix + "some keyword"); +// a = new KAction(service->name(), this); +// a->setIcon(Application::icon(KUrl(data.uri()))); +// a->setData(searchProviderPrefix); +// connect(a, SIGNAL(triggered(bool)), this, SLOT(slotSearch())); +// searchMenu->addAction(a); + } + } return engines; } |