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

List:       kde-devel
Subject:    Re: How to teach KURLRequester/KFileDialog to filter for executables?
From:       David Faure <david () mandrakesoft ! com>
Date:       2001-11-27 17:55:24
[Download RAW message or body]

On Tuesday 27 November 2001 20:48, Marc Mutz wrote:
> On Tuesday 27 November 2001 12:52, David Faure wrote:
> <snip>
> > bool KonqRun::isExecutable( const QString &serviceType )
> > {
> >     return ( serviceType == "application/x-desktop" ||
> >              serviceType == "application/x-executable" ||
> >              serviceType == "application/x-shellscript" );
> > }
> 
> Thanks. So I will use that for now and add a "FIXME: use x-bit when
> available"...
> 
> > Strange, I don't know what happens with python, perl, etc. scripts...
> > Either they come up as one of the above, or they're currently omitted
> > and nobody noticed :}
> 
> Maybe it would be a start to define what app/x-executable really
> means... It's only listed file extension is .exe, and all the other
> types I can think of (except a.out and elf) have their own mimetypes...
> So it is supposed to mean "a.out or elf or <add your systems binary
> foramt here>", no?

There's more logic in KMimeType than you think ;-)
x-executable isn't only for .exe. It's for anything with the X bit, in fact.
  if ( !_is_local_file && S_ISREG( _mode ) && ( _mode & ( S_IXUSR | S_IXGRP | S_IXOTH ) ) )
    return mimeType( "application/x-executable" );

Hmm, so even a shellscript should match this, in fact, if it has the +x bits.
Might be that x-shellscript is for .sh files without +x bit

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://perso.mandrakesoft.com/~david/ , http://www.konqueror.org/
KDE 3.0: Konquering the Desktops

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

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

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