[Qt5-feedback] Fwd: QMimeType

Иван Комиссаров abbapoh at gmail.com
Sun Jun 5 15:36:58 CEST 2011


// Forwarding private letters so others can take part in discussion.

Начало переадресованного сообщения:

От: Иван Комиссаров <abbapoh at gmail.com>
Дата: 5 июня 2011 г. 12:02:48 Московское летнее время
Кому: David Faure <faure at kde.org>
Тема: Ответ: QMimeType

Hi.

I don't think it is good idea to start refactoring code again. In fact, it seems i only have problem with mimetypes with same extension, however i know the way to fix it and it won't take lot of time. I also have lot of tests and i'm working for 100% coverage of them. Not sure, but i hope data search is correct now.

Also, some parts of KDE mime should be entirely rewritten - for example i don't think it is good idea to recreate mime type from file each time we call KMimeTypeRepository::findMimeTypeByName function.

Besides, you need do same refactoring as i already done - removing most shared pointers to classes, reducing number of interfaces, making code more readable (this part is not so important for you as was for me:) )

About functionality - i plan to store mimedatabase bot in binary format (for faster loading) and xml (to allow user create own mimetypes/overwrite standard one from database). KDE's classes work only with xml with separate files and it should be rewritten.

So, i think there is same amout of work with both classes (you need to rewrite some algorithms, i need to cover all tests).

I will be very pleased if you help me with test coverage - every test makes shows how little i know about mimetypes:)

Sorry for my english.

Ivan.

05.06.2011, в 4:09, David Faure написал(а):

Hello,

I saw the stuff at https://gitorious.org/qmime/qmime/blobs/master/src/
and I would really like to work together with you on mimetype support in Qt,
since I wrote the KDE implementation of the shared-mime-info system.

You wrote on the qt5-feedback list (which I just registered to, so I can't 
reply to the earlier mails there) that the featureset is the same as the 
qtcreator code -- that is possible, but the KDE implementation is much more 
mature. It has been extensively unittested and has been used by many many 
users over a number of years, with all sorts of files :-)
I think it would be a bit of a waste of time to reimplement all of this (I see 
a number of "hack" and "todo" comments in the qtcreator mime code, it's 
obviously not at the same quality level).
For instance findByFile doesn't implement handling of conflicting globs, and 
many other things from the shared-mime-info standard.

I would be happy to work with you on extracting the mimetype implementation 
from KDE and making the API more Qt-like.

I'm at a KDE meeting for another few days, but maybe I can find some time after 
that for extracting the code, and putting it in a separate repository for 
adaptation to Qt. Or if you have time I'm happy to let you start it and I can 
provide input if necessary :-)

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt5-feedback/attachments/20110605/6a22c76c/attachment.html 


More information about the Qt5-feedback mailing list