From b4516b0bacb68179eb6f7cbff9c6474ec03cc9ab Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 30 Sep 2009 10:21:58 +0200 Subject: BIG BIG commit removed: - last closed tabs feature - new tab page settings (unuseful, we need something better) implemented - new home page layout (needs love) - new about: protocol to load home page sections - preview images cache todo: - cleaning cache mechanism - bug fixing - add/remove to preferred actions --- src/websnap.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/websnap.cpp') diff --git a/src/websnap.cpp b/src/websnap.cpp index 6293b2e9..9d747e66 100644 --- a/src/websnap.cpp +++ b/src/websnap.cpp @@ -43,11 +43,10 @@ #define HEIGHT 150 -WebSnap::WebSnap(const QString &url, const QString &pos) +WebSnap::WebSnap(const QString &url) : QObject() { m_url = url; - m_pos = pos; // this to not register websnap history m_page.settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); @@ -61,6 +60,7 @@ void WebSnap::load() m_page.mainFrame()->load( QUrl(m_url) ); } + QPixmap WebSnap::renderPreview(const QWebPage &page,int w, int h) { // prepare page @@ -102,6 +102,7 @@ QPixmap WebSnap::renderPreview(const QWebPage &page,int w, int h) return image; } + void WebSnap::saveResult(bool ok) { // crude error-checking @@ -111,12 +112,8 @@ void WebSnap::saveResult(bool ok) return; } - QString path = KStandardDirs::locateLocal("cache", QString("thumbs/rek") + m_pos + ".png", true); m_image = renderPreview(m_page, WIDTH, HEIGHT); - if(m_image.save(path)) - { - emit finished(); - } + emit finished(); } -- cgit v1.2.1