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

List:       kde-devel
Subject:    Re: Redirection problem + How to get files in Sidebar?
From:       David Faure <david () mandrakesoft ! com>
Date:       2001-11-12 17:35:36
[Download RAW message or body]

On Lundi 12 Novembre 2001 18:15, Michael Goffioul wrote:
> > See the whole problem is that from an ioslave point-of-view is that there's
> > no difference between "listing the directory in the sidebar" and "listing
> > the directory in the iconview (or listview)".
> 
> I could manage to do what I want. Basically it relies on the fact that I
> can return different results when "listDir()" and "stat()". When my slave
> receives a "listDir()", it only returns directories so that they can be
> shown in the sidebar, but when "stat()" it returns a file on printer
> object with the mime type set to "text/html". But now I have to persuade
> konqueror to ask a "stat()" on a openURLRequest(). For that, the client
> (sidebar or iconview) shouldn't pass the serviceType as argument, konqueror
> will then stat the file to get its mimetype. This is possible in iconview
> if the KFileItem contain a mimeType and a guessedMimeType. So I simply have
> to add a fake UDS_GUESSED_MIME_TYPE in my entries on listDir().
> To make it finally work in the sidebar, the code of dirtree_item.cpp has to
> be changed a little bit such that externalMimeType() returns QString::null
> if KFileItem::isMimeTypeKnown() is false.

Wow, you digged up all the nasty tricks available in kio ;-)

[You're adding hacks (fake entry) to hacks (UDS_GUESSED_MIME_TYPE is already quite a hack :}]

> I attached a patch for the changes. Should I commit? (don't thing it breaks
> anything).

Looks good to me - although it would helpful to add a comment about the
fact that this effectively tests for the guessed_mimetype thing.
Usually isMimeTypeKnown is used in a case where the mimetype-determination
is delayed, which isn't the case in the dirtree. You're simply using the
code from isMimeTypeKnown to detect that the mimetype was guessed.

In fact......... a isMimeTypeGuessed() in KFileItem would be better IMHO,
to avoid mixing the two things. Can you add that instead and use that
in the dirtree ? It looks very strange if the dirtree calls isMimeTypeKnown
which is about delayed mimetype-determination :P

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