From 0af4d7e7ead3004092380d9f6baa74edf063cf27 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 14 Sep 2009 01:12:32 +0200 Subject: Google search engine --- src/homepage.cpp | 137 ++++++++----------------------------------------------- 1 file changed, 18 insertions(+), 119 deletions(-) diff --git a/src/homepage.cpp b/src/homepage.cpp index 6a327b3a..a04b6e6d 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -117,27 +117,25 @@ QString HomePage::searchEngines() { 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); +// 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 + ":
"; +// } +// } - 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); - } - } + // Google search engine + engines += "
"; + engines += ""; + engines += ""; + engines += "
"; return engines; } @@ -155,102 +153,3 @@ QString HomePage::recentlyClosedTabs() } return closed; } - -// QString HomePage::fillHistory() -// { -// QString history = QString(); -// HistoryTreeModel *model = Application::historyManager()->historyTreeModel(); -// -// int i = 0; -// do -// { -// QModelIndex index = model->index(i, 0, QModelIndex() ); -// if(model->hasChildren(index)) -// { -// QString s = QString::number(i); -// history += createSubMenu(index.data().toString(), s); -// history += "

"; -// for(int j=0; j< model->rowCount(index); ++j) -// { -// QModelIndex son = model->index(j, 0, index ); -// // FIXME add an icon to each history item history += "\"icon\""; -// history += QString("") + -// son.data().toString() + QString("
"); -// } -// history += "

"; -// } -// else -// { -// history += QString("

NO CHILDREN: ") + index.data().toString() + QString("

"); -// } -// i++; -// } -// while( model->hasIndex( i , 0 , QModelIndex() ) ); -// -// return history; -// -// } -// -// -// QString HomePage::fillBookmarks() -// { -// KBookmarkGroup toolBarGroup = Application::bookmarkProvider()->rootGroup(); -// if (toolBarGroup.isNull()) -// { -// return QString("Error retrieving bookmarks!"); -// } -// -// QString str = QString(""); -// KBookmark bookmark = toolBarGroup.first(); -// while (!bookmark.isNull()) -// { -// str += createBookItem(bookmark); -// bookmark = toolBarGroup.next(bookmark); -// } -// -// return str; -// } -// -// -// QString HomePage::createSubMenu(const QString &item, const QString &s) -// { -// QString menu = "
"; -// -// menu += "

" + item + "

"; -// return menu; -// } -// -// -// QString HomePage::createBookItem(const KBookmark &bookmark) -// { -// static int i = 0; -// -// if (bookmark.isGroup()) -// { -// QString result = QString(""); -// QString ss = "b" + QString::number(i); -// i++; -// -// KBookmarkGroup group = bookmark.toGroup(); -// KBookmark bm = group.first(); -// result += createSubMenu( bookmark.text() , ss ); -// result += "

"; -// -// while (!bm.isNull()) -// { -// result += createBookItem(bm); //menuAction->addAction(fillBookmarkBar(bm)); -// bm = group.next(bm); -// } -// result += "

"; -// return result; -// } -// -// if(bookmark.isSeparator()) -// { -// return QString("
"); -// } -// -// QString str = ""; // FIXME Add icon "\"icon\""; -// str += "" + bookmark.text() + "
"; -// return str; -// } -- cgit v1.2.1