Review Request 108895: Tidy QML Plugins (1/2)

David Edmundson david at davidedmundson.co.uk
Thu Feb 28 02:58:13 UTC 2013



On Feb. 11, 2013, 2:26 a.m., David Edmundson wrote:
> > I think it's some interesting work.
> > 
> > From my point of view, there's little point in exposing managers to QML. That's especially bad because once we grow, we'll want to be able to put a ContactsModel {} wherever we want without having to initialize different manager instances or having to pass the pointer from a component to the other.
> > 
> > I guess it's necessary to explicitly declare the KTp.Base {} instance to define the features that will be used, but also it would be interesting not to make this link specific. A way to do that would be to create a singleton that can create different sets of account managers.
> > 
> > But maybe that's too complex and we can simply go with this. After all the very relaxed naming scopes in QML could be benefitial in this case, and we could have as much of those we want:
> > 
> > Ktp.ContactModel { accountManager: tpController.accountManager }
> > 
> > Although avoiding it could make room for some interesting optimizations in the future.
> > 
> > I hope that helps...

> From my point of view, there's little point in exposing managers to QML.
It needs to be done somehow, besides, the "good thing about this approach is that we have a clear mapping of the api from c++."


Alternate approach:
We wrap all our plasmoids in C++ and expose AccountManager as a contextProperty
It can then be app-specific, and we get our single accountManager per plasmoid with relevant features. 

We still need KTp.ContactModel { accountManager: accountManager}
I was looking at converting contact-list-applet anyway so I can put some more advanced logic in the config.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108895/#review27161
-----------------------------------------------------------


On Feb. 11, 2013, 12:37 a.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/108895/
> -----------------------------------------------------------
> 
> (Updated Feb. 11, 2013, 12:37 a.m.)
> 
> 
> Review request for Telepathy.
> 
> 
> Description
> -------
> 
> Tidy QML Plugins
> 
> Remove our own declarative ContactsModel class, and simply expose KTp::CommonInternals
> 
> Create a new QML class that can act as the AccountManager. 
> This can then be passed to anything that needs it (the ContactsModel and GlobalPresence and the ConversationsModel/TextObserver)
> 
> See part 2/2 for how it works in practice
> 
> 
> Diffs
> -----
> 
>   KTp/Declarative/qml-plugins.cpp bd2a92717489af3ddb4cdc5b6413a2caaf307e92 
>   KTp/Models/contacts-list-model.cpp dfa32870ea501c84bd15c3d2f0df78ef0e501da0 
>   KTp/Models/contacts-model.h 7e91e155a205b5c9dab24470a0e10ef63a087ea6 
>   KTp/Declarative/base.cpp PRE-CREATION 
>   KTp/Declarative/contact-list.h a59814490fd0dc3407e1f6a45266de7e6d89149c 
>   KTp/Declarative/contact-list.cpp 9e05d5c964ace0b6ee657edad6ecd99d0e823ce1 
>   KTp/Declarative/CMakeLists.txt f42252d4fd2d3a7d5d23cd9de110e251a79e4170 
>   KTp/Declarative/base.h PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/108895/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20130228/d11c3102/attachment.html>


More information about the KDE-Telepathy mailing list