[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: File dialog filters
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2016-02-17 12:50:31
Message-ID: CACcA1RozCMV6WdwUp=bP43R0CyMaO0i068BFQv_B2fLRgMDCLg () mail ! gmail ! com
[Download RAW message or body]

On Tue, Feb 16, 2016 at 6:27 PM, Christian D=C3=A1vid <christian-david@web.=
de> wrote:
> Hi,
>
> I noticed that in KMyMoney the filter strings for file dialogs are create=
d "by
> hand", e.g. i18n("C++ sources (*.cpp *.cxx *.c++);;All files (*)"). So ea=
ch 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 translato=
rs
> and resulting in consistent translations for all mimetypes.
>
> Do we have a policy regarding this? Are there any drawbacks? Can it happe=
n
> 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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic