diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-09-29 12:15:17 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-09-29 12:15:17 +0200 |
commit | 40ced90916c742bd813be8bfaf7c17490a75a3e0 (patch) | |
tree | 750cbc86b076b1dc24a6d9c80d627f00ad54f892 /src/homepage.cpp | |
parent | Implementing a new about: protocol, 1st bunch (diff) | |
download | rekonq-40ced90916c742bd813be8bfaf7c17490a75a3e0.tar.xz |
Implemented about protocol to load home page(s)
and changed its layout
Diffstat (limited to 'src/homepage.cpp')
-rw-r--r-- | src/homepage.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
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 <QFile> -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 += "</ul>"; return menu; } + + +QString HomePage::history() +{ + return QString(""); +} + + +QString HomePage::bookmarks() +{ + return QString(""); +} + |