Modify

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 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 12 years ago.
count of repeated lines in preset
filtered_count.txt (66.3 KB ) - added by skyper 12 years ago.
cleaned up list

Download all attachments as: .zip

Change History (11)

by kendzi, 12 years ago

Attachment: count.zip added

count of repeated lines in preset

comment:1 by AlfonZ, 12 years ago

This seems similar to #7556.

comment:2 by kendzi, 12 years ago

Description: modified (diff)

by skyper, 12 years ago

Attachment: filtered_count.txt added

cleaned up list

comment:3 by skyper, 12 years ago

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 by skyper, 12 years ago

Component: Internal presetCore

comment:5 by stoecker, 12 years ago

See #1877 point c.

comment:6 by Don-vip, 12 years ago

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

comment:7 by Don-vip, 12 years ago

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

comment:8 by simon04, 12 years ago

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

comment:9 by Don-vip, 12 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.