[Qt-interest] QFileInfo doesn't work after QDir::setCurrent. Bug?
Scott Bloom
scott.bloom at onshorecs.com
Thu Jun 10 22:10:05 CEST 2010
Its always relative...
However once you make a call on it, the low level file information is loaded
and cached (if caching is on).
Then any other call uses the cached information, rather then the info on the
file system.
Its not that its converting it to a absolute path, but rather that it
resolved the relative path to a place on the harddrive..
Scott
On 6/10/10 12:05 PM, "Gabriel M. Beddingfield" <gabrbedd at gmail.com> wrote:
>
>
> On Thu, 10 Jun 2010, Scott Aron Bloom wrote:
>
>> Performance Issues
>> Some of QFileInfo's functions query the file system, but for performance
>> reasons, some functions only operate on the file name itself. For
>> example: To return the absolute path of a relative file name,
>> absolutePath() has to query the file system. The path() function,
>> however, can work on the file name directly, and so it is faster.
>
> Got it. But it doesn't make sense that /sometimes/ a
> relative path is relative, and /sometimes/ it's absolute.
>
> That is, the path is relative until you call a method... and
> then the path gets bound to an absolute path.
>
> That just doesn't make sense. It should either always be
> relative, or always be absolute.
>
> -gabriel
More information about the Qt-interest-old
mailing list