Skip to content

Commit 8b231ec

Browse files
committedNov 9, 2016
Added note and removed debug output
1 parent bdc2e24 commit 8b231ec

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed
 

‎python/gui/qgsfiledownloader.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* If the guiNotificationsEnabled parameter is set to false, the class can still
2525
* be used through the signals and slots mechanism.
2626
* The object will destroy itself when the request completes, errors or is canceled.
27+
*
28+
* @note added in QGIS 2.18.1
2729
*/
2830
class QgsFileDownloader : public QObject
2931
{

‎src/gui/qgsfiledownloader.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,11 @@ QgsFileDownloader::~QgsFileDownloader()
4848
{
4949
mProgressDialog->deleteLater();
5050
}
51-
qDebug() << "QgsFileDownloader instance deleted!" << this;
5251
}
5352

5453

5554
void QgsFileDownloader::startDownload()
5655
{
57-
qDebug() << "QgsFileDownloader instance started!" << this << mUrl;
5856
QgsNetworkAccessManager* nam = QgsNetworkAccessManager::instance();
5957

6058
QNetworkRequest request( mUrl );
@@ -142,15 +140,13 @@ void QgsFileDownloader::onReadyRead()
142140

143141
void QgsFileDownloader::onFinished()
144142
{
145-
qDebug() << "QgsFileDownloader instance finished!" << this;
146143
// when canceled
147144
if ( ! mErrors.isEmpty() || mDownloadCanceled )
148145
{
149146
mFile.close();
150147
mFile.remove();
151148
if ( mGuiNotificationsEnabled )
152149
mProgressDialog->hide();
153-
qDebug() << "Deleting on error";
154150
}
155151
else
156152
{
@@ -170,7 +166,6 @@ void QgsFileDownloader::onFinished()
170166
else if ( !redirectionTarget.isNull() )
171167
{
172168
QUrl newUrl = mUrl.resolved( redirectionTarget.toUrl() );
173-
qDebug( ) << QString( "Redirecting to: %1" ).arg( newUrl.toString( ) );
174169
mUrl = newUrl;
175170
mReply->deleteLater();
176171
mFile.open( QIODevice::WriteOnly );
@@ -180,24 +175,20 @@ void QgsFileDownloader::onFinished()
180175
return;
181176
}
182177
// All done
183-
qDebug( ) << "Download completed successfully";
184178
emit downloadCompleted();
185179
}
186-
qDebug( ) << "Download exited" << this;
187180
emit downloadExited();
188181
this->deleteLater();
189182
}
190183

191184
void QgsFileDownloader::onNetworkError( QNetworkReply::NetworkError err )
192185
{
193186
Q_ASSERT( mReply );
194-
qDebug( ) << QString( "Network error %1: %2" ).arg( err ).arg( mReply->errorString() );
195187
error( QString( "Network error %1: %2" ).arg( err ).arg( mReply->errorString() ) );
196188
}
197189

198190
void QgsFileDownloader::onDownloadProgress( qint64 bytesReceived, qint64 bytesTotal )
199191
{
200-
//qDebug() << QString("Downloading %1 of %2!").arg(bytesReceived).arg(bytesTotal);
201192
if ( mDownloadCanceled )
202193
{
203194
return;

‎src/gui/qgsfiledownloader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
* If the guiNotificationsEnabled parameter is set to false, the class can still
3636
* be used through the signals and slots mechanism.
3737
* The object will destroy itself when the request completes, errors or is canceled.
38+
*
39+
* @note added in QGIS 2.18.1
3840
*/
3941
class GUI_EXPORT QgsFileDownloader : public QObject
4042
{

0 commit comments

Comments
 (0)
Please sign in to comment.