SatellitesImportDialog.cpp   SatellitesImportDialog.cpp 
skipping to change at line 43 skipping to change at line 43
#include <QProgressBar> #include <QProgressBar>
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QDir> #include <QDir>
SatellitesImportDialog::SatellitesImportDialog() SatellitesImportDialog::SatellitesImportDialog()
: StelDialog("SatellitesImport") : StelDialog("SatellitesImport")
, isGettingData(false) , isGettingData(false)
, numberDownloadsComplete(0) , numberDownloadsComplete(0)
, downloadMgr(0) , downloadMgr(Q_NULLPTR)
, progressBar(0) , progressBar(Q_NULLPTR)
, filterProxyModel(NULL) , filterProxyModel(Q_NULLPTR)
{ {
ui = new Ui_satellitesImportDialog; ui = new Ui_satellitesImportDialog;
newSatellitesModel = new QStandardItemModel(this); newSatellitesModel = new QStandardItemModel(this);
} }
SatellitesImportDialog::~SatellitesImportDialog() SatellitesImportDialog::~SatellitesImportDialog()
{ {
delete ui; delete ui;
// Do I need to explicitly delete this? // Do I need to explicitly delete this?
if (progressBar) if (progressBar)
{ {
StelApp::getInstance().removeProgressBar(progressBar); StelApp::getInstance().removeProgressBar(progressBar);
progressBar = 0; progressBar = Q_NULLPTR;
} }
if (newSatellitesModel) if (newSatellitesModel)
{ {
newSatellitesModel->clear(); newSatellitesModel->clear();
delete newSatellitesModel; delete newSatellitesModel;
newSatellitesModel = 0; newSatellitesModel = Q_NULLPTR;
} }
} }
void SatellitesImportDialog::retranslate() void SatellitesImportDialog::retranslate()
{ {
if (dialog) if (dialog)
{ {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
} }
} }
skipping to change at line 159 skipping to change at line 159
progressBar->setRange(0, sourceUrls.size()); progressBar->setRange(0, sourceUrls.size());
progressBar->setFormat("TLE download %v/%m"); progressBar->setFormat("TLE download %v/%m");
ui->pushButtonGetData->setVisible(false); ui->pushButtonGetData->setVisible(false);
ui->pushButtonAbort->setVisible(true); ui->pushButtonAbort->setVisible(true);
ui->groupBoxWorking->setTitle(q_("Downloading data...")); ui->groupBoxWorking->setTitle(q_("Downloading data..."));
displayMessage(q_("Stellarium is downloading satellite data from the update sources. Please wait...")); displayMessage(q_("Stellarium is downloading satellite data from the update sources. Please wait..."));
for (int i = 0; i < sourceUrls.size(); i++) for (int i = 0; i < sourceUrls.size(); i++)
{ {
QUrl url(sourceUrls.at(i)); QString urlData = sourceUrls.at(i);
QUrl url(urlData.remove("1,", Qt::CaseInsensitive));
QNetworkReply* reply = downloadMgr->get(QNetworkRequ est(url)); QNetworkReply* reply = downloadMgr->get(QNetworkRequ est(url));
activeDownloads.append(reply); activeDownloads.append(reply);
} }
} }
else else
{ {
QStringList sourceFilePaths; QStringList sourceFilePaths;
// XXX: we should check that there is at least one home loca tion. // XXX: we should check that there is at least one home loca tion.
QString homeDirPath = QStandardPaths::standardLocations(QSta ndardPaths::HomeLocation)[0]; QString homeDirPath = QStandardPaths::standardLocations(QSta ndardPaths::HomeLocation)[0];
sourceFilePaths = QFileDialog::getOpenFileNames( sourceFilePaths = QFileDialog::getOpenFileNames(
skipping to change at line 263 skipping to change at line 264
} }
void SatellitesImportDialog::abortDownloads() void SatellitesImportDialog::abortDownloads()
{ {
for (int i = 0; i < activeDownloads.count(); i++) for (int i = 0; i < activeDownloads.count(); i++)
{ {
activeDownloads[i]->abort(); activeDownloads[i]->abort();
activeDownloads[i]->deleteLater(); activeDownloads[i]->deleteLater();
} }
reset(); reset();
displayMessage("Download aborted."); displayMessage(q_("Download aborted."));
} }
void SatellitesImportDialog::acceptNewSatellites() void SatellitesImportDialog::acceptNewSatellites()
{ {
TleDataList satellitesToAdd; TleDataList satellitesToAdd;
for (int row = 0; row < newSatellitesModel->rowCount(); row++) for (int row = 0; row < newSatellitesModel->rowCount(); row++)
{ {
QStandardItem* item = newSatellitesModel->item(row); QStandardItem* item = newSatellitesModel->item(row);
if (item->checkState() == Qt::Checked) if (item->checkState() == Qt::Checked)
{ {
skipping to change at line 308 skipping to change at line 309
void SatellitesImportDialog::reset() void SatellitesImportDialog::reset()
{ {
// Assuming that everything that needs to be stopped is stopped // Assuming that everything that needs to be stopped is stopped
isGettingData = false; isGettingData = false;
ui->stackedWidget->setCurrentIndex(0); ui->stackedWidget->setCurrentIndex(0);
ui->pushButtonGetData->setVisible(true); ui->pushButtonGetData->setVisible(true);
ui->pushButtonAbort->setVisible(false); ui->pushButtonAbort->setVisible(false);
ui->labelMessage->setVisible(false); ui->labelMessage->setVisible(false);
ui->labelMessage->clear(); ui->labelMessage->clear();
ui->groupBoxWorking->setTitle("Get data"); ui->groupBoxWorking->setTitle(q_("Get data"));
newSatellitesModel->clear(); newSatellitesModel->clear();
ui->lineEditSearch->clear(); ui->lineEditSearch->clear();
newSatellites.clear(); newSatellites.clear();
sourceUrls.clear(); sourceUrls.clear();
qDeleteAll(activeDownloads); qDeleteAll(activeDownloads);
activeDownloads.clear(); activeDownloads.clear();
qDeleteAll(sourceFiles); qDeleteAll(sourceFiles);
 End of changes. 6 change blocks. 
8 lines changed or deleted 9 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/