SatellitesImportDialog.cpp   SatellitesImportDialog.cpp 
skipping to change at line 36 skipping to change at line 36
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include <QDesktopServices> #include <QDesktopServices>
#include <QFileDialog> #include <QFileDialog>
#include <QFileInfo> #include <QFileInfo>
#include <QNetworkReply> #include <QNetworkReply>
#include <QProgressBar> #include <QProgressBar>
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QDir>
SatellitesImportDialog::SatellitesImportDialog() : SatellitesImportDialog::SatellitesImportDialog() :
downloadMgr(0), downloadMgr(0),
progressBar(0) progressBar(0)
{ {
ui = new Ui_satellitesImportDialog; ui = new Ui_satellitesImportDialog;
newSatellitesModel = new QStandardItemModel(this); newSatellitesModel = new QStandardItemModel(this);
} }
SatellitesImportDialog::~SatellitesImportDialog() SatellitesImportDialog::~SatellitesImportDialog()
skipping to change at line 198 skipping to change at line 199
// An error is a completed download, isn't it? // An error is a completed download, isn't it?
activeDownloads.removeAll(networkReply); activeDownloads.removeAll(networkReply);
numberDownloadsComplete++; numberDownloadsComplete++;
if (progressBar) if (progressBar)
progressBar->setValue(numberDownloadsComplete); progressBar->setValue(numberDownloadsComplete);
// Then, see if there was an error... // Then, see if there was an error...
if (networkReply->error() != QNetworkReply::NoError) if (networkReply->error() != QNetworkReply::NoError)
{ {
qWarning() << "Satellites: failed to download" << url qWarning() << "Satellites: failed to download " << url
<< networkReply->errorString(); << networkReply->errorString();
return; return;
} }
QTemporaryFile* tmpFile = new QTemporaryFile(); QTemporaryFile* tmpFile = new QTemporaryFile();
if (tmpFile->open()) if (tmpFile->open())
{ {
tmpFile->write(networkReply->readAll()); tmpFile->write(networkReply->readAll());
tmpFile->close(); tmpFile->close();
sourceFiles.append(tmpFile); sourceFiles.append(tmpFile);
skipping to change at line 337 skipping to change at line 338
else else
open = sourceFiles[f]->open(QFile::ReadOnly); open = sourceFiles[f]->open(QFile::ReadOnly);
if (open) if (open)
{ {
satMgr->parseTleFile(*sourceFiles[f], newSatellites) ; satMgr->parseTleFile(*sourceFiles[f], newSatellites) ;
sourceFiles[f]->close(); sourceFiles[f]->close();
} }
else else
{ {
qDebug() << "Satellites: cannot open file" qDebug() << "Satellites: cannot open file"
<< sourceFiles[f]->fileName(); << QDir::toNativeSeparators(sourceFiles[f]- >fileName());
} }
} }
// Clear the disk... // Clear the disk...
qDeleteAll(sourceFiles); qDeleteAll(sourceFiles);
sourceFiles.clear(); sourceFiles.clear();
QStringList existingIDs = satMgr->getAllIDs(); QStringList existingIDs = satMgr->listAllIds();
QHashIterator<QString,TleData> i(newSatellites); QHashIterator<QString,TleData> i(newSatellites);
while (i.hasNext()) while (i.hasNext())
{ {
i.next(); i.next();
// Skip duplicates // Skip duplicates
if (existingIDs.contains(i.key())) if (existingIDs.contains(i.key()))
continue; continue;
TleData tle = i.value(); TleData tle = i.value();
 End of changes. 4 change blocks. 
3 lines changed or deleted 4 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/