Opened 12 years ago
Closed 12 years ago
#8958 closed enhancement (duplicate)
Adding „library” section to presets. (idea)
| Reported by: | kendzi | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core | Version: | |
| Keywords: | presets library | Cc: |
Description (last modified by )
I count repeated lines in defaultpresets.xml and there are a lot of multiple repeated values. Also there are a lot of similar values but write in slight different way. Like one of character is upper case. When some of this item will change this implicate multiple changes in preset file and it is easy for mistake.
Most often repeat values are:
65 <combo key="opening_hours" text="Opening Hours" values="24/7,Mo-Fr 08:30-20:00,Tu-Su 08:00-15:00;Sa 08:00-12:00" />
38 <combo key="layer" text="Layer" values="5,4,3,2,1,0,-1,-2,-3,-4,-5" length="3" />
37 <text key="website" text="Website" />
31 <text key="wikipedia" text="Wikipedia" />
28 <combo key="surface" text="Surface" values="paved,unpaved,asphalt,concrete,metal,wood,paving_stones,cobblestone,gravel,pebblestone,compacted,grass_paver,grass,sand,ground" />
28 <combo key="incline" text="Incline" values="10%,-10%,10°,-10°,up,down" />
But there is much more.
So maybe it will be good idea to add section library for items. It could look this:
<preset> <group> <item> <item_element_ref ref=”opening_hours_ref”/> </item> <item> <!-- this example take combo from library but override key attribute --> <item_element_ref ref=”opening_hours_ref” key=”new_opening_hours_key”/> </item> </group> <library> <combo ref=”opening_hours_ref” key="opening_hours" text="Opening Hours" values="24/7,Mo-Fr 08:30-20:00,Tu-Su 08:00-15:00;Sa 08:00-12:00" /> </library> </preset>
So if some of values will change it will be only in one place. Preset file will be much simpler. This allow to protect from misspells too.
Attachments (2)
Change History (11)
by , 12 years ago
comment:2 by , 12 years ago
| Description: | modified (diff) |
|---|
comment:3 by , 12 years ago
comment:4 by , 12 years ago
| Component: | Internal preset → Core |
|---|
comment:6 by , 12 years ago
| Summary: | Adding „library” section to presets. [idea] → Adding „library” section to presets. (idea) |
|---|
comment:8 by , 12 years ago
A possible implementation (already containing a patch) is being discussed in #9327.
comment:9 by , 12 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
Closed as duplicate of #9327.



count of repeated lines in preset