[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    RE: I'd like it, but...
From:       David Faure <David.Faure () cramersystems ! com>
Date:       2000-03-02 11:36:02
[Download RAW message or body]

Robert wrote:
> The desktop files for devices give us the means to have  an 
> item with 2 states and each state is
> associated with an icon. AFAIK this behaviour is hard-coded: 
> The two states are mounted/unmounted,
> the check which state the item is in is done by some 
> system-call to "mount" or "stat".
> We could make this behaviour configurable. The properties 
> dialog prompts you for the count of
> states, a description and an icon for each state and how (and when) to
> check, in which state the item is in, currently.
> This way, the item is the directory, and the states are: 
> "empty, with one item, with many items".
> The icons will reflect this and the check-up is some kind of 
> "ls -1|wc".
> 
> Other items, beside devices and directories, that has come to 
> my mind were users
> (state logged in/not logged in), well-known (XML) documents (state
> draft/final), symbolic links (state dangling/correct), etc.

This all sounds very good, but it's not enough to define the states
and the icons in a property dialog. How do you plan to detect
which state the file is actually in, if you _define_ the states
in the properties dialog ? Oh (read a bit too quickly)... 
You were thinking of a shell script. I see.
Well, this is very hard to make portable. ls -1 is fine, of course, 
but mount/unmount is much much harder (on some platforms you may even 
need a special lib for that, like Solaris' volmount stuff).
But for that special case, the binary that does the check
could be shipped with KDE.

So, yes, this is an excellent idea.

On the technical side, this means... adding those states, the
corresponding icon, and the command line for the status check
to the definition of the mimetype, and using all of those
in KMimeType::icon. Sounds feasible.

Feel free to send a patch :-)

--
David Faure
faure@kde.org - KDE developer
david@mandrakesoft.com - Mandrake
david.faure@cramersystems.com - Cramer Systems

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic