diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-09-18 19:22:51 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-09-18 19:22:51 +0200 |
commit | e2f57546558b2d90147cced3beee541e7e1cae9e (patch) | |
tree | ed1f7b355450f2ca45d116e036a02a82e42f3a44 /src/websnap.cpp | |
parent | Fixed options show recently closed tabs / show recent history (diff) | |
download | rekonq-e2f57546558b2d90147cced3beee541e7e1cae9e.tar.xz |
Faster loading..
Diffstat (limited to 'src/websnap.cpp')
-rw-r--r-- | src/websnap.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/websnap.cpp b/src/websnap.cpp index 349f2329..ec537b32 100644 --- a/src/websnap.cpp +++ b/src/websnap.cpp @@ -36,19 +36,21 @@ #include <QWebSettings> #include <QPainter> #include <QTimer> +#include <QFile> #define WIDTH 200 #define HEIGHT 150 -WebSnap::WebSnap(const KUrl &url) +WebSnap::WebSnap(const QString &url, const QString &pos) : QObject() - , m_url(url) { + m_url = url; + m_pos = pos; + // this to not register websnap history m_page.settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); - connect(&m_page, SIGNAL(loadFinished(bool)), this, SLOT(saveResult(bool))); QTimer::singleShot(0, this, SLOT(load())); } @@ -57,7 +59,7 @@ WebSnap::WebSnap(const KUrl &url) void WebSnap::load() { kDebug() << "loading.."; - m_page.mainFrame()->load(m_url); + m_page.mainFrame()->load( QUrl(m_url) ); } @@ -86,7 +88,7 @@ void WebSnap::saveResult(bool ok) m_image = m_image.scaled(WIDTH, HEIGHT, Qt::KeepAspectRatioByExpanding); - QString path = KStandardDirs::locateLocal("cache", QString("thumbs/uno.png"), true); + QString path = KStandardDirs::locateLocal("cache", QString("thumbs/rek") + m_pos + ".png", true); if( m_image.save(path) ) { kDebug() << "finished"; |