[KPhotoAlbum] Patch: file type as subcategory of media type

Shawn Willden shawn-kimdaba at willden.org
Tue Feb 20 19:47:52 GMT 2007


On Tuesday 20 February 2007 12:01, Baptiste MATHUS wrote:
> 2007/2/20, Michael J Gruber:
> > A while ago I submitted a patch which implements file type subcategories:
> >
> > Extensions are converted to lower case, so "JPG" and "jpg" are the same,
> > but "jpeg" and "jpg" are not. I'm not sure if they should be.
>
> I guess they should (jpg, jpeg, jpe, like the gimp, for example).
> Maybe you could have a look at The Gimp to use the same extension
> groupings. See attached screenshot.

A better approach might be to use KDE's infrastructure to classify them by 
MIME type.  That would handle grouping of different extensions and would 
allow the user to manage the set of extensions that map to a particular group 
(in KControl, KDE Components->File Associations).  It would also take care of 
different extension cases, and it's even possible that KDE can use 
information other than file extension to identify MIME type, like the output 
of "file -i".

The only downside I can see is if you might want the extensions grouped 
differently in KPA than they are in the file association mappings.  For 
example, the "image/x-raw" type subsumes all known RAW images, and maybe you 
want your NEFs to be listed separately from your CR2s.

Poking throught the KDE libs documentation, I think you want to use 
KMimeType::findByPath() to get the KMimeType.  KMimeMagic looks slightly 
better (since it says it will examine the file if the extension doesn't 
provide enough info), but it is deprecated.

	Shawn.



More information about the Kphotoalbum mailing list