diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/websnap.cpp | 11 | ||||
-rw-r--r-- | src/websnap.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/websnap.cpp b/src/websnap.cpp index aaaed1d5..0f2dc7b9 100644 --- a/src/websnap.cpp +++ b/src/websnap.cpp @@ -42,12 +42,12 @@ #include <QtCore/QFile> #include <QtGui/QPainter> +#include <QtGui/QAction> #include <QtWebKit/QWebFrame> #include <QtWebKit/QWebSettings> - WebSnap::WebSnap(const KUrl& url, QObject *parent) : QObject(parent) , m_url(url) @@ -64,6 +64,15 @@ WebSnap::WebSnap(const KUrl& url, QObject *parent) QTimer::singleShot(0, this, SLOT(load())); } + +WebSnap::~WebSnap() +{ + kDebug() << "oh oh.."; + m_page.action(QWebPage::Stop)->trigger(); + m_page.deleteLater(); +} + + void WebSnap::load() { m_page.mainFrame()->load(m_url); diff --git a/src/websnap.h b/src/websnap.h index c85dc0d2..03d63746 100644 --- a/src/websnap.h +++ b/src/websnap.h @@ -77,6 +77,8 @@ public: */ explicit WebSnap(const KUrl &url, QObject *parent = 0); + ~WebSnap(); + /** * Snaps a pixmap of size w * h from a page and save it to cache * |