[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: kio is a mess...
From:       Rik Hemsley <rik () rikkus ! demon ! co ! uk>
Date:       1999-05-23 10:00:57
[Download RAW message or body]


On 22-May-99 Alex Zepeda wrote:
> On Sat, 22 May 1999, Rik Hemsley wrote:
> 
>> Ok, but this doesn't answer my question.
>> 
>> I need to have some docs on how to use kio, not just the API reference.
> 
> Well IMO, a well written API reference will cover usage questions.

You are correct. I learnt Qt through the API docs, and didn't have to bother
with the tutorial. Sadly the KDE API docs aren't that good (yet :)

>> ... but I need to know EXACTLY how it is done, because the API docs DO
>> NOT say.
> 
> KIOJob *job;
> [..]
> job = new KIOJob();
> connect(job, SIGNAL( sigFinished( int ) ), this, SLOT(slotFinished(int)));
> connect(job, SIGNAL(sigData( int, const char*, int ) ), this, SLOT(slotData((
> int, const char*, int ) ));
> job->get("pop://host/download/1");
> job->get("pop://host/remove/1");

Excellent, thanks !

> 
> Now you can also manually specify the user and hostname in the url,
> otherwise you'll be prompted for it.  Also the slave attempts to be
> persistant, but perhaps a download_and_remove command would be safer.

Ok. So I think you mean that the job stays connected to the POP server until I
tell it to die, presumably with kill(). Thanks, this sounds fine.
 
> I think also, I'll work on implementing the index part in a few moments,
> so any suggestions are welcomed.

By 'index' do you mean the output from LIST or that from UIDL ? I could really
do with both if you don't mind. The implementation should be the same.

What happens with Empath's current (about to go away) POP mailbox class is
this, if you are interested.

It connects to the server, logs in, does a LIST, and tries to do a UIDL.
If it manages to do a UIDL, for each UIDL in the list, it does:

empath->filterMessage(EmpathURL(myUrl_ + uidl_of_message));
which would really be:
empath->filterMessage(empath://Name Of POP3 Mailbox/Inbox/FC8730A0B0B8C7D);

In this way, the message doesn't necessarily have to be downloaded before it is
'filtered'. If the filter wants to ignore all messages over a certain size, it
can ask for the size of a message.

When the filter is asked to handle the message, and wants the data, it will
call empath->message(url_as_above) and the POP3 object will then ask the KIOJob
for the data. This could get a little worrying, as Empath is so.. weird, so
knowing when to kill the connection might involve magic :)

BTW my implementation can also handle the case where UIDL is not available, as
the message IDs are unique to the mailbox/folder and all transactions are done
using URLs as reference, so there's no confusion.

Cheers,
Rik


--
KDE - Colour outside the lines  : http://www.kde.org
[[without]] - software for KDE  : http://without.netpedia.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic