speeding up KFind

Andras Mantia amantia at freemail.hu
Mon May 26 21:29:17 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 26 May 2003 16:57, Daniel Naber wrote:
> On Tuesday 27 May 2003 01:53, Andras Mantia wrote:
> > Take a look at quanta/quantacommon.cpp,
> > checkMimeGroup(const KURL& url, const QString& group).
> >
> > The important part is the KMimeType::findFormatByFileContent call.
>
> It works, but I suggest the documentation is extended so that it mentions
> how it works. It seems to use some heuristics.
Actually the code was written by Waldo, but I didn't find it hard to 
understand. The file is text if:
- - it belongs to text/*
- - if the mimetype definition has the X-KDE-Text boolean property, and it's 
true, and the file is node an inode/*

The heuristics are in the KMimeType::findByFileContent(), which guesses the 
mimetype for the file.

In addition another flag is set to not if the file is a compressed text file 
or not.

> Some PDF files are
> considered text, some are not.
application/pdf seems to be not considered text file (accroding to the 
pdf.desktop). The problem may be that sometimes findByFileContent() says it's 
application/pdf, other times it says it is text/something. Can this be a bug 
in KMimeType?

Andras
 
>
> Regards
>  Daniel

- -- 
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+1EDmTQdfac6L/08RArtAAKDCpa14836GSgEQBij+zSjTfnwrqwCgtd7Z
/yshVpoUGXdstR447F5p6C8=
=T6bI
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list