Monday, March 26, 2007

Jabber client example in KDE/QT

This is a small client I developed for educational purposes on top of KDE and gloox (for simplicity) in C++.

Basic ideas:

  • Jabber data processing needs a loop and/or an event handler (depending on architecture). Most graphical systems will also need one, this can cause problems. In this example, we used QT's idle processing feature, which called a single cycle of Gloox's message processing. A kgloox wrapper class was written for this.

  • In case writing a client application (not a bot or likesome), we need to connect conversations to windows. Most users feel comfortable that they have one window for each contact (or at least, each resource). Because of incoming messages, we'll need a mapping of contact -> window, and also a window->contact mapping. Although the second one could be stored in the window class itself in some environments, the first one will definitely need some window manager object. Some would argue that it's just a matter of observer pattern, but I'd say that it's easier to implement this way, because of contact we haven't opened a window for yet.

  • In most of the time, we need to subscribe to specific kind of messages, like messages of specific type (message/presence), of specific origin (given user), or specific namespace (feature query). It's a good idea to have some general handling pattern of such - like, observer pattern, signal-slot mechanisms, or packet catchers/interceptors. It's also a good idea to make it either hierarchical or precisely catcheable (like a PresenceProcessor class catches all <Presence/> stanzas coming from a JabberConnection class, then individual viewports could catch for a specific user, ie. when a window is open with a given contact, it's a good feature that you could see when the contact goes away.)

  • It's good to have separate layers of application: not all the components would be responsible, for example, processing of Jabber XML streams, nor all the layers have a hardwired reference of UI.



You can download the KDE source here.



Requirements for build:



It was coded with kdevelop because it's easier to write it in an IDE, it's c++, not javascript... ;)

Screenshots


23 comments:

rootpp said...

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
big boobs

rootpp said...

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
http://bigboobs.cc2cc.com/

rootpp said...

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
boobies

mcmature said...

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
Reseller Hosting

Unknown said...

the red hands look sharp and charismatically spooky against the black.
http://www.watchestoo.com
SWISS ROLEX DAYTONA 116509A
SWISS ROLEX DAYTONA 116509E
SWISS ROLEX DAYTONA 116523C
SWISS ROLEX EXPLORER II 16570A
SWISS ROLEX EXPLORER II 16570C
SWISS ROLEX GMT-MASTER
SWISS ROLEX GMT-MASTER
SWISS ROLEX SUBMARINER 14060
SWISS ROLEX SUBMARINER 14060M
SWISS ROLEX SUBMARINER 16600
SWISS ROLEX SUBMARINER 5513A
SWISS ROLEX SUBMARINER DATE 16610LV
SWISS ROLEX SUBMARINER DATE 16610

gethqnet said...

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
big boobs

walkintub said...

That is some inspirational stuff. Never knew that opinions could be this varied. Thanks for all the enthusiasm to offer such helpful information here.
I bookmarked it into my facebook and digg and share the good stuff with my friends too,Keep up work.Is there more aspect about this subject?I am looking forward to seeing it.

walk in tub|walk in tubs|
walk in baths|walk in bathtubs

Unknown said...

What is Breitling? Do you know Breitling Watches? Buy these Breitling Watches sale on line.More cheap Breitling Watches for sale! 小强测试

Unknown said...

Buffalo Bills jerseys
Buffalo Bills apparel
Buffalo Bills shirts
Jimmy Choo shoes
Chanel Shoes
YSL Shoes
air jordan shoes sale
michael jordan shoes sale
micheal jordan shoes
free shipping wholesale jordan shoes
RL Classic-Fit Polos Men's
RL long sleeve polos Men's
RL Solid Polo Shirts Men's

Unknown said...

If you want to adorn your handbag collection and you do not have even a single piece of louis vuitton wallets , then your handbag collection is definitely incomplete and dull. If you are interesting in enhancing the beauty of your purse collection, then you should have at last few pieces of louis vuitton wallet . Every time louis vuitton replica handbags comes up with its new collection, women go crazy and just want to have each and every bag.

Unknown said...

