summaryrefslogtreecommitdiff
path: root/src/websnap.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-06-18 17:22:04 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-06-18 17:22:04 +0200
commit7800e131b954ef646fb4db073eb9d09a677b09b9 (patch)
tree7738b84e6e9afc66adb97aba809a19e6d5a36100 /src/websnap.cpp
parentAdding a "default" encoding option.. (diff)
downloadrekonq-7800e131b954ef646fb4db073eb9d09a677b09b9.tar.xz
No more save tab previews as they are everytime computed again..
Diffstat (limited to 'src/websnap.cpp')
-rw-r--r--src/websnap.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/websnap.cpp b/src/websnap.cpp
index 0f2dc7b9..b85e5da8 100644
--- a/src/websnap.cpp
+++ b/src/websnap.cpp
@@ -81,7 +81,7 @@ void WebSnap::load()
// NOTE please, be careful modifying this.
// You are playing with fire..
-QPixmap WebSnap::renderPreview(const QWebPage &page, int w, int h)
+QPixmap WebSnap::renderPreview(const QWebPage &page, int w, int h, bool save)
{
// NOTE
// it seems no way to enable/disable scrollbars in new QtWebKit's
@@ -118,13 +118,16 @@ QPixmap WebSnap::renderPreview(const QWebPage &page, int w, int h)
page.setViewportSize(oldSize);
QPixmap pm = QPixmap::fromImage(pageImage);
- KUrl url(page.mainFrame()->url());
- kDebug() << "saving preview";
-
- QString path = imagePathFromUrl(url);
- QFile::remove(path);
- pm.save(path);
-
+
+ if(save)
+ {
+ KUrl url(page.mainFrame()->url());
+ kDebug() << "saving preview";
+ QString path = imagePathFromUrl(url);
+ QFile::remove(path);
+ pm.save(path);
+ }
+
return pm;
}