Plasma Chat widget

David Edmundson david at davidedmundson.co.uk
Sun Aug 28 12:52:16 UTC 2011


On Sun, Aug 28, 2011 at 1:19 PM, Lasath Fernando <kde at lasath.org> wrote:
> Right, I hacked on this day before yesterday, and I think I made some progress.
>
> The code so far is in my clone (called qmlplugin, in a branch called qmlplugin)
> http://quickgit.kde.org/?p=clones%2Ftelepathy-chat-handler%2Ffernando%2Fqmlplugin.git&a=summary
> http://quickgit.kde.org/?p=clones%2Ftelepathy-chat-handler%2Ffernando%2Fqmlplugin.git&a=shortlog&h=refs/heads/qmlplugin
>

Cloned. Looks sensible so far.

> I made the QML plugin compile into ktelepathy_chat_lib because I don't
> really know how to make a Qt/KDE library. I'm also not very proficient
> with CMAKE, so I've had to hardcode the path it installed to (on my
> machine) in a file called qmldir in the plasmoid/contents/ui
> directory.

> Can one of you guys write a cmake target to install the plasmoid and
> make it find the correct path at runtime? Or better yet, explain to me
> how to do so..

Sure, I'll take a look. Initial glance is that you need to make a
seperate library with the qmlRegisterType code in, and put this
library into ${IMPORTS_INSTALL_DIR}/org/kde/telepathy/declarativeplugin.

Have a look at kde-telepathy and the declarative folder. Here we
expose a model to QML that is in the main lib. Which is effectively
what we want to do in this case too.

MessageModel looks good. I'm genuinely quite impressed.

> That is, IF we decide to ship this directly as part of
> telepathy-chat-handler of course.
>
I'm not sure. It makes some sense to OR put this code in our common
lib. Either way that's just a copy and paste job whenever.


> As for the plasmoid itself, I decided to use the original mockup I
> made while learning QML rather than starting again (although I _may_
> regret that later). There's just a ListView that displays everything
> from the QML plugin, which is an AbstractListModel. I used the
> suggestion from oggis_ and created a Tp::ContactMessenger with a
> hardcoded account and contact. It shows received/sent messages atm,
> though I couldn't send messages (I think the version of
> mission-control I'm using is way too old).
>
Hmm wonder why. What comes out of the verifyPendingOperation when you run it?

I'll help fix it, in any case :)

> I'm not quite sure where to go from here though. And as for the way I
> structured my plugin, I did that mostly by groping in the dark hoping
> things will 'just work'. Though it's not ready for testing yet, I'd
> prefer if someone can look through my code and check if it's somewhat
> sane before I proceed any further. (This is the first KDE thing I've
> written on my own)
> I'm open for suggestions and will be happy to make any changes
> necessary, even if it means scrapping most of it and starting again
> (although c'mon I must have got at least _something_ right ;-).
>

I would recommend the following next steps:
 - Fix the library so it installs properly, myself or Nwoki can help there
 - Show us a screenshot of it in action, and maybe blog about it if it
looks good.
 - Make the plugin behave like an observer so we get to see all new
channels (i.e not hardcoded) - again ping me when you're around to
work on it.

Few comments:
- Code is sane, lots of minor comments (lots of missing "consts"),
but nothing serious. When you're ready we can get a few classes
reviewed.
- You don't need to CC me or olli when you mail the ML, I'm always here.
- I know I'm not around on IRC at the moment, but if you ever want me
add this address on jabber and ping me. I'm happy to procrastinate
from work really.
- Commit small, commit often. It makes things easier for me than
reading through a massive diff.
- "qFatal("derp");" - this made me giggle.

>
> On Thu, Aug 18, 2011 at 10:40 PM, Lasath Fernando <kde at lasath.org> wrote:
>>>
>>> No. It's hardly started.
>>>
>>
>> Sorry about that - Uni has be absolutely kicking my butt lately. I
>> promise I'll start properly working on it as soon as I can though.
>>
>
> ----
> Cheers,
> Lasath
>


More information about the KDE-Telepathy mailing list