On Tue, Feb 16, 2016 at 6:27 PM, Christian Dávid <christian-da...@web.de> wrote:
> Hi,
>
> I noticed that in KMyMoney the filter strings for file dialogs are created "by
> hand", e.g. i18n("C++ sources (*.cpp *.cxx *.c++);;All files (*)"). So each of
> them must be translated. Alternatively something like
>
> QMimeDatabase db;
> db.mimeTypeForName("text/x-c++src").filterString()
>
> could be used to create these string lowering the burden on the translators
> and resulting in consistent translations for all mimetypes.
>
> Do we have a policy regarding this? Are there any drawbacks? Can it happen
> that the mimetype database does not include all files on some systems?
>
> I know there is QFileDialog::setMimeTypeFilters() where the mimetype can be
> set directly, but this does not work with the static functions.

That's exactly what ends up happening when you call your QFileDialog
with setMimeTypeFilters, the filters will be constructed out of
QMimeType.

Aleix

Reply via email to