Using plasma enums from QML2

Marco Martin notmart at gmail.com
Tue May 14 15:53:18 UTC 2013


On Tuesday 14 May 2013 15:12:59 Aaron J. Seigo wrote:
> On Sunday, May 12, 2013 13:14:23 Marco Martin wrote:
> > plasma.topEdge (notice the lower case)  that plasma object would be a
> 
> fugly :/ i'm not happy with the overly long "PlasmaCore.Types.TopEdge", but
> i guess that's the lesser of evils.

some things can be done:
* the PlasmaCore namespace is a convention that depends from the qml coding 
using it (import org.kde.plasma.core as PlasmaCore) so we could start to 
recommend to not use it, even tough  it has its share of problems, or

* we could do another import only for the types (org.kde.palsma.types) that 
would be advised to be used without the "as", then Yypes would be exported 
under the name "Plasma". at this point Plasma.TopEdge would work in the qml 
code regardles core was assigned the PlasmaCore namespace or not

> > > > * Types name (or any other for what matters) is not particularly
> > > > pretty
> > > > * in c++ all Plasma::Foo must be changed in Plasma::Types::Foo
> > > 
> > > what's wrong with the typedefs you put in there?
> > 
> > i think they should go
> 
> In a perfect world, yes. In the less perfect world we live in, it means more
> porting work. Not sure which is worse. I suppose, at least, that this kind
> of porting can be done with a script.

unfortunately posting has to be dine anyways, since the typedefs only cover 
the use of the enum names, not the use of enum values. so if this approach is 
followed, porting has to be done (so while one is at it..)

-- 
Marco Martin


More information about the Plasma-devel mailing list