Feature: add support for type Enum to entries of file template options
ClosedPublic

Authored by kossebau on Jan 30 2017, 7:29 AM.

Details

Summary

Allows to add custom options to file templates where the user
can select one value out of a list of predefined values.

Diff Detail

Repository
R33 KDevPlatform
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau updated this revision to Diff 10689.Jan 30 2017, 7:29 AM
kossebau retitled this revision from to Feature: add support for type Enum to entries of file template options.
kossebau updated this object.
kossebau added a reviewer: KDevelop.
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJan 30 2017, 7:29 AM
mwolff added a subscriber: mwolff.Jan 30 2017, 9:55 AM

what will this be used for? how does it look like?

language/codegen/sourcefiletemplate.cpp
90

"values", since that name is also used below?

language/codegen/sourcefiletemplate.h
211

for now?

In D4339#81270, @mwolff wrote:

what will this be used for? how does it look like?

As you already might have seen :) example here: https://phabricator.kde.org/D4340#46a1eba3

language/codegen/sourcefiletemplate.cpp
90

The .kcfg format reused here has "choices" and "choice" defined as element names, cmp.
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd

While I see some small issues with that reuse, unless we design a new special schema perhaps one day IMHO we should follow the defined and referenced one, anything else will only confuse 3rd-party devs.

language/codegen/sourcefiletemplate.h
211

I was following the pattern of the other API dox comments here. What do you mean with "for now"? :)
BTW, maxValue/minValue and values are never used together, so could be made alternative options. But given this class will have only few instances, I stayed away for now to make this code more complicated by memory-optimizing it. Agreed?

mwolff accepted this revision.Jan 30 2017, 4:40 PM
mwolff added a reviewer: mwolff.

lgtm then

This revision is now accepted and ready to land.Jan 30 2017, 4:40 PM
This revision was automatically updated to reflect the committed changes.