MeteorShowers.cpp   MeteorShowers.cpp 
skipping to change at line 166 skipping to change at line 166
} }
Vec3d v(av); Vec3d v(av);
v.normalize(); v.normalize();
double cosLimFov = qCos(limitFov * M_PI/180.); double cosLimFov = qCos(limitFov * M_PI/180.);
Vec3d equPos; Vec3d equPos;
foreach(const MeteorShowerP& ms, m_meteorShowers) foreach(const MeteorShowerP& ms, m_meteorShowers)
{ {
if (ms->enabled()) if (ms->enabled())
{ {
equPos = ms->getJ2000EquatorialPos(NULL); equPos = ms->getJ2000EquatorialPos(Q_NULLPTR);
equPos.normalize(); equPos.normalize();
if (equPos[0]*v[0] + equPos[1]*v[1] + equPos[2]*v[2] >= cosLimFov) if (equPos[0]*v[0] + equPos[1]*v[1] + equPos[2]*v[2] >= cosLimFov)
{ {
result.append(qSharedPointerCast<StelObject> (ms)); result.append(qSharedPointerCast<StelObject> (ms));
} }
} }
} }
return result; return result;
} }
StelObjectP MeteorShowers::searchByName(const QString& englishName) const StelObjectP MeteorShowers::searchByName(const QString& englishName) const
{ {
if (!m_mgr->getEnablePlugin()) if (!m_mgr->getEnablePlugin())
{ {
return NULL; return Q_NULLPTR;
} }
foreach(const MeteorShowerP& ms, m_meteorShowers) foreach(const MeteorShowerP& ms, m_meteorShowers)
{ {
if (ms->enabled()) if (ms->enabled())
{ {
bool sameEngName = ms->getEnglishName().toUpper() == englishName.toUpper(); bool sameEngName = ms->getEnglishName().toUpper() == englishName.toUpper();
bool desigIsEngName = ms->getDesignation().toUpper() == englishName.toUpper(); bool desigIsEngName = ms->getDesignation().toUpper() == englishName.toUpper();
bool emptyDesig = ms->getDesignation().isEmpty(); bool emptyDesig = ms->getDesignation().isEmpty();
if (sameEngName || (desigIsEngName && !emptyDesig)) if (sameEngName || (desigIsEngName && !emptyDesig))
{ {
return qSharedPointerCast<StelObject>(ms); return qSharedPointerCast<StelObject>(ms);
} }
} }
} }
return NULL; return Q_NULLPTR;
}
StelObjectP MeteorShowers::searchByID(const QString &id) const
{
foreach(const MeteorShowerP& ms, m_meteorShowers)
{
if (ms->getID() == id)
return qSharedPointerCast<StelObject>(ms);
}
return Q_NULLPTR;
} }
StelObjectP MeteorShowers::searchByNameI18n(const QString& nameI18n) const StelObjectP MeteorShowers::searchByNameI18n(const QString& nameI18n) const
{ {
if (!m_mgr->getEnablePlugin()) if (!m_mgr->getEnablePlugin())
{ {
return NULL; return Q_NULLPTR;
} }
foreach(const MeteorShowerP& ms, m_meteorShowers) foreach(const MeteorShowerP& ms, m_meteorShowers)
{ {
if (ms->enabled()) if (ms->enabled())
{ {
if (ms->getNameI18n().toUpper() == nameI18n.toUpper( )) if (ms->getNameI18n().toUpper() == nameI18n.toUpper( ))
{ {
return qSharedPointerCast<StelObject>(ms); return qSharedPointerCast<StelObject>(ms);
} }
} }
} }
return NULL; return Q_NULLPTR;
} }
QStringList MeteorShowers::listMatchingObjects(const QString& objPrefix, in t maxNbItem, bool useStartOfWords, bool inEnglish) const QStringList MeteorShowers::listMatchingObjects(const QString& objPrefix, in t maxNbItem, bool useStartOfWords, bool inEnglish) const
{ {
QStringList result; QStringList result;
if (!m_mgr->getEnablePlugin() || maxNbItem <= 0) if (!m_mgr->getEnablePlugin() || maxNbItem <= 0)
{ {
return result; return result;
} }
 End of changes. 5 change blocks. 
5 lines changed or deleted 15 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/