summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-05-07 23:02:42 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-05-07 23:02:42 (GMT)
commitbe0106a92528f7dc47d9fd6e21dd7d7a7ffb9ada (patch)
tree7ad768883809f7718b95b946f6e5a93e74d2becc /src
parent495150413916a9a41cdffc5879f36a6e16e7866c (diff)
downloadQt-be0106a92528f7dc47d9fd6e21dd7d7a7ffb9ada.zip
Qt-be0106a92528f7dc47d9fd6e21dd7d7a7ffb9ada.tar.gz
Qt-be0106a92528f7dc47d9fd6e21dd7d7a7ffb9ada.tar.bz2
Make sure cancelling image loading cancels progress reporting.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/fx/qfxblendedimage.cpp4
-rw-r--r--src/declarative/fx/qfxhighlightfilter.cpp2
-rw-r--r--src/declarative/fx/qfximage.cpp4
-rw-r--r--src/declarative/fx/qfxparticles.cpp2
-rw-r--r--src/declarative/fx/qfxpixmap.cpp7
-rw-r--r--src/declarative/fx/qfxpixmap.h2
6 files changed, 12 insertions, 9 deletions
diff --git a/src/declarative/fx/qfxblendedimage.cpp b/src/declarative/fx/qfxblendedimage.cpp
index 3326ea8..79b8e41 100644
--- a/src/declarative/fx/qfxblendedimage.cpp
+++ b/src/declarative/fx/qfxblendedimage.cpp
@@ -101,7 +101,7 @@ void QFxBlendedImage::setPrimaryUrl(const QString &url)
if (primSrc == url)
return;
if (!primSrc.isEmpty())
- QFxPixmap::cancelGet(primUrl,this,SLOT(primaryLoaded()));
+ QFxPixmap::cancelGet(primUrl,this);
primSrc = url;
primUrl = qmlContext(this)->resolvedUrl(url);
if (!primSrc.isEmpty())
@@ -129,7 +129,7 @@ void QFxBlendedImage::setSecondaryUrl(const QString &url)
if (secSrc == url)
return;
if (!secSrc.isEmpty())
- QFxPixmap::cancelGet(secUrl,this,SLOT(secondaryLoaded()));
+ QFxPixmap::cancelGet(secUrl,this);
secSrc = url;
secUrl = qmlContext(this)->resolvedUrl(url);
if (!secSrc.isEmpty())
diff --git a/src/declarative/fx/qfxhighlightfilter.cpp b/src/declarative/fx/qfxhighlightfilter.cpp
index 862a698..a22ad98 100644
--- a/src/declarative/fx/qfxhighlightfilter.cpp
+++ b/src/declarative/fx/qfxhighlightfilter.cpp
@@ -149,7 +149,7 @@ void QFxHighlightFilter::setSource(const QString &f)
if (d->source == f)
return;
if (!d->source.isEmpty())
- QFxPixmap::cancelGet(d->url, this, SLOT(imageLoaded()));
+ QFxPixmap::cancelGet(d->url, this);
d->source = f;
d->url = qmlContext(this)->resolvedUrl(f);
#if defined(QFX_RENDER_OPENGL2)
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp
index d66846d..e1ac2c7 100644
--- a/src/declarative/fx/qfximage.cpp
+++ b/src/declarative/fx/qfximage.cpp
@@ -865,9 +865,9 @@ void QFxImage::setSource(const QString &url)
}
if (!d->url.isEmpty())
- QFxPixmap::cancelGet(d->url, this, SLOT(requestFinished()));
+ QFxPixmap::cancelGet(d->url, this);
if (!d->sciurl.isEmpty())
- QFxPixmap::cancelGet(d->sciurl, this, SLOT(requestFinished()));
+ QFxPixmap::cancelGet(d->sciurl, this);
d->source = url;
d->url = qmlContext(this)->resolvedUrl(url);
diff --git a/src/declarative/fx/qfxparticles.cpp b/src/declarative/fx/qfxparticles.cpp
index 8535a73..1aaf256 100644
--- a/src/declarative/fx/qfxparticles.cpp
+++ b/src/declarative/fx/qfxparticles.cpp
@@ -635,7 +635,7 @@ void QFxParticles::setSource(const QString &name)
return;
if (!d->source.isEmpty())
- QFxPixmap::cancelGet(d->url, this, SLOT(imageLoaded()));
+ QFxPixmap::cancelGet(d->url, this);
if (name.isEmpty()) {
d->source = name;
d->url = QUrl();
diff --git a/src/declarative/fx/qfxpixmap.cpp b/src/declarative/fx/qfxpixmap.cpp
index 3fdd8e5..0e5a10f 100644
--- a/src/declarative/fx/qfxpixmap.cpp
+++ b/src/declarative/fx/qfxpixmap.cpp
@@ -275,15 +275,18 @@ QNetworkReply *QFxPixmap::get(QmlEngine *engine, const QUrl& url, QObject* obj,
/*!
Stops the given slot being invoked if the given url finishes loading.
May also cancel loading (eg. if no other pending request).
+
+ Any connections to the QNetworkReply returned by get() will be
+ disconnected.
*/
-void QFxPixmap::cancelGet(const QUrl& url, QObject* obj, const char* slot)
+void QFxPixmap::cancelGet(const QUrl& url, QObject* obj)
{
QString key = url.toString();
QFxPixmapCache::Iterator iter = qfxPixmapCache.find(key);
if (iter == qfxPixmapCache.end())
return;
if ((*iter)->reply)
- QObject::disconnect((*iter)->reply, SIGNAL(finished()), obj, slot);
+ QObject::disconnect((*iter)->reply, 0, obj, 0);
// XXX - loading not cancelled. Need to revisit caching
}
diff --git a/src/declarative/fx/qfxpixmap.h b/src/declarative/fx/qfxpixmap.h
index 748991e..297dba7 100644
--- a/src/declarative/fx/qfxpixmap.h
+++ b/src/declarative/fx/qfxpixmap.h
@@ -67,7 +67,7 @@ public:
QFxPixmap &operator=(const QFxPixmap &);
static QNetworkReply *get(QmlEngine *, const QUrl& url, QObject*, const char* slot);
- static void cancelGet(const QUrl& url, QObject* obj, const char* slot);
+ static void cancelGet(const QUrl& url, QObject* obj);
bool isNull() const;