Re: [Nautilus-list] Directory Descriptions (Was: I am going toimplement



> 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:
Same thing for me ;-)
 

> 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.

This should be pre-configured, and be shipped with Nautilus (by Eazel or the
Distributors). However this File should be aware of the
Distribution/OS-specific file systen hierarchy. Maybe this could work:

There are entries in a central dirinfo file for each type of directory:
  <directory>
  <type>sbin</type>
  <description language="en">This directory contains files that are only
  executable by the superuser ("root"). They are essential for a running
  system</description>
  <description language="de">Dieses Verzeichnis enthält Dateien, die nur
  der Superuser ("root") ausführen kann. Sie sind für ein lauffähiges
  System absoulut notwendig.</description>
  </directory>
Additionaly (in this case for suse users) there is a dirinfo-suse file that
simply links to the "standard" dirinfo file for common directories (here:
/sbin) but adds/replaces entries for SuSE-specific directories like /opt:

<directory>
  <path>/sbin</path>
  <description type="sbin"></description>
</directory>
<directory>
  <path>/opt</path>
  <description language="en">Here you can find big optional packages with
  their own directory substructure</description>
</directory>


There could also be an optional user .dirinfo file in the directory with a
custom description, which could also override the entries in the central file.

> 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.

Nautilus could keep a small list in memory which contains a list of all the
directories covered by the central dirinfo file(s). So it knows if it's
worth to parse that file. So opening a directory could look like this:

1. Is there a global dirinfo entry (look at list in memory)?
2. Is there a local .dirinfo?

If one of these questions is true it displays a little "What's this
directory for?"-Button. Only when this button is clicked it parses the
XML-File and shows the info. I'm not a programmer, but to me this doesn't
look very performance-intensive. Optionally you could display the dirinfo by
default in the sidebar, but that would surely need more resources.

   Gernot.







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