From 40ced90916c742bd813be8bfaf7c17490a75a3e0 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 29 Sep 2009 12:15:17 +0200 Subject: Implemented about protocol to load home page(s) and changed its layout --- src/homepage.cpp | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'src/homepage.cpp') diff --git a/src/homepage.cpp b/src/homepage.cpp index 230692c0..dabcaad7 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -49,9 +49,8 @@ #include -HomePage::HomePage(QObject *parent, const QString &authority) +HomePage::HomePage(QObject *parent) : QObject(parent) - , m_authority(authority) { m_homePagePath = KStandardDirs::locate("data", "rekonq/htmls/home.html"); } @@ -62,7 +61,7 @@ HomePage::~HomePage() } -QString HomePage::rekonqHomePage() +QString HomePage::rekonqHomePage(const KUrl &url) { QFile file(m_homePagePath); bool isOpened = file.open(QIODevice::ReadOnly); @@ -73,9 +72,18 @@ QString HomePage::rekonqHomePage() } QString imagesPath = QString("file://") + KGlobal::dirs()->findResourceDir("data", "rekonq/pics/bg.png") + QString("rekonq/pics"); - QString speed = speedDial(); QString menu = homePageMenu(); + QString speed; + if(url == KUrl("about:lastSites")) + speed = fillRecentHistory(); + if(url == KUrl("about:history")) + speed = history(); + if(url == KUrl("about:bookmarks")) + speed = bookmarks(); + if(url == KUrl("about:home") || url == KUrl("about:preferred")) + speed = speedDial(); + QString html = QString(QLatin1String(file.readAll())) .arg(imagesPath) .arg(menu) @@ -176,3 +184,16 @@ QString HomePage::homePageMenu() menu += ""; return menu; } + + +QString HomePage::history() +{ + return QString(""); +} + + +QString HomePage::bookmarks() +{ + return QString(""); +} + -- cgit v1.2.1