From c5aaa8d3f6dcc62bacdbe6829ef14ff4258e26c7 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 2 Feb 2012 17:58:17 +0100 Subject: Removed unuseful renderClosingTabPreview --- src/webpage.cpp | 2 +- src/websnap.cpp | 14 +------------- src/websnap.h | 11 ----------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/webpage.cpp b/src/webpage.cpp index 7e2214fa..89c52e8a 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -168,7 +168,7 @@ WebPage::~WebPage() { disconnect(); - QPixmap preview = WebSnap::renderClosingPagePreview(*this); + QPixmap preview = WebSnap::renderPagePreview(*this); QString path = WebSnap::imagePathFromUrl(mainFrame()->url().toString()); QFile::remove(path); preview.save(path); diff --git a/src/websnap.cpp b/src/websnap.cpp index 6bbaa06a..6db6b3be 100644 --- a/src/websnap.cpp +++ b/src/websnap.cpp @@ -103,18 +103,6 @@ QPixmap WebSnap::renderTabPreview(const QWebPage &page, int w, int h) } -QPixmap WebSnap::renderClosingPagePreview(const QWebPage &page, int w, int h) -{ - //scroll to top - page.mainFrame()->setScrollBarValue(Qt::Vertical, 0); - - // reduce as much as possible - page.setViewportSize(QSize(10, 10)); - - return renderPagePreview(page, w, h); -} - - QPixmap WebSnap::renderPagePreview(const QWebPage &page, int w, int h) { // remove temporarily scrollbars @@ -124,7 +112,7 @@ QPixmap WebSnap::renderPagePreview(const QWebPage &page, int w, int h) int width = page.mainFrame()->contentsSize().width(); page.setViewportSize(QSize(width, width * ((0.0 + h) / w))); - //render + // render QPixmap pageImage = WebSnap::render(page, page.viewportSize().width(), page.viewportSize().height()); // resize image diff --git a/src/websnap.h b/src/websnap.h index f227f083..12a5e04c 100644 --- a/src/websnap.h +++ b/src/websnap.h @@ -89,17 +89,6 @@ public: // static QPixmap renderVisiblePagePreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT); // TODO: try to make this method work => more previews for the urlbar - /** - * Snaps a pixmap of size w * h from a page of a tab that is currently closing - * - * @param page the page to snap - * @param w the image width - * @param h the image height - * - * @return the pixmap snapped from the page - */ - static QPixmap renderClosingPagePreview(const QWebPage &page, int w = defaultWidth, int h = defaultHeight); - /** * Snaps a pixmap of size w * h from a page for tab preview * -- cgit v1.2.1