summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-09-20 01:52:06 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-09-20 01:52:06 +0200
commitf44942581445d8eef4f67e30c737c2e7a5f1e2a9 (patch)
tree9e7c23b0f3d47e9648597dc553ee1daea2052a01
parentFixing homepage (user's not rekonq's) opening and behaviour (diff)
downloadrekonq-f44942581445d8eef4f67e30c737c2e7a5f1e2a9.tar.xz
Fixing loading preview
busywidget image provided by AdriĆ :) with Pano's intercession. Many thanks!
-rw-r--r--data/CMakeLists.txt2
-rw-r--r--data/busywidget.gifbin0 -> 11611 bytes
-rw-r--r--src/previewimage.cpp17
-rw-r--r--src/websnap.cpp1
4 files changed, 13 insertions, 7 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index 062bc138..36b17ded 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -1,5 +1,5 @@
INSTALL(
- FILES closed.png loading.mng open.png webkit-icon.png
+ FILES closed.png loading.mng open.png webkit-icon.png busywidget.gif
DESTINATION ${DATA_INSTALL_DIR}/rekonq/pics
)
diff --git a/data/busywidget.gif b/data/busywidget.gif
new file mode 100644
index 00000000..600b9d44
--- /dev/null
+++ b/data/busywidget.gif
Binary files differ
diff --git a/src/previewimage.cpp b/src/previewimage.cpp
index d027bfd1..b78f9ae5 100644
--- a/src/previewimage.cpp
+++ b/src/previewimage.cpp
@@ -27,6 +27,7 @@
#include "previewimage.moc"
#include <QFile>
+#include <QMovie>
#include <KUrl>
#include <KStandardDirs>
@@ -46,22 +47,28 @@ PreviewImage::PreviewImage(const QString &url, const QString &pos)
}
else
{
- QString path = KStandardDirs::locate("appdata", "pics/loading.mng");
- setPixmap( QPixmap(path) );
-
ws = new WebSnap( url, pos );
connect(ws, SIGNAL(finished()), this, SLOT(setSiteImage()));
+
+ QString path = KStandardDirs::locate("appdata", "pics/busywidget.gif");
+
+ QMovie *movie = new QMovie(path, QByteArray(), this);
+ movie->setSpeed(50);
+ setMovie(movie);
+ movie->start();
}
}
PreviewImage::~PreviewImage()
{
- kDebug() << "bye bye..";
}
void PreviewImage::setSiteImage()
{
- kDebug() << "Done. works?";
+ QMovie *m = movie();
+ delete m;
+ setMovie(0);
+
setPixmap( ws->previewImage() );
}
diff --git a/src/websnap.cpp b/src/websnap.cpp
index ec537b32..94560891 100644
--- a/src/websnap.cpp
+++ b/src/websnap.cpp
@@ -58,7 +58,6 @@ WebSnap::WebSnap(const QString &url, const QString &pos)
void WebSnap::load()
{
- kDebug() << "loading..";
m_page.mainFrame()->load( QUrl(m_url) );
}