[Qt-creator] Plugins: two different editorplugins for the same mimetype

Friedemann Kleint Friedemann.Kleint at nokia.com
Fri Jan 15 09:32:37 CET 2010


Hi,

> > 1.) Where should the MagicMatcher::match() function normally
> > be called?
> > 2.) Is it correct to introduce two editors for the same
> > filetype and differentiate them by using the
> > MagicMatcher::match() function?

Qt Creator's mime database currently immediately returns if it finds a glob 
pattern match on the file name. The magic matchers are intended to be last-
resort rules when no matching extension can be found. This was done mainly for 
performance reasons; opening files should be avoided for quick checks (and it 
should ideally be possible to determine the type even if the file is not 
present). This is the approach taken for Qt Creator, how it relates to the 
Mime standard is another question.

Arguably, this could be special-cased for XML files to depend on the DTD, but 
there are currently no plans to do this.

So, I would recommend differentiating files by extension (taking into account 
that magic matchers are not supported by some desktop file managers as well).
At some point, a mime database class might be added to Qt which supports 
better matching algorithms.

Regards,
Friedemann

-- 
Friedemann Kleint
Nokia, Qt Development Frameworks



More information about the Qt-creator-old mailing list