runners and KIO::NetAccess

Petri Damstén petri.damsten at gmail.com
Fri Jan 9 06:27:31 CET 2009


On Friday 09 January 2009 00:18:50 Aaron J. Seigo wrote:
> On Thursday 08 January 2009, Petri Damstén wrote:
> > Hi,
> >
> > If i try to do KIO::NetAccess::download or KIO::NetAccess::synchronousRun
> > in a runner I get a crash. I can't figure out how should I download data
> > from the net in runners?
>
> well, for one, these downloads will need to be fast to be useful to the
> user, or we'll need to provide for a really "slow boat" for these kinds of
> runners (e.g. don't launch them during typing, but only after typing ceases
> for a period of time or upon some other user generated signal)

I added currency conversion to libconversion/converter runner and it loads 
small xml file from the ECB web site. It caches it for a day and also checks 
if network connection is active with Solid.

> > #0  0x00007f38f0fdc50f in KIO::TransferJob::sendAsyncData
> > (this=0x15fbf00, dataForSlave=@0x43195ec0)
> >     at /home/damu/Development/src/kdelibs/kio/kio/job.cpp:1028
>
> i'll wager that kio isn't thread safe ;) if you put a shared (e.g. class
> static) mutex in your runner that wraps the KIO usage, does it then work?

Does not seem to help (if I used it correctly). Until I figure out what's 
wrong KProcess::execute(QStringList() << "kioclient" << "copy" << URL << 
m_cache) seems to work (code is in svn kdeplasma-
addons/libs/conversion/currency.cpp).

Petri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090109/bf0f15a2/attachment-0001.sig 


More information about the Plasma-devel mailing list