Single instance of SpecialFields (#4660)

i) Ensure that SpecialFields (and SepcialTabs for consistency) are singletons, and GlobalContext & RideCache can reload its configuration.
ii) GlobalContext not longer holds a SpecialFields parameter, SpecialFields is a single globally available object.
ii) The unused model and accessor have been removed.
iii) The unused and unimplemented fieldType() and associated enum have been removed.
iv) All SpecialFields accessor functions now use const QString& parameter types.
This commit is contained in:
Paul Johnson
2025-06-26 18:47:56 +01:00
committed by GitHub
parent e099e89d76
commit 9c6d361dab
28 changed files with 181 additions and 140 deletions

View File

@@ -41,6 +41,7 @@
#include "RideMetric.h"
#include "UserMetricSettings.h"
#include "UserMetricParser.h"
#include "SpecialFields.h"
#include <QXmlInputSource>
#include <QXmlSimpleReader>
@@ -99,7 +100,7 @@ RideCache::RideCache(Context *context) : context(context)
}
// reset special fields to take into account user metrics
GlobalContext::context()->specialFields = SpecialFields();
SpecialFields::getInstance().reloadFields();
}
// set the list