MpcImportWindow.cpp   MpcImportWindow.cpp 
skipping to change at line 48 skipping to change at line 48
#include <QHash> #include <QHash>
#include <QList> #include <QList>
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
#include <QNetworkRequest> #include <QNetworkRequest>
#include <QNetworkReply> #include <QNetworkReply>
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QString> #include <QString>
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QTimer> #include <QTimer>
#include <QUrl> #include <QUrl>
#include <QDir>
MpcImportWindow::MpcImportWindow() : MpcImportWindow::MpcImportWindow() :
downloadReply(0), downloadReply(0),
queryReply(0), queryReply(0),
downloadProgressBar(0), downloadProgressBar(0),
queryProgressBar(0) queryProgressBar(0)
{ {
ui = new Ui_mpcImportWindow(); ui = new Ui_mpcImportWindow();
ssoManager = GETSTELMODULE(SolarSystemEditor); ssoManager = GETSTELMODULE(SolarSystemEditor);
skipping to change at line 973 skipping to change at line 974
//If nothing was read, continue //If nothing was read, continue
if (!bookmarks.value(MpcComets).isEmpty() && !bookma rks[MpcMinorPlanets].isEmpty()) if (!bookmarks.value(MpcComets).isEmpty() && !bookma rks[MpcMinorPlanets].isEmpty())
return; return;
} }
} }
qDebug() << "Bookmarks file can't be read. Hard-coded bookmarks will be used."; qDebug() << "Bookmarks file can't be read. Hard-coded bookmarks will be used.";
//Initialize with hard-coded values //Initialize with hard-coded values
bookmarks[MpcMinorPlanets].insert("MPC's list of bright minor planet s at opposition in 2011", "http://www.minorplanetcenter.net/iau/Ephemerides /Bright/2011/Soft00Bright.txt"); bookmarks[MpcMinorPlanets].insert("MPC's list of bright minor planet s at opposition in 2011", "http://www.minorplanetcenter.net/iau/Ephemerides /Bright/2011/Soft00Bright.txt");
bookmarks[MpcMinorPlanets].insert("MPC's list of bright minor planet
s at opposition in 2013", "http://www.minorplanetcenter.net/iau/Ephemerides
/Bright/2013/Soft00Bright.txt");
bookmarks[MpcMinorPlanets].insert("MPC's list of observable distant
minor planets", "http://www.minorplanetcenter.net/iau/Ephemerides/Distant/S
oft00Distant.txt");
bookmarks[MpcMinorPlanets].insert("MPCORB: near-Earth asteroids (NEA s)", "http://www.minorplanetcenter.net/iau/MPCORB/NEA.txt"); bookmarks[MpcMinorPlanets].insert("MPCORB: near-Earth asteroids (NEA s)", "http://www.minorplanetcenter.net/iau/MPCORB/NEA.txt");
bookmarks[MpcMinorPlanets].insert("MPCORB: potentially hazardous ast eroids (PHAs)", "http://www.minorplanetcenter.net/iau/MPCORB/PHA.txt"); bookmarks[MpcMinorPlanets].insert("MPCORB: potentially hazardous ast eroids (PHAs)", "http://www.minorplanetcenter.net/iau/MPCORB/PHA.txt");
bookmarks[MpcMinorPlanets].insert("MPCORB: TNOs, Centaurs and SDOs",
"http://www.minorplanetcenter.net/iau/MPCORB/Distant.txt");
bookmarks[MpcMinorPlanets].insert("MPCORB: other unusual objects", "
http://www.minorplanetcenter.net/iau/MPCORB/Unusual.txt");
bookmarks[MpcMinorPlanets].insert("MPCORB: orbits from the latest DO
U MPEC", "http://www.minorplanetcenter.net/iau/MPCORB/DAILY.DAT");
bookmarks[MpcComets].insert("MPC's list of observable comets", "http ://www.minorplanetcenter.net/iau/Ephemerides/Comets/Soft00Cmt.txt"); bookmarks[MpcComets].insert("MPC's list of observable comets", "http ://www.minorplanetcenter.net/iau/Ephemerides/Comets/Soft00Cmt.txt");
bookmarks[MpcComets].insert("MPCORB: comets", "http://www.minorplane tcenter.net/iau/MPCORB/CometEls.txt");
//Try to save them to a file //Try to save them to a file
saveBookmarks(); saveBookmarks();
} }
void MpcImportWindow::loadBookmarksGroup(QVariantMap source, Bookmarks & bo okmarkGroup) void MpcImportWindow::loadBookmarksGroup(QVariantMap source, Bookmarks & bo okmarkGroup)
{ {
if (source.isEmpty()) if (source.isEmpty())
return; return;
skipping to change at line 1030 skipping to change at line 1037
//qDebug() << minorPlanetsObject.keys(); //qDebug() << minorPlanetsObject.keys();
jsonRoot.insert("mpcMinorPlanets", minorPlanetsObjec t); jsonRoot.insert("mpcMinorPlanets", minorPlanetsObjec t);
QVariantMap cometsObject; QVariantMap cometsObject;
saveBookmarksGroup(bookmarks[MpcComets], cometsObjec t); saveBookmarksGroup(bookmarks[MpcComets], cometsObjec t);
jsonRoot.insert("mpcComets", cometsObject); jsonRoot.insert("mpcComets", cometsObject);
StelJsonParser::write(jsonRoot, &bookmarksFile); StelJsonParser::write(jsonRoot, &bookmarksFile);
bookmarksFile.close(); bookmarksFile.close();
qDebug() << "Bookmarks file saved to" << bookmarksFi lePath; qDebug() << "Bookmarks file saved to" << QDir::toNat iveSeparators(bookmarksFilePath);
return; return;
} }
else else
{ {
qDebug() << "Unable to write bookmarks file to" << b ookmarksFilePath; qDebug() << "Unable to write bookmarks file to" << Q Dir::toNativeSeparators(bookmarksFilePath);
} }
} }
catch (std::exception & e) catch (std::exception & e)
{ {
qDebug() << "Unable to save bookmarks file:" << e.what(); qDebug() << "Unable to save bookmarks file:" << e.what();
} }
} }
void MpcImportWindow::saveBookmarksGroup(Bookmarks & bookmarkGroup, QVarian tMap & output) void MpcImportWindow::saveBookmarksGroup(Bookmarks & bookmarkGroup, QVarian tMap & output)
{ {
 End of changes. 6 change blocks. 
2 lines changed or deleted 16 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/