From aad3dfe4b42bd0f909755710d4fa2ac02ce59a0f Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Tue, 14 Sep 2010 23:02:10 +0200 Subject: Websnaps: change the image path to use base64. This should solve the problems caused by special characters for good. A few other improvements: - do not call updateImage as many times as there are favorites. - removed an unused variable. - trade #defines for static const ints - take advantage of the already loaded page to refresh the snapshot. --- src/previewselectorbar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/previewselectorbar.cpp') diff --git a/src/previewselectorbar.cpp b/src/previewselectorbar.cpp index 209a0a92..1b3d3380 100644 --- a/src/previewselectorbar.cpp +++ b/src/previewselectorbar.cpp @@ -31,6 +31,7 @@ // Self Includes #include "rekonq.h" +#include "websnap.h" // Local Include #include "application.h" @@ -126,6 +127,11 @@ void PreviewSelectorBar::clicked() KUrl url = page->mainFrame()->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))); + page->mainFrame()->setScrollBarValue(Qt::Vertical, 0); + QPixmap preview = WebSnap::renderPagePreview(*page); + preview.save(WebSnap::imagePathFromUrl(url)); urls.replace(m_previewIndex, url.toMimeDataString()); names.replace(m_previewIndex, page->mainFrame()->title()); -- cgit v1.2.1