SolarSystemEditor.cpp   SolarSystemEditor.cpp 
skipping to change at line 57 skipping to change at line 57
return new SolarSystemEditor(); return new SolarSystemEditor();
} }
StelPluginInfo SolarSystemEditorStelPluginInterface::getPluginInfo() const StelPluginInfo SolarSystemEditorStelPluginInterface::getPluginInfo() const
{ {
//Q_INIT_RESOURCE(solarSystemEditor); //Q_INIT_RESOURCE(solarSystemEditor);
StelPluginInfo info; StelPluginInfo info;
info.id = "SolarSystemEditor"; info.id = "SolarSystemEditor";
info.displayedName = N_("Solar System Editor"); info.displayedName = N_("Solar System Editor");
info.authors = "Bogdan Marinov, Georg Zotti"; info.authors = "Bogdan Marinov";
info.contact = "http://stellarium.org"; info.contact = "http://stellarium.org";
info.description = N_("An interface for adding asteroids and comets to Stellarium. It can download object lists from the Minor Planet Center's website and perform searches in its online database."); info.description = N_("An interface for adding asteroids and comets to Stellarium. It can download object lists from the Minor Planet Center's website and perform searches in its online database.");
info.version = SOLARSYSTEMEDITOR_VERSION; info.version = SOLARSYSTEMEDITOR_PLUGIN_VERSION;
info.license = SOLARSYSTEMEDITOR_PLUGIN_LICENSE;
return info; return info;
} }
SolarSystemEditor::SolarSystemEditor(): SolarSystemEditor::SolarSystemEditor():
isInitialized(false), isInitialized(false),
mainWindow(Q_NULLPTR), mainWindow(Q_NULLPTR),
solarSystemConfigurationFile(Q_NULLPTR) solarSystemConfigurationFile(Q_NULLPTR)
{ {
setObjectName("SolarSystemEditor"); setObjectName("SolarSystemEditor");
solarSystem = GETSTELMODULE(SolarSystem); solarSystem = GETSTELMODULE(SolarSystem);
skipping to change at line 404 skipping to change at line 405
QHash<QString,QString> SolarSystemEditor::listAllLoadedObjectsInFile(QStrin g filePath) const QHash<QString,QString> SolarSystemEditor::listAllLoadedObjectsInFile(QStrin g filePath) const
{ {
if (!QFile::exists(filePath)) if (!QFile::exists(filePath))
return QHash<QString,QString>(); return QHash<QString,QString>();
QSettings solarSystemIni(filePath, StelIniFormat); QSettings solarSystemIni(filePath, StelIniFormat);
if (solarSystemIni.status() != QSettings::NoError) if (solarSystemIni.status() != QSettings::NoError)
return QHash<QString,QString>(); return QHash<QString,QString>();
QStringList groups = solarSystemIni.childGroups(); QStringList groups = solarSystemIni.childGroups();
QStringList planetNames = solarSystem->getAllPlanetEnglishNames(); QStringList planetNames = solarSystem->getAllMinorPlanetCommonEnglis hNames();
QHash<QString,QString> loadedObjects; QHash<QString,QString> loadedObjects;
foreach (QString group, groups) foreach (QString group, groups)
{ {
QString name = solarSystemIni.value(group + "/name").toStrin g(); QString name = solarSystemIni.value(group + "/name").toStrin g();
if (planetNames.contains(name)) if (planetNames.contains(name))
{ {
loadedObjects.insert(name, group); loadedObjects.insert(name, group);
} }
} }
return loadedObjects; return loadedObjects;
skipping to change at line 436 skipping to change at line 437
return QHash<QString,QString>(); return QHash<QString,QString>();
} }
} }
bool SolarSystemEditor::removeSsoWithName(QString name) bool SolarSystemEditor::removeSsoWithName(QString name)
{ {
if (name.isEmpty()) if (name.isEmpty())
return false; return false;
//qDebug() << name; //qDebug() << name;
if (defaultSsoIdentifiers.keys().contains(name)) // if (defaultSsoIdentifiers.keys().contains(name))
{ // {
qWarning() << "You can't delete the default Solar System obj // qWarning() << "You can't delete the default Solar System obj
ects like" << name << "for the moment."; ects like" << name << "for the moment.";
qCritical() << "As of 0.16, this line should be impossible t // qCritical() << "As of 0.16, this line should be impossible t
o reach!"; o reach!";
return false; // return false;
} // }
//Make sure that the file exists //Make sure that the file exists
if (!QFile::exists(customSolarSystemFilePath)) if (!QFile::exists(customSolarSystemFilePath))
{ {
qDebug() << "Can't remove" << name << "from ssystem_minor.in i: Unable to find" << QDir::toNativeSeparators(customSolarSystemFilePath); qDebug() << "Can't remove" << name << "from ssystem_minor.in i: Unable to find" << QDir::toNativeSeparators(customSolarSystemFilePath);
return false; return false;
} }
//Open the file //Open the file
QSettings settings(customSolarSystemFilePath, StelIniFormat); QSettings settings(customSolarSystemFilePath, StelIniFormat);
skipping to change at line 476 skipping to change at line 477
} }
} }
//Deselect all currently selected objects //Deselect all currently selected objects
//TODO: I bet that someone will complain, so: unselect only the remo ved one //TODO: I bet that someone will complain, so: unselect only the remo ved one
GETSTELMODULE(StelObjectMgr)->unSelect(); GETSTELMODULE(StelObjectMgr)->unSelect();
//Reload the Solar System //Reload the Solar System
//solarSystem->reloadPlanets(); //solarSystem->reloadPlanets();
// Better: just remove this one object! // Better: just remove this one object!
solarSystem->removePlanet(name); solarSystem->removeMinorPlanet(name);
emit solarSystemChanged(); emit solarSystemChanged();
return true; return true;
} }
//TODO: Strings that have failed to be parsed. The usual source of discrepa ncies is //TODO: Strings that have failed to be parsed. The usual source of discrepa ncies is
//http://www.minorplanetcenter.org/iau/Ephemerides/Comets/Soft00Cmt.txt //http://www.minorplanetcenter.org/iau/Ephemerides/Comets/Soft00Cmt.txt
//It seems that some entries in the list don't match the described format. //It seems that some entries in the list don't match the described format.
/* /*
" CJ95O010 1997 03 31.4141 0.906507 0.994945 130.5321 282.6820 89.3193 20100723 -2.0 4.0 C/1995 O1 (Hale-Bopp) MPC 61436" -> minus sign, fixed " CJ95O010 1997 03 31.4141 0.906507 0.994945 130.5321 282.6820 89.3193 20100723 -2.0 4.0 C/1995 O1 (Hale-Bopp) MPC 61436" -> minus sign, fixed
 End of changes. 5 change blocks. 
12 lines changed or deleted 13 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/