summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Zotti <Georg.Zotti@univie.ac.at>2023-09-04 16:27:54 +0200
committerGeorg Zotti <Georg.Zotti@univie.ac.at>2023-09-04 16:27:54 +0200
commitd68b8bf3903f8857692b09ea1675d2c9e60b041e (patch)
tree0be8d1a6bd2df4cb325fed8ae0edc9e678c78089
parent88c12703b3ecfca9ab35f29be8d09a4c7a1472f1 (diff)
loader refinementsfix/unambiguous_comet_names
-rw-r--r--src/core/modules/SolarSystem.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/modules/SolarSystem.cpp b/src/core/modules/SolarSystem.cpp
index 8443710d07..63e30080da 100644
--- a/src/core/modules/SolarSystem.cpp
+++ b/src/core/modules/SolarSystem.cpp
@@ -765,8 +765,9 @@ bool SolarSystem::loadPlanets(const QString& filePath)
static const QRegularExpression iauDesignationRe("^([1-9][0-9]*[PD](-\\w+)?)|([CA]/[-0-9]+\\s[A-Y])");
QRegularExpressionMatch iauDesignationMatch=iauDesignationRe.match(englishName);
- // Our name rules for the final englishName, which must contain one element in brackets.
+ // Our name rules for the final englishName, which must contain one element in brackets unless it starts with "A/".
// Numbered periodic comets: "1P/Halley (1986)"
+ // Reclassified Asteroid like "A/2022 B3"
// All others: C-AX/2023 A2 (discoverer)". (with optional fragment code -AX)
const QString iauDesignation = pd.value(secname+"/iau_designation").toString();
const QString dateCode = pd.value(secname+"/date_code").toString();
@@ -779,10 +780,10 @@ bool SolarSystem::loadPlanets(const QString& filePath)
// The test here can be improved, e.g. with a regexp. In case the name is already reasonably complete, we do not re-build it from the available elements for now. However, the ini file should provide the elements separated!
if (iauDesignation.isEmpty() && !englishName.contains("("))
englishName.append(QString(" (%1)").arg(discoveryCode));
- else if (!iauDesignation.isEmpty() && !englishName.contains("(") && !englishName.contains("/"))
+ else if (!iauDesignation.isEmpty() && !englishName.contains("(") && !englishName.contains("/") && !englishName.startsWith("A/"))
englishName=QString("%1 (%2)").arg(iauDesignation, englishName); // recombine name and iau_designation if name is only the discoverer name.
- if (!englishName.contains("("))
+ if (!englishName.contains("(") && !englishName.startsWith("A/"))
{
QString name;
if (!iauDesignation.isEmpty())