Skip to content
Permalink
Browse files
emit signals before and after QgsNetworkAccessManager creates requests
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13453 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 9, 2010
1 parent 194e07d commit a9faa57b8d43a17a9e3df5633391f8b4984efc8c
@@ -50,6 +50,13 @@ class QgsNetworkAccessManager : QNetworkAccessManager

//! set fallback proxy and URL that shouldn't use it.
void setFallbackProxyAndExcludes( const QNetworkProxy &proxy, const QStringList &excludes );

signals:
void requestAboutToBeCreated( Operation, const QNetworkRequest &, QIODevice * );
void requestCreated( QNetworkReply * );

protected:
virtual QNetworkReply *createRequest( Operation op, const QNetworkRequest & req, QIODevice * outgoingData = 0 );

private:
QgsNetworkAccessManager( QObject * );
@@ -121,3 +121,11 @@ void QgsNetworkAccessManager::setFallbackProxyAndExcludes( const QNetworkProxy &
mFallbackProxy = proxy;
mExcludedURLs = excludes;
}

QNetworkReply *QgsNetworkAccessManager::createRequest( QgsNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *outgoingData )
{
emit requestAboutToBeCreated( op, req, outgoingData );
QNetworkReply *reply = QNetworkAccessManager::createRequest( op, req, outgoingData );
emit requestCreated( reply );
return reply;
}
@@ -73,6 +73,13 @@ class CORE_EXPORT QgsNetworkAccessManager : public QNetworkAccessManager
//! set fallback proxy and URL that shouldn't use it.
void setFallbackProxyAndExcludes( const QNetworkProxy &proxy, const QStringList &excludes );

signals:
void requestAboutToBeCreated( Operation, const QNetworkRequest &, QIODevice * );
void requestCreated( QNetworkReply * );

protected:
virtual QNetworkReply *createRequest( Operation op, const QNetworkRequest & req, QIODevice * outgoingData = 0 );

private:
QgsNetworkAccessManager( QObject *parent = 0 );
#if QT_VERSION >= 0x40500

0 comments on commit a9faa57

Please sign in to comment.