Satellites.cpp   Satellites.cpp 
skipping to change at line 425 skipping to change at line 425
} }
} }
} }
result.sort(); result.sort();
if (result.size()>maxNbItem) result.erase(result.begin()+maxNbItem, result.end()); if (result.size()>maxNbItem) result.erase(result.begin()+maxNbItem, result.end());
return result; return result;
} }
QStringList Satellites::listMatchingObjects(const QString& objPrefix, int m
axNbItem) const
{
QStringList result;
if (!hintFader || StelApp::getInstance().getCore()->getCurrentLocati
on().planetName != earth->getEnglishName())
return result;
if (maxNbItem==0) return result;
QString objw = objPrefix.toUpper();
QString numberPrefix;
QRegExp regExp("^(NORAD)\\s*(\\d+)\\s*$");
if (regExp.exactMatch(objw))
{
QString numberString = regExp.capturedTexts().at(2);
bool ok;
/* int number = */ numberString.toInt(&ok);
if (ok)
numberPrefix = numberString;
}
foreach(const SatelliteP& sat, satellites)
{
if (sat->initialized && sat->visible)
{
if (sat->getEnglishName().toUpper().left(objw.length
()) == objw)
{
result << sat->getEnglishName().toUpper();
}
else if (!numberPrefix.isEmpty() && sat->getCatalogN
umberString().left(numberPrefix.length()) == numberPrefix)
{
result << QString("NORAD %1").arg(sat->getCa
talogNumberString());
}
}
}
result.sort();
if (result.size()>maxNbItem) result.erase(result.begin()+maxNbItem,
result.end());
return result;
}
QStringList Satellites::listAllObjects(bool inEnglish) const QStringList Satellites::listAllObjects(bool inEnglish) const
{ {
QStringList result; QStringList result;
if (inEnglish) if (inEnglish)
{ {
foreach(const SatelliteP& sat, satellites) foreach(const SatelliteP& sat, satellites)
{ {
result << sat->getEnglishName(); result << sat->getEnglishName();
} }
} }
 End of changes. 1 change blocks. 
0 lines changed or deleted 46 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/