Skip to content
Permalink
Browse files

Bring back QgsNetworkManager slots and signals removed in 2eb8243 as …

…deprecated
  • Loading branch information
jef-n committed Apr 15, 2016
1 parent 8303688 commit 78725feda46a534fbe419b61b85f13741950997a
@@ -60,12 +60,32 @@ class QgsNetworkAccessManager : QNetworkAccessManager
//! Setup the NAM according to the user's settings
void setupDefaultProxyAndCache();

//! return whether the system proxy should be used
bool useSystemProxy();

public slots:
/** Send GET request, calls get().
* Emits requestSent().
* @param request request to be sent
* @deprecated use get() directly
*/
void sendGet( const QNetworkRequest & request ) /Deprecated/;
/** Abort and delete reply.
* @param reply reply to be aborted.
* @deprecated use abort() and deleteLayer() on the reply directly
*/
void deleteReply( QNetworkReply * reply ) /Deprecated/;

signals:
void requestAboutToBeCreated( QNetworkAccessManager::Operation, const QNetworkRequest &, QIODevice * );
void requestCreated( QNetworkReply * );
void requestTimedOut( QNetworkReply * );
/** Emitted when request was sent by request()
* @param reply request reply
* @param sender the object which called request() slot.
* @deprecated only emitted from deprecated sendGet
*/
void requestSent( QNetworkReply * reply, QObject *sender );

protected:
virtual QNetworkReply *createRequest( QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0 );
@@ -384,3 +384,21 @@ void QgsNetworkAccessManager::setupDefaultProxyAndCache()
if ( cache() != newcache )
setCache( newcache );
}

void QgsNetworkAccessManager::sendGet( const QNetworkRequest & request )
{
QgsDebugMsg( "Entered" );
QNetworkReply * reply = get( request );
emit requestSent( reply, QObject::sender() );
}

void QgsNetworkAccessManager::deleteReply( QNetworkReply * reply )
{
QgsDebugMsg( "Entered" );
if ( !reply )
{
return;
}
reply->abort();
reply->deleteLater();
}
@@ -85,10 +85,29 @@ class CORE_EXPORT QgsNetworkAccessManager : public QNetworkAccessManager
//! return whether the system proxy should be used
bool useSystemProxy() { return mUseSystemProxy; }

public slots:
/** Send GET request, calls get().
* Emits requestSent().
* @param request request to be sent
* @deprecated use get() directly
*/
Q_DECL_DEPRECATED void sendGet( const QNetworkRequest & request );
/** Abort and delete reply.
* @param reply reply to be aborted.
* @deprecated use abort() and deleteLayer() on the reply directly
*/
Q_DECL_DEPRECATED void deleteReply( QNetworkReply * reply );

signals:
void requestAboutToBeCreated( QNetworkAccessManager::Operation, const QNetworkRequest &, QIODevice * );
void requestCreated( QNetworkReply * );
void requestTimedOut( QNetworkReply * );
/** Emitted when request was sent by request()
* @param reply request reply
* @param sender the object which called request() slot.
* @deprecated only emitted from deprecated sendGet
*/
void requestSent( QNetworkReply * reply, QObject *sender );

private slots:
void abortRequest();

1 comment on commit 78725fe

@Gustry

This comment has been minimized.

Copy link
Contributor

@Gustry Gustry commented on 78725fe Apr 18, 2016

Thanks @jef-n for the revert.

Please sign in to comment.
You can’t perform that action at this time.