diff options
Diffstat (limited to 'src/websnap.cpp')
-rw-r--r-- | src/websnap.cpp | 19 |
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; } |