Skip to content

Commit

Permalink
Fix extra stars cat download with Qt < 5.6
Browse files Browse the repository at this point in the history
With older version of Qt, qt doesn't automatically handle redirections,
so we have to be a bit careful not to use the redirection data.
  • Loading branch information
guillaumechereau committed Aug 20, 2018
1 parent f5fb45d commit e76858f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gui/ConfigurationDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,9 @@ void ConfigurationDialog::newStarCatalogData()
Q_ASSERT(starCatalogDownloadReply);
Q_ASSERT(progressBar);

// Ignore data from redirection. (Not needed after Qt 5.6)
if (!starCatalogDownloadReply->attribute(QNetworkRequest::RedirectionTargetAttribute).isNull())
return;
int size = starCatalogDownloadReply->bytesAvailable();
progressBar->setValue((float)progressBar->getValue()+(float)size/1024);
currentDownloadFile->write(starCatalogDownloadReply->read(size));
Expand Down

0 comments on commit e76858f

Please sign in to comment.