Modify

Opened 7 years ago

Closed 6 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 kendzi)

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)

count.zip (34.6 KB) - added by kendzi 7 years ago.
count of repeated lines in preset
filtered_count.txt (66.3 KB) - added by skyper 7 years ago.
cleaned up list

Download all attachments as: .zip

Change History (11)

Changed 7 years ago by kendzi

Attachment: count.zip added

count of repeated lines in preset

comment:1 Changed 7 years ago by AlfonZ

This seems similar to #7556.

comment:2 Changed 7 years ago by kendzi

Description: modified (diff)

Changed 7 years ago by skyper

Attachment: filtered_count.txt added

cleaned up list

comment:3 Changed 7 years ago by skyper

Nice list, did clean up a bit.
We already missed:

22 <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" />

comment:4 Changed 7 years ago by skyper

Component: Internal presetCore

comment:5 Changed 7 years ago by stoecker

See #1877 point c.

comment:6 Changed 7 years ago by Don-vip

Summary: Adding „library” section to presets. [idea]Adding „library” section to presets. (idea)

comment:7 Changed 7 years ago by Don-vip

Ticket #9066 has been marked as a duplicate of this ticket.

comment:8 Changed 7 years ago by simon04

A possible implementation (already containing a patch) is being discussed in #9327.

comment:9 Changed 6 years ago by Don-vip

Resolution: duplicate
Status: newclosed

Closed as duplicate of #9327.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.