From fb05b9e95e18a259b3157a10c31709bfea937253 Mon Sep 17 00:00:00 2001 From: zhaosiyang Date: Tue, 27 Aug 2024 17:12:53 +0800 Subject: [PATCH] =?UTF-8?q?adding=20support=20for=20the=20=E2=80=9Cm4a?= =?UTF-8?q?=E2=80=9D=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/linux/kdialog_handler.dart | 2 +- lib/src/linux/qarma_and_zenity_handler.dart | 2 +- lib/src/windows/file_picker_windows.dart | 2 +- test/file_picker_windows_test.dart | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/linux/kdialog_handler.dart b/lib/src/linux/kdialog_handler.dart index 8d37c93f..978438cd 100644 --- a/lib/src/linux/kdialog_handler.dart +++ b/lib/src/linux/kdialog_handler.dart @@ -56,7 +56,7 @@ class KDialogHandler implements DialogHandler { case FileType.any: return ''; case FileType.audio: - return 'Audio File (${DialogHandler.toCaseInsensitive("*.aac *.midi *.mp3 *.ogg *.wav")})'; + return 'Audio File (${DialogHandler.toCaseInsensitive("*.aac *.midi *.mp3 *.ogg *.wav *.m4a")})'; case FileType.custom: return '${allowedExtensions!.map((ext) => ext.toUpperCase()).join(' File, ')} File (${DialogHandler.toCaseInsensitive("*.${allowedExtensions.join(' *.')}")})'; case FileType.image: diff --git a/lib/src/linux/qarma_and_zenity_handler.dart b/lib/src/linux/qarma_and_zenity_handler.dart index 03bcb736..f2518859 100644 --- a/lib/src/linux/qarma_and_zenity_handler.dart +++ b/lib/src/linux/qarma_and_zenity_handler.dart @@ -48,7 +48,7 @@ class QarmaAndZenityHandler implements DialogHandler { case FileType.any: return ''; case FileType.audio: - return "Audio Files | ${DialogHandler.toCaseInsensitive('*.aac *.midi *.mp3 *.ogg *.wav')}"; + return "Audio Files | ${DialogHandler.toCaseInsensitive('*.aac *.midi *.mp3 *.ogg *.wav *.m4a')}"; case FileType.custom: return "Custom Files | ${DialogHandler.toCaseInsensitive('*.${allowedExtensions!.join(' *.')}')}"; case FileType.image: diff --git a/lib/src/windows/file_picker_windows.dart b/lib/src/windows/file_picker_windows.dart index b4e8883e..2d19c916 100644 --- a/lib/src/windows/file_picker_windows.dart +++ b/lib/src/windows/file_picker_windows.dart @@ -218,7 +218,7 @@ class FilePickerWindows extends FilePicker { case FileType.any: return 'All Files (*.*)\x00*.*\x00\x00'; case FileType.audio: - return 'Audios (*.aac,*.midi,*.mp3,*.ogg,*.wav)\x00*.aac;*.midi;*.mp3;*.ogg;*.wav\x00\x00'; + return 'Audios (*.aac,*.midi,*.mp3,*.ogg,*.wav,*.m4a)\x00*.aac;*.midi;*.mp3;*.ogg;*.wav;*.m4a\x00\x00'; case FileType.custom: return 'Files (*.${allowedExtensions!.join(',*.')})\x00*.${allowedExtensions.join(';*.')}\x00\x00'; case FileType.image: diff --git a/test/file_picker_windows_test.dart b/test/file_picker_windows_test.dart index 4bde919f..acb1d744 100644 --- a/test/file_picker_windows_test.dart +++ b/test/file_picker_windows_test.dart @@ -23,7 +23,7 @@ void main() { expect( picker.fileTypeToFileFilter(FileType.audio, null), equals( - 'Audios (*.aac,*.midi,*.mp3,*.ogg,*.wav)\x00*.aac;*.midi;*.mp3;*.ogg;*.wav\x00\x00'), + 'Audios (*.aac,*.midi,*.mp3,*.ogg,*.wav,*.m4a)\x00*.aac;*.midi;*.mp3;*.ogg;*.wav;*.m4a\x00\x00'), ); expect(