[Development] QStorageInfo

Rutledge Shawn Shawn.Rutledge at digia.com
Thu Aug 28 16:18:06 CEST 2014


On 28 Aug 2014, at 4:03 PM, Thiago Macieira wrote:

> On Thursday 28 August 2014 06:57:30 Rutledge Shawn wrote:
>> But isLocal is the wrong name for something that isn't a bool, and also
>> implies that local drives are normal or preferred (which is a matter of
>> current fashion, while the future is debatable).  If we want an enum, maybe
>> we'd better go back to calling it some sort of type flag, but only have 3
>> possible values for now?  It is more extensible: we can add new flags
>> whenever we are sure that they can be set reliably on all platforms.  And
>> ORing them is more extensible than making them mutually exclusive, because
>> we don't know what flags we will add later.  So let's have zero be the
>> "unknown", and the type of this property should be QFlags. What should its
>> name be?
> 
> I don't want flags because this will lead people to assume that only local and 
> remote are mutually exclusive and then write code that assume it's always one 
> or the other.
> 
> I want an API that makes it clear that detection may fail or be ambiguous. 
> Call it "storage locality" or "storage remoteness" or, hopefully, some better 
> name.
> 
> The more types we start to add, the more difficult it becomes. We can provide an 
> extra attribute for those types that are determined to be local to report 
> whether they're fixed, removable, virtual or unknown.

There could be a hybrid (maybe it's even common already… I'm not a user of commercial cloud storage yet so don't know): cloud storage with a big local cache, so that many files are available offline, but not everything.  In the database use case maybe it should be considered local, because performance will be OK, but it's not strictly true.


More information about the Development mailing list