diff options
Diffstat (limited to 'src/previewselectorbar.cpp')
-rw-r--r-- | src/previewselectorbar.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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()); |