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

List:       kde-devel
Subject:    Re: KIO woes
From:       David Faure <faure () kde ! org>
Date:       2005-07-01 7:18:36
Message-ID: 200507010918.36766.faure () kde ! org
[Download RAW message or body]

On Friday 01 July 2005 00:32, Luke Sandell wrote:
> So far, everything is working as planned, except for one thing. For some 
> reason, Konqueror has problems working with files whose Mimetype cannot be 
> determined from their extension. For one, it does not show previews for them, 
> although it does show them when accessing the same files with file:///. For 
> their Mimetype it says "Unknown". Another problem is that they don't do 
> anything when I double-click them, except set the animated widget in motion. 
> Presumably, it is trying to determine their Mimetype so that it can figure 
> out what to use to open them. I have not overridden mimetype() in my 
> implementation, because I want it to determine the mimetype using a get(). I 
> verified using kioslavetest that the correct Mimetype is indeed being 
> returned for these files, and that the get() does indeed return the file 
> contents. Interestingly, if I choose Open With... from the context menu and 
> enter an application name, the application has no problem opening the file.

Pass UDS_MIMETYPE in listDir() results.

    KDE_struct_stat buff;
    if ( KDE_lstat( physicalPath_c, &buff ) == -1 ) {
        kdWarning() << "couldn't stat " << physicalPath << endl;
        return false;
    }

   KMimeType::Ptr mt = KMimeType::findByPath( physicalPath, buff.st_mode );
   addAtom( entry, KIO::UDS_MIME_TYPE, 0, mt->name() );

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

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