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

List:       kde-devel
Subject:    Re: Mimetypes from kioslave ignored?!
From:       David Faure <david () mandrakesoft ! com>
Date:       2001-03-25 12:55:04
[Download RAW message or body]

On Saturday 24 March 2001 18:57, Fritz Elfert wrote:
> Hi,
> 
> I've written a kioslave for accessing files on a Psion PDA using KDE 2.1.
> In my listDir() method, i return UDS-entries containing mimetypes for the
> proprietary file-formats on the psion. Of course, i also provide
> the corresponding entries in <mimedir>/application/<myMimeType> and
> the icons referenced there. I tried UDS_MIME_TYPE and UDS_GUESSED_MIME_TYPE,
> but konqueror does NOT show my mime-types and icons. As far as i can
> remember, with the old kde 2.0 libs this worked correctly. When i look
> into the various parts involved (kfileitem, kmime...) i noticed, that most
> of the mime-related stuff is disabled when dealing with non-local
> protocols. 

Ah, I see what broke this: the guessed_mimetype thingie for the FTP support.

Can you try this patch ?

Index: kfileitem.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kfileitem.cpp,v
retrieving revision 1.89
diff -u -p -r1.89 kfileitem.cpp
--- kfileitem.cpp       2001/02/10 12:58:21     1.89
+++ kfileitem.cpp       2001/03/25 12:52:53
@@ -92,6 +92,7 @@ KFileItem::KFileItem( const KIO::UDSEntr
 
         case KIO::UDS_MIME_TYPE:
           m_pMimeType = KMimeType::mimeType((*it).m_str);
+          d->bMimeTypeKnown = true;
           break;
 
         case KIO::UDS_GUESSED_MIME_TYPE:

> Also, lot of mime-type
> related stuff is bound to the file-mode (e.g. checks for S_ISDIR or instead
> of mimetype "inode/directory" which is also wrong in my case)

That's correct. Simply set S_IFDIR for directories. It's more of a convention
here, than anything related to local files.

> Another minor problem:
> In order to get a modified file-properties-dialog, i wrote a
> KPropsDlgPlugin which handles all Psion-specific stuff. I added a
> desktop file for that in <servicesdir>. Since the decicion of when to
> call the factory is done mime-type based, i had to enter it for all
> mimetypes:
> 
> ServiceTypes=KPropsDlg/Plugin,all/all
> 
> and thus delay the final decision to the supports() method of my
> dialog. It would be really helpful, if that could be enabled also
> using paths e.g. when the URL begins with some specified substring
> e.g. "psion:/"

It would. 
Feel free to send in a patch that adds a X-KDE-Protocol field in
the plugin's desktop files (adding the definition of this field
in the KPropsDlg/Plugin service-type file), and checking it in
kpropsdlg :)

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://perso.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
 
>> Visit http://master.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