Consider only athletes with config/metadata.xml on v3.6 upgrade

Athletes with default config can be safely skiped without loss of
information in the same way as non athlete folders.
Fixes #3735 for new cases, but users previously affected by this bug
need to manually delete metadata.xml from GC root folder, it doesn't
seem a problem common enough to merit an special treatement.
[publish binaries]
This commit is contained in:
Ale Martinez
2020-12-26 21:02:55 -03:00
parent 5eb519a214
commit c25e9f2749

View File

@@ -258,11 +258,11 @@ RideMetadata::configChanged(qint32)
QString name = i.next();
// if there is no avatar its not a real folder, even a blank athlete
// will get the default avatar. This is to avoid having to work out
// what all the random folders are that Qt creates on Windows when
// using QtWebEngine, or Python or R or created by user scripts
if (!QFile(gcroot + "/" + name + "/config/avatar.png").exists()) continue;
// if there is no metadata.xml it is not an athlete folder
// or it is one still using default metadata.xml, so skip it
// since there is no custom configuration to preserve.
QString filename = gcroot + "/" + name + "/config/metadata.xml";
if (!QFile(filename).exists()) continue;
// athlete specific configuration
QList<KeywordDefinition> a_keywordDefinitions;
@@ -270,8 +270,7 @@ RideMetadata::configChanged(qint32)
QList<DefaultDefinition> a_defaultDefinitions;
QString a_colorfield;
// read in athlete sepcific
QString filename = gcroot + "/" + name + "/config/metadata.xml";
// read in athlete specific
readXML(filename, a_keywordDefinitions, a_fieldDefinitions, a_colorfield, a_defaultDefinitions);
// first one, just use them all