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

David Faure faure at kde.org
Fri Aug 14 10:34:49 BST 2009

On Friday 14 August 2009, 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.

I agree, but I don't see what we can do about that in KDE.
See my initial reply to the thread; the 3 kde methods have a different purpose,
the duplication is between qt and kde, but with a missing feature in the Qt one.
So the fix is not KDE5, but adding mode_t to QDir::mkpath() so that
we can get rid of KStandardDirs::makeDir.

> However, in this very case I think KIO, NetAccess and QFile are enough for 
> every purpose. If needed, they can be added flags.

s/QFile/QDir/ I guess. So we agree up to here, but I don't see any relation with KDE 5.

OK the one thing I see for kde 5 is removing NetAccess since job->exec() does
the same (with the same dangers), but that's not what you had in mind :)

> 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...

For such "small" kde5 todos I'd rather seem then as comments in the code (like we
have already in some places) rather than on a separate soon-forgotten techbase page.

> And to sum up following your nice statement, the problem from my POV is when 
> you have different tools for the same purpose (creating a directory, after 
> all) ;)

Yeah, just like there are different saws, depending on the kind of sawing
you need to do. Same purpose (cutting wood), but different constraints/goals.

David Faure, faure at kde.org, sponsored by Qt Software @ Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

More information about the kde-core-devel mailing list