[PATCH] KMimeMagic.{cpp,h}

David Faure dfaure at klaralvdalens-datakonsult.se
Sun Feb 1 21:58:19 GMT 2004


On Saturday 31 January 2004 22:27, Otto Bruggeman wrote:
> Hi,
> 
> because of some diffs containing shitloads of crap before the actual contents 
> of which it can determine the mimetype, the 1 k limit is too small for me in 
> Kompare. I therefore added a new method called:
> 
> KMimeMagicResult* findFileTypeFromEntireFile( const QString & _filename );
> 
> Any limit might not be enough so i let it read in the entire file. This is a 
> first rough patch (which works for me) but i would like some feedback on how 
> to improve it and approval before i commit anything like this to CVS.

I don't like the multiplication of methods around this. Why not simply add an optional
argument (i.e. an overload for now, for BC reasons) to KMimeType::findFormatByFileContent() ?

KMimeMagic itself is deprecated (as public API), and should only be the backend
of the KMimeType call. This doesn't change much in terms of your patch,
except that a forwarder method should be added to KMimeType.

-- 
David Faure -- faure at kde.org, dfaure at klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions




More information about the kde-core-devel mailing list