ED clothing was inspired by the man who also gave the line hardy shirt name, the legendary tattoo artist, ED Hardy Shoes . Known as "the godfather of modern tattoo" in many tattoo circles, ED Hardy Shoes blend of Japanese and American styles is highly sought after around the world.

The Breitling Watches is part of the Breitling Aeromarine series. There are several variations of this timepiece to include highly customized versions. While the physical design each watch differs, there are several mechanical specifications that are common in all variations in Breitling Windrider series. These Bentley 6.75 specifications include: super quartz movement, a uni-directional bezel and a sapphire crystal.

When you buy women's Christian Louboutin , not only are you getting to wear the same shoes as your favorite celebrity, you are also getting a pair of Christian Louboutin Pumps that will last longer and look better than almost any other shoes you have ever bought. Christian Louboutin Boots are a particular favorite with celebrities such as Victoria Beckham and Kate Moss, and they can both be seen sporting the latest designs to come from that particular design house - but even with a discount you would need to save for quite a while for Christian Louboutin Sandals .

Anonymous said...

thanks for this example in KDE/QT I have heard of it, but only descriptions not something like this, thanks! I will show you an example of Sildenafil when I got it done!

admin said...

Hey - good blog, simply wanting around some blogs, appears a reasonably nice platform you might be using. I’m presently utilizing WordPress for just a few of my sites however seeking to change considered one of them over to a platform similar to yours as a trial run. Something in particular you'll advocate about it?
genital wart treatment

Allen Smith said...

Good submit with some useful data! Can’t say I completely agree with all that you've got advised right here, however there are a great quantity of necessary data you could have highlighted that can be very helpful on canine coaching and related topics. Please continue offering extra suggestions on this matter and related subjects, as there are lots of on the market like me who're trying to get to know the ups and downs.
acid reflux remedies
blemish treatment
cholesterol lowering foods

Allen Smith said...

Good submit with some useful data! Can’t say I completely agree with all that you've got advised right here, however there are a great quantity of necessary data you could have highlighted that can be very helpful on canine coaching and related topics. Please continue offering extra suggestions on this matter and related subjects, as there are lots of on the market like me who're trying to get to know the ups and downs.
constipation remedies
excessive sweating treatment
how to get rid of cellulite

Allen Smith said...

When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a remark is added I get four emails with the identical comment. Is there any manner you may remove me from that service? Thanks
how to stop snoring
head lice treatment
sinus infection home remedy
yeast infection home remedy

James said...

hey there and thank you for your info �V I��ve certainly picked up anything new from right here. I did however expertise some technical points using this site, as I experienced to reload the web site lots of times previous to I could get it to load properly. I had been wondering if your hosting is OK? Not that I'm complaining, but slow loading instances times will sometimes affect your placement in google and can damage your high-quality score if advertising and marketing with Adwords. Well I��m adding this RSS to my e-mail and could look out for much more of your respective intriguing content. Make sure you update this again soon..

Anonymous said...

Aston Villa rode their luck at Hull City where an 88-minute own goal from Kamil Zayatte saw them leapfrog three points clear of Arsenal and into fourth place in the Premier Leamoncler

Anonymous said...

Very good post, the whole code is very good, you light years ahead of me.

samrx

Cheap Down Jacket said...

This variety of products that are stuffed with Wholly Totally 100 % pure limit calculate disbursing out from the a higher price simply because there're going to go on interior phenomenon for a number of Moncler Coat
and look for your property or even family related with vast Moncler
. Though purchasing one another, check out a few fundamental traits you will probably have advantageous for the Moncler Jackets.

Herschel Muehlbach said...

Style will be the at any time changing idea regarding making use of more recent plus greater developments. moncler outlet variety with wardrobe possesses accomplished a endorsement regarding guys as well as women both alike. A leather coats also are sewed inside a specific fashion that provides way more longevity to the utilization of moncler outlet spencer. The discolored in addition to fruit colored moncler canada goose outdoor jackets had been by far the most favorite piece of clothing in that case, and they became the most looked for immediately after Jackets within European union.

Anonymous said...

These kind of post are always inspiring and I prefer to read quality content so I happy to find many good point here in the post, writing is simply great, thank you for the post Woodcock

Unknown said...

windows 10 update news