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

List:       kde-core-devel
Subject:    Idea for the new kio
From:       David Faure <faure () kde ! org>
Date:       2000-01-30 3:37:39
[Download RAW message or body]

The problem
===========
If you look at CopyJob in the make_it_cool branch, you'll realise
that it's getting awful. Recursive copy is already a complex algorithm,
but implementing it with a state machine, and all in the app's process
really sucks. For every dir created (and every file copied) a job has
to be created, scheduled, associated with a slave, started, and then completed.

The algorithm used to be sequential : list, do some checks, create
subdirs (show the rename dlg if something already exists), copy the files.
Implementing this algorithm in an asynchronous way is just painful,
in addition to be not efficient at all.

What we want to avoid is code duplication. But doing everything
in the app's process doesn't seem right either.

The solution
============
Let's do this in the ioslave's process just like we did before
(i.e. it's done in the one matching the source protocol),
but let's do it in a lib to avoid code duplication.

And it's a lot simpler to do. We just take what's common between
file.cc and kioslave/ftp/main.cc for the recurse copying and
move it to a lib. The operations in the algorithm remain synchronous,
and the app doesn't lose time managing all the small operations
required for a recurse copying.

I was thinking of a libkioslave for SlaveBase already. It seems it's
the way to go for this as well.

The new problem
===============
I thought of that before Waldo's last change.
Tell me if I'm wrong : I think it doesn't clash with it.
The slave would create such a job, but it would just need to be changed
so that the slave provides the "get" part of FileCopyJob by itself.
i.e. the FileCopyJob doesn't need to know about the src url, it just
asks for data. Hmm, well that's a "put" isn't it ?



David.

Some KDE developers design things under the influence of alcohol,
some others when they can't sleep... ;-)

-- 
David FAURE
david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/
KDE, Making The Future of Computing Available Today

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

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