From 01e5c03236fa589b719544f478ea036b8b1e2ee7 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 1 Oct 2009 12:02:30 +0200 Subject: Code fixes in the homepage also changed history && bookmarks layout (we need just icons there) --- src/homepage.cpp | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'src/homepage.cpp') diff --git a/src/homepage.cpp b/src/homepage.cpp index 5b8c9de2..e728b949 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -102,8 +102,8 @@ QString HomePage::fillPreferred() for(int i=0; i<4; ++i) { speed += "
"; - speed += ""; - speed += ""; + speed += ""; speed += ""; speed += "

"; speed += "" + names.at(i) + ""; @@ -112,8 +112,8 @@ QString HomePage::fillPreferred() for(int i=4; i<8; ++i) { speed += "
"; - speed += ""; - speed += ""; + speed += ""; speed += ""; speed += "

"; speed += "" + names.at(i) + ""; @@ -140,9 +140,8 @@ QString HomePage::lastVisitedSites() QModelIndex son = model->index(j, 0, index ); last += "
"; - last += ""; - last += ""; - last += ""; + last += ""; last += ""; last += "

"; last += "" + son.data().toString() + ""; @@ -155,9 +154,8 @@ QString HomePage::lastVisitedSites() QModelIndex son = model->index(j, 0, index ); last += "
"; - last += ""; - last += ""; - last += ""; + last += ""; last += ""; last += "

"; last += "" + son.data().toString() + ""; @@ -189,7 +187,7 @@ QString HomePage::homePageMenu() QString HomePage::fillHistory() { - QString history = ""; + QString history = ""; HistoryTreeModel *model = Application::historyManager()->historyTreeModel(); int i = 0; @@ -198,14 +196,15 @@ QString HomePage::fillHistory() QModelIndex index = model->index(i, 0, QModelIndex() ); if(model->hasChildren(index)) { - history += ""; + history += "

" + index.data().toString() + "

"; for(int j=0; j< model->rowCount(index); ++j) { QModelIndex son = model->index(j, 0, index ); - history += QString(""); - history += QString(""); - history += QString(""); + history += son.data(HistoryModel::DateTimeRole).toDateTime().toString("hh:mm"); + history += " "; + history += QString("") + + son.data().toString() + QString(""); + history += "
"; } } i++; @@ -226,14 +225,13 @@ QString HomePage::fillBookmarks() return QString("Error retrieving bookmarks!"); } - QString str = QString("

" + index.data().toString() + "

") + son.data().toString() + QString("") + - son.data(HistoryModel::UrlStringRole).toString() + QString("") + son.data(HistoryModel::DateTimeRole).toString() + QString("
"); + QString str = QString(""); KBookmark bookmark = bookGroup.first(); while (!bookmark.isNull()) { str += createBookItem(bookmark); bookmark = bookGroup.next(bookmark); } - str += QString("
"); return str; } @@ -245,7 +243,7 @@ QString HomePage::createBookItem(const KBookmark &bookmark) QString result = QString(""); KBookmarkGroup group = bookmark.toGroup(); KBookmark bm = group.first(); - result += "

" + bookmark.text() + "

"; + result += "

" + bookmark.text() + "

"; while (!bm.isNull()) { @@ -259,5 +257,8 @@ QString HomePage::createBookItem(const KBookmark &bookmark) { return QString("
"); } - return "" + bookmark.text() + "" + bookmark.url().prettyUrl() + ""; + + QString books = " "; + books += "" + bookmark.text() + "
"; + return books; } -- cgit v1.2.1