API robustness - (was: Different ways to create a directory)

Andreas Pakulat apaku at gmx.de
Fri Aug 14 10:16:37 BST 2009

On 14.08.09 11:11:40, Rafael Fernández López wrote:
> On Friday 14 August 2009 10:14:53 David Faure wrote:
> > You can't solve every problem around the house with a hammer,
> > there are different tools for different purposes.
> True enough, but I don't think 5 different methods for creating a directory 
> are justified. Please note that the basic 'redundancy' with Qt cannot be 
> removed, since even if we had only one mkdir method we would have QDir::mkdir 
> and KFoo::mkdir (if that was the only mkdir method on KDE).
> However, in this very case I think KIO, NetAccess and QFile are enough for 
> every purpose. If needed, they can be added flags.
> I think I am going to create a techbase page for API users to write this kind 
> of issues, so we can get them fixed for KDE 5. I hope I can have enough time 
> for KDE 5, since this kind of things is one of my priorities...

I agree here, I don't see a reason why an app developer should need to care
wether the KUrl which he wants to use to create a directory is a remote or
local one. The KFoo::mkdir function should "just work" in either case,
hence using kio if its a remote url or QFile::mkdir for a local one. 

It may be justified to have a KStandardDirs::mkdir( <type>, "dirname" ) to
easily create a directory within one of the various standard dirs as
convenience function.

You will be the victim of a bizarre joke.

More information about the kde-core-devel mailing list