[Development] QTemporaryDir API

David Faure david.faure at kdab.com
Wed Nov 16 18:52:30 CET 2011


On Wednesday 16 November 2011 18:22:23 Harri Porten wrote:
> On Wed, 16 Nov 2011, David Faure wrote:
> > Thiago suggested that I post the header file here, to see if anyone had
> > feedback on the (rather short) API.
> > 
> > Actually I'll post the .cpp file too, since the documentation of the API
> > is there :)
> 
> I tried without the documentation. Feedback based on that:

Hi Harri!
Thanks for the feedback.

> 1.) I found the argument name "templateName" a bit confusing as it could
> also refer to the name of a template. How about "nameTemplate"? :)
> 
>    QTemporaryDir(const QString &templateName);

Good idea. This is based on QTemporaryFile's similar naming, though.

> 2.) I cannot remember details of Qt's naming policies anymore but
> autoRemove() very much sounds like an action. isAutoRemoved() would be
> clearer? The "auto" abbreviation is still questionable.

Same here, this is for consistency with QTemporaryFile, and that's part of the 
existing API so I wouldn't change that.

> 3.) Shouldn't QTemporaryDir::removeDir(const QString& path) rather be a
> removeRecursive() function in QDir?

Arguable. See what the documentation for it says :-) And the discussion at 
http://developer.qt.nokia.com/forums/viewthread/9860/
ending with http://developer.qt.nokia.com/forums/viewthread/9860/P15

-- 
David Faure | david.faure at kdab.com | KDE/Qt Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions




More information about the Development mailing list