[Development] QStorageInfo

Matthias WALTER matthias.walter at neuf.fr
Fri Aug 29 16:58:21 CEST 2014


Hello,

Also just choice between "local" and "remote" drive in next release (5.4) ? 
No "removable", "optical", "virtual" ?

Suggestion about add "RAM Drive" ?

Thank you for your mind answer.

Best regards,

-----Message d'origine-----
De : development-bounces+matthias.walter=neuf.fr at qt-project.org
[mailto:development-bounces+matthias.walter=neuf.fr at qt-project.org] De la
part de André Somers
Envoyé : vendredi 29 août 2014 13:43
À : development at qt-project.org
Objet : Re: [Development] QStorageInfo

Bo Thorsen schreef op 29-8-2014 13:29:
> Den 29-08-2014 12:46, André Somers skrev:
>> Thiago Macieira schreef op 29-8-2014 06:32:
>>> Could be, but I want to be really clear that it should only be 
>>> local, remote and unknown. I don't want other types like "removable 
>>> magnetic", "removable optical", "removable solid state", "virtual 
>>> regular filesystem", "virtual special", etc.
>> Just wondering, but what exactly is the problem with providing more 
>> details if such details are available? A combination of flags 
>> "local", "removable" and "optical" would be quite informative.
> The problem with flags like this that if they are there, then a return 
> value with the absence of the "optical" flag set means that it's not 
> an optical disk. Flags are bools, they don't mean yes, no or unknown. 
> The flag shows the presence of something or the absence of something.
>
Good point.

So, perhaps not a QFlags, but something like an enum with attributes and an
enum with values, and a method to check those?

Along these lines I mean:

enum StorageAttribute {
     Local, Remote,  // stick to these for now
     Removable, Optical, Virtual // some possible future extensions } enum
StorageAttributeValue {
     Yes, No, Unknown
}

StorageAttributeValue QStorageInfo::hasAttribute(StorageAttribute
attribute) const;

That is, unless you want to use QOptional type for something like this,
because that effectively can make a bool into a tri-state :-)

André


_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list