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

List:       kde-devel
Subject:    Re: get all MIME types
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-04-24 21:10:50
[Download RAW message or body]

On Mon, Apr 24, 2000 at 10:55:47PM +0200, Daniel Naber wrote:
> Hi,
> 
> I need a list of all mime types but I don't want to parse a file. The API 
> documentation says KMimeType::allMimeTypes() is very memory consuming.
... compared to only getting one. This comment is there to prevent people
from using allMimeTypes and _then_ filtering the list. There are methods for this.

> Actually I only need the strings like "text/plain", not the KMimeTypes 
> objects. Any idea what's the right way to get this?

If you want them all, then it's find to use allMimeTypes, and to store
the names in a QStringList. The memory used by the mimetypes themselves
will be freed automatically (since KMimeType::Ptr is a KSharedPtr)

Out of interest, why do you want all mimetypes ?

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/
KDE, Making The Future of Computing Available Today
See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2

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

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