summaryrefslogtreecommitdiff
path: root/src/webtab/previewselectorbar.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-08-01 11:12:08 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:04 +0100
commit6686e9920feff933c1d8251bc48bb4d7cfc4d0a0 (patch)
treea604c1a12542433941e842770da02ff24f268143 /src/webtab/previewselectorbar.cpp
parentLet WebView compile and work (diff)
downloadrekonq-6686e9920feff933c1d8251bc48bb4d7cfc4d0a0.tar.xz
Let WebTab compile (and everything NOT commented out...)
Diffstat (limited to 'src/webtab/previewselectorbar.cpp')
-rw-r--r--src/webtab/previewselectorbar.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/webtab/previewselectorbar.cpp b/src/webtab/previewselectorbar.cpp
index b743e3c9..24461e79 100644
--- a/src/webtab/previewselectorbar.cpp
+++ b/src/webtab/previewselectorbar.cpp
@@ -33,8 +33,6 @@
#include "rekonq.h"
// Local Include
-#include "application.h"
-#include "mainwindow.h"
#include "webpage.h"
#include "webtab.h"
#include "websnap.h"
@@ -70,8 +68,8 @@ PreviewSelectorBar::PreviewSelectorBar(int index, QWidget* parent)
void PreviewSelectorBar::verifyUrl()
{
-
- if (rApp->mainWindow()->currentTab()->page()->mainFrame()->url().scheme() != "about")
+ WebTab *tab = qobject_cast<WebTab *>(parent());
+ if (tab->url().scheme() != "about")
{
m_insertAction->setEnabled(true);
m_insertAction->setToolTip("");
@@ -102,21 +100,21 @@ void PreviewSelectorBar::loadFinished()
void PreviewSelectorBar::clicked()
{
- WebPage *page = rApp->mainWindow()->currentTab()->page();
-
- if (page)
+ WebTab *tab = qobject_cast<WebTab *>(parent());
+
+ if (tab->page())
{
- KUrl url = page->mainFrame()->url();
+ KUrl url = tab->url();
QStringList names = ReKonfig::previewNames();
QStringList urls = ReKonfig::previewUrls();
//cleanup the previous image from the cache (useful to refresh the snapshot)
QFile::remove(WebSnap::imagePathFromUrl(urls.at(m_previewIndex)));
- QPixmap preview = WebSnap::renderPagePreview(*page);
+ QPixmap preview = WebSnap::renderPagePreview(*tab->page());
preview.save(WebSnap::imagePathFromUrl(url));
urls.replace(m_previewIndex, url.toMimeDataString());
- names.replace(m_previewIndex, page->mainFrame()->title());
+ names.replace(m_previewIndex, tab->page()->mainFrame()->title());
ReKonfig::setPreviewNames(names);
ReKonfig::setPreviewUrls(urls);
@@ -124,7 +122,7 @@ void PreviewSelectorBar::clicked()
ReKonfig::self()->writeConfig();
- page->mainFrame()->load(KUrl("about:favorites"));
+ tab->page()->mainFrame()->load(KUrl("about:favorites"));
}
animatedHide();