summaryrefslogtreecommitdiff
path: root/src/previewimage.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-09-18 19:22:51 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-09-18 19:22:51 +0200
commite2f57546558b2d90147cced3beee541e7e1cae9e (patch)
treeed1f7b355450f2ca45d116e036a02a82e42f3a44 /src/previewimage.cpp
parentFixed options show recently closed tabs / show recent history (diff)
downloadrekonq-e2f57546558b2d90147cced3beee541e7e1cae9e.tar.xz
Faster loading..
Diffstat (limited to 'src/previewimage.cpp')
-rw-r--r--src/previewimage.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/previewimage.cpp b/src/previewimage.cpp
index 2d963171..d027bfd1 100644
--- a/src/previewimage.cpp
+++ b/src/previewimage.cpp
@@ -26,19 +26,32 @@
#include "previewimage.h"
#include "previewimage.moc"
+#include <QFile>
+
#include <KUrl>
#include <KStandardDirs>
#include <KDebug>
-PreviewImage::PreviewImage(const QString &url)
+PreviewImage::PreviewImage(const QString &url, const QString &pos)
: QLabel()
, ws(0)
-{
- QString path = KStandardDirs::locate("appdata", "pics/loading.mng"); //QString("thumbs/") + m_fileName, true);
- setPixmap( QPixmap(path) );
- kDebug() << url;
- ws = new WebSnap( KUrl(url) );
- connect(ws, SIGNAL(finished()), this, SLOT(setSiteImage()));
+{
+ QString path = KStandardDirs::locateLocal("cache", QString("thumbs/rek") + pos + ".png", true);
+
+ if(QFile::exists(path))
+ {
+ kDebug() << "exists! Loading it...";
+ m_pixmap.load(path);
+ setPixmap( m_pixmap );
+ }
+ else
+ {
+ QString path = KStandardDirs::locate("appdata", "pics/loading.mng");
+ setPixmap( QPixmap(path) );
+
+ ws = new WebSnap( url, pos );
+ connect(ws, SIGNAL(finished()), this, SLOT(setSiteImage()));
+ }
}