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

List:       koffice
Subject:    RE: More then one Mimetype
From:       Michael Koch <m_koch () bigfoot ! de>
Date:       1999-11-08 10:59:28
[Download RAW message or body]

Am Mon, 08 Nov 1999 schrieb David Faure:
> > -----Original Message-----
> > From: Michael Koch [mailto:m_koch@bigfoot.de]
> > Sent: Monday, November 08, 1999 7:26 AM
> > To: koffice@master.kde.org
> > Subject: Re: More then one Mimetype
> > 
> > 
> > Am Mon, 08 Nov 1999 schrieb David Faure:
> > > On Sun, Nov 07, 1999 at 08:26:07PM +0100, Michael Koch wrote:
> > > > Hi all, hi David, hi Torben, hi Reggie, hi Simon
> > > > (don't know who can help me)
> > > > 
> > > > 
> > > > Currently I'm hacking KImage to be Kanossa-friendly,  ;-)
> > > > I can load several types of images, BMP, JPEG, ...
> > > > 
> > > > But everytime, I load a file unequal to my default 
> > mimetype I get an error box
> > > > "Could not import file of type image/jpeg". How do I have 
> > to do that ? How can
> > > > I code it the right way ? No hacks anymore.
> > > That's because when you try to open something that is not 
> > of your default
> > > mimetype, it tries to run a filter...
> > > 
> > > KImage is the only app that doesn't need an external filter 
> > for loading
> > > other mimetypes than his.
> > > 
> > > Hmm, don't know what the solution is though
> > 
> > Ok. I overloaded KoMainWindow::slotFileOpen but I don't bleliev it is
> > implemented correctly. David, can you look at it (in 
> > kimage_shell.cc) ???
> 
> On the whole, it looks good.
> I think it's the way to go.
> 
> I'm wondering about :
> KMimeMagic *mimemagic = KMimeMagic::self();
> KMimeMagicResult *result = mimemagic->findFileType( file );
> 
> Why not use KMimeType::findByURL ?
> The difference is : whether you trust extensions or not :)
> (because findByURL calls KMimeMagic only if it couldn't understand the
> extension)
> But OTOH I don't know if KMimeMagic is 100% reliable for all image file
> types.
> (It is usually a fallback only)

Ok, I have ported it to KMimeType::findByURL(). I thought the wrong way before.
 
> Why did you say "I don't believe it's implemented correctly" ?
> Does it work ?

YEs it works, but I don't like this "QString filter ....."-line. It's so
....... hacky. There can be *gif and *.GIF for image/gif, etc.
I would like a way to add extensions automatically from the Mimetype-db.
(or something else). There schould appear all extensions the user want for a
special Mimetype.


Ciao,
Michael

-- 
Michael Koch


KDE fan, enthusiast and developer

koch@kde.org
m_koch@bigfoot.de
mkoch@mandrakesoft.com
mkoch@heaven.riednet.wh.tu-darmstadt.de

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

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