From c55ff0fa0b7c5712c87fd831a049e09d84354cca Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Tue, 18 May 2021 17:27:40 +0300 Subject: [PATCH] Android: fix mimetype/namefilters handling for FileDialog Android file dialog uses setType() to set the main mimetype for the dialog if no mimetype or multiple (+1) mimetypes are provided, then the additional mimetypes can be provided via EXTRA_MIME_TYPES flag. The problem was that the mimetypes deduction from the namefilters was: * the namefilter used was empty, now we take the first item nameFilters(), because mimetypes cannot be changed once the dialog is open anyway. * The regex extraction was getting a namefilter ending with an empty char and that was giving a mimetype of any format thus making it show all possible files. Fixes: QTBUG-83089 Change-Id: Ifaef40c2186732ad3a604d28e086409c35dafacf Reviewed-by: Rami Potinkara Reviewed-by: Andy Shaw (cherry picked from commit ed431caa27672427d28f8ecde667a3a064ddda7e) Reviewed-by: Qt Cherry-pick Bot