Posted April 18, 2010 by Mehrdad in Choqok, PlanetKDE. Tagged: Upload. 9 Comments

During last week I was working on a new plugin system for Choqok, It’s idea was in my mind for about 2 months, But now, It’s ready to use, and develop plugins for it.

Choqok supports image uploading to Twitpic since early versions, and supports Media attachment in Identica/Statusnet service since latest Beta release.

But, There are so many image/video uploading services out there! what if we want to support them too!?

Here is the answer: A plugin system to support more services as easy as writing one or two functions :)

There’s just one function to override:

void upload( const KUrl &localUrl, const QByteArray &medium, const QByteArray &mediumType)

Choqok will load medium, detects it’s mime type and provide it to plugin as a ByteArray!

So, plugin just have to upload file with the service API, and then emit the mediumUploaded() signal :)

Now we have a global Medium uploading dialog right in Tools menu:

I have ported the Twitpic plugin to this new system, And wrote a plugin for YFrog service.

It still needs some improvements to be what i want ;)