Re: [Nautilus-list] Directory Descriptions (Was: I am going toimplement cut, copy,paste forfiles)



I'm throwing stuff around randomly here because I don't know all that much about the
performance issues related to XML parsing and so forth, but wouldn't it be better to
have a central directoryinfo file that had entries for each directory complete with
their paths? Thus:

<?xml version="1.0"?>
<DirectoryInfoList>
        <DirectoryInfo path="/etc">
                <title>Configuration files</title>
                <icon>/usr/share/icons/directoryicons/etc.xpm</icon>
                <hideinlevel>novice</hideinlevel>
        </DirectoryInfo>
... (and so on)
</DirectoryInfoList>

However, I can see problems with this:
1) how do you generate the file to start with? Get the user to enter all the paths at
first run? Don't think so somehow...
2) you've still got the problem of reading the thing and checking every single
directory against it to see if it should be displaying special info for it
Although a possible solution might be to shove a tiny weeny little file with no
useful information at all in it in each directory that has an entry in the global
info file, so when Nautilus finds that it knows to go look in the main file for the
info. Of course, this could still cause performance problems, not to mention
inefficiency of storing small files on some file systems.

Feel free to pick apart all that - I'm really not all that experienced at this kind
of thing.

Simos Xenitellis wrote:

> I assume to implement this properly, a special .directoryinfo file should
> be put in the designated directories that has some ID to a description of
> the  purpose of that directory.
>
> Since XML is so trendy, that .directoryinfo file could like like:
>
> /etc/.directoryinfo:   (possibly: /etc/.directoryinfo.xml) ?
> <?xml version="1.0"?>
> <DirectoryInfoList>
>     <title>Configuration files</title>
>     <icon>/usr/share/icons/directoryicons/etc.xpm</icon>
>     <hideinlevel>novice</hideinlevel>
>     ... (perhaps some more info)
> </DirectoryInfoList>
>
> However, since
>         - people do not only speak english
>         - it's bad to scatter translatable strings in all the
>           filesystem,
>
> another scheme may look better:
>
> a) /etc/.directoryinfo
> <?xml version="1.0"?>
> <Directory>
>         <ID>main_configuration_files</ID>
> </Directory>
>
> b) /usr/share/directoryinfos/C/directoryinfo.xml
> <?xml version="1.0"?>
> <DirectoryInfoList>
>         <DirectoryInfo ID="main_configuration_files">
>                 <title>Configuration files</title>
>                 <icon>/usr/share/icons/directoryicons/etc.xpm</icon>
>                 <hideinlevel>novice</hideinlevel>
>         </DirectoryInfo>
> ... (and so on)
> </DirectoryInfoList>
>
> For performance purposes, it is bad to
>         1) read the small /etc/.directoryinfo
>         2) parse XML
>         3) read the big /usr/share/directoryinfos/$LANG/directoryinfo.xml
>         4) parse the big XML
>         5) execute the logic of the directory description
> every time the user accesses the directory,
> this information should be either cached in memory or have their default
> values for the chosen $LANG put directly to the .directoryinfo file using
> some automated method.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]