Modify ↓
Opened 5 years ago
Last modified 5 years ago
#19666 new enhancement
GPXSettingsPanel should leverage IPreferences
| Reported by: | simon04 | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core | Version: | |
| Keywords: | gpx preference refactoring | Cc: | Bjoeni |
Description
Since #16796/r15496, GPXSettingsPanel duplicates many parsing/formatting preference functions which are specified by the interface IPreferences. GPXSettingsPanel should be refactored to use a layer MemoryPreferences instance and fallback to the global Config#getPref (by using the draw.rawgps. prefix).
Attachments (0)
Note:
See TracTickets
for help on using tickets.



There were a couple of issues with that:
MemoryPreferencesmakes much sense here since all layer specific prefs are stored in theGpxDataobject. And eventually they anyways have to be converted to strings when being saved to the file. Sure we can add a property of typeMemoryPreferencestoGpxData, but I simply don't see the benefits here. It's just converting back and forth.So I just decided against it because it's quite different from the existing preferences handling, but if you want to refactor that stuff go ahead :)
I agree though that
GpxSettingsPanelis a mess. In my opinion at least all the preferences logic should be extracted to another class, it makes no sense that for exampleGpxDrawHelperis callingGpxSettingsPanelin order to read preferences.But anyways I don't really have the time to write a patch at the moment.