From 0506db8875284f5dc324e8b22674a7d3f1c575fe Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 13 Sep 2009 18:40:41 +0200 Subject: Search Engine, first draft Time to cook, now :) Hope you glad this "technologic" preview --- src/homepage.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src') 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 #include #include +#include +#include // Qt Includes #include @@ -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 = "

Search Engines

"; + + 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 + ":
"; +// 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; } -- cgit v1.2.1