From 06981ab37e9bcbbed7fcbe08b6dd2be725f04d24 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 2 Oct 2009 01:29:16 +0200 Subject: Changin (again) layout and fixing last Visited page counter.. :) --- src/homepage.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/homepage.cpp b/src/homepage.cpp index e3af4cc2..bfbf0400 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -99,7 +99,7 @@ QString HomePage::fillFavorites() QStringList names = ReKonfig::previewNames(); QStringList urls = ReKonfig::previewUrls(); - QString speed = ""; + QString speed = "

Favorites

"; for(int i=0; i<8; ++i) { QString text = names.at(i); @@ -124,14 +124,15 @@ QString HomePage::lastVisitedSites() { HistoryTreeModel *model = Application::historyManager()->historyTreeModel(); - QString last = ""; + QString last = "

Last Visited Sites

"; + int sites = 0; int i = 0; do { QModelIndex index = model->index(i, 0, QModelIndex() ); if(model->hasChildren(index)) { - for(int j=0; j< model->rowCount(index) && j<8; ++j) + for(int j=0; j< model->rowCount(index) && sites<8; ++j) { QModelIndex son = model->index(j, 0, index ); @@ -147,13 +148,12 @@ QString HomePage::lastVisitedSites() last += ""; last += "

"; last += "" + text + ""; - - i++; + sites++; } } i++; } - while( i<8 || model->hasIndex( i , 0 , QModelIndex() ) ); + while( sites<8 || model->hasIndex( i , 0 , QModelIndex() ) ); return last; @@ -162,21 +162,20 @@ QString HomePage::lastVisitedSites() QString HomePage::homePageMenu() { - QString menu = ""; + QString menu = ""; + menu += "
Last Visited Sites
"; + menu += "
History
"; + menu += "
Bookmarks
"; + menu += "
Favorites
"; return menu; } QString HomePage::fillHistory() { - QString history = ""; HistoryTreeModel *model = Application::historyManager()->historyTreeModel(); + QString history = "

History

"; int i = 0; do { @@ -200,7 +199,6 @@ QString HomePage::fillHistory() history += ""; return history; - } @@ -212,7 +210,7 @@ QString HomePage::fillBookmarks() return QString("Error retrieving bookmarks!"); } - QString str = QString(""); + QString str = "

Bookmarks

"; KBookmark bookmark = bookGroup.first(); while (!bookmark.isNull()) { -- cgit v1.2.1