@@ -2995,12 +2995,20 @@ void Satellites::parseTleFile(QFile& openFile, TleDataHash& tleList, bool addFla
29952995 lastData.second = line;
29962996 // The Satellite Catalogue Number is the second number
29972997 // on the second line.
2998- QString id = getSatIdFromLine2 (line);
2998+ #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
2999+ QString id = line.split (' ' , Qt::SkipEmptyParts).at (1 ).trimmed ();
3000+ #else
3001+ QString id = line.split (' ' , QString::SkipEmptyParts).at (1 ).trimmed ();
3002+ #endif
29993003 if (id.isEmpty ())
30003004 {
30013005 qDebug () << " [Satellites] failed to extract SatId from \" " << line << " \" " ;
30023006 continue ;
30033007 }
3008+ // Strip any leading zeros as they should be unique ints as strings.
3009+ static const QRegularExpression re (" ^[0]*\\ B" );
3010+ id.remove (re);
3011+
30043012 lastData.id = id;
30053013
30063014 // This is the second line and there will be no more,
@@ -3156,22 +3164,6 @@ void Satellites::parseCsvFile(QFile& openFile, const QStringList& headerEntries,
31563164 }
31573165}
31583166
3159- QString Satellites::getSatIdFromLine2 (const QString& line)
3160- {
3161- #if (QT_VERSION>=QT_VERSION_CHECK(5, 14, 0))
3162- QString id = line.split (' ' , Qt::SkipEmptyParts).at (1 ).trimmed ();
3163- #else
3164- QString id = line.split (' ' , QString::SkipEmptyParts).at (1 ).trimmed ();
3165- #endif
3166- if (!id.isEmpty ())
3167- {
3168- // Strip any leading zeros as they should be unique ints as strings.
3169- static const QRegularExpression re (" ^[0]*\\ B" );
3170- id.remove (re);
3171- }
3172- return id;
3173- }
3174-
31753167void Satellites::loadExtraData ()
31763168{
31773169 // regular expression to find the comments and empty lines
0 commit comments