summaryrefslogtreecommitdiff
path: root/src/previewselectorbar.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@nokia.com>2010-09-14 23:02:10 +0200
committerPierre Rossi <pierre.rossi@nokia.com>2010-09-15 18:40:33 +0200
commitaad3dfe4b42bd0f909755710d4fa2ac02ce59a0f (patch)
treeabbdaee0ca283e634f4f20c8f4c212b3885fba5b /src/previewselectorbar.cpp
parentUpgraded download i18n script to automagically grab translation strings (diff)
downloadrekonq-aad3dfe4b42bd0f909755710d4fa2ac02ce59a0f.tar.xz
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.
Diffstat (limited to 'src/previewselectorbar.cpp')
-rw-r--r--src/previewselectorbar.cpp6
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());