[Development] QStandardPath search paths
Alan Alpert
416365416c at gmail.com
Tue Aug 20 02:15:31 CEST 2013
On Wed, Jul 31, 2013 at 10:55 AM, Thiago Macieira
<thiago.macieira at intel.com> wrote:
> On quarta-feira, 31 de julho de 2013 16:33:31, Hausmann Simon wrote:
>> I wonder what Filesystem folks think about it (especially Andreas, who was
>> around when I added the search dirs with Girish)
>
> My opinion is that the search path feature is at the wrong level of
> abstraction. It's also a potential security issue, since filename handling
> might not catch the opening of files outside the specified user parameters. It
> makes the determination of whether a given file path is absolute or not
> ambiguous.
>
> Those problems are shared by the file engines. Which we've fortunately got rid
> of for Qt 5.
>
> In my opinion, the *correct* way of searching for a file is
> QStandardPaths::locate. If you need to determine whether the file should be
> opened or not, the API can return you an absolute file name, which you can
> manipulate.
>
> This level of feature should be present on a VFS layer, above QFile and QDir.
>
> So I'd like us to decide first: either we deprecate the search path
> functionality completely, or we accept them and use them. If we accept them
> for use, then I'm ok with adding the QStandardPaths there. Collisions with
> what users may have added are not important.
The discussion has moved on a bit since, but I don't think we really
answered this question (one person said "sounds good", before Thiago's
email). Asset paths are probably going to be treated slightly
differently now, but there's still the possibility of adding
downloads:
documents:
photos:
cache:
genericCache:
config:
data
genericData:
etc.
or the alternative of deprecating search paths. Anyone have an opinion here?
--
Alan Alpert
More information about the Development
mailing list