View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032069 | Lazarus | LCL | public | 2017-06-27 16:50 | 2018-01-07 04:19 |
Reporter | Chris Rorden | Assigned To | Dmitry Boyarintsev | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Platform | MacBook Retina | OS | Darwin | ||
Product Version | 1.9 (SVN) | ||||
Summary | 0032069: File filters should handle double extensions | ||||
Description | To maintain Delphi compatibility, the LCL should respect double extensions when provided as a filter by the user. Common examples of these files are tar files (.TAR.GZ / .TAR.BZ / .TAR.XZ), and ones specific to my field (neuroimaging) includes (.NII.GZ). If a user provides a filter of ".tar.gz' they are explicitly requesting something different from ".gz". The additional information provides a patch to replicate Delphi behavior. Typical, single extensions are unchanged, but double extensions are now handled correctly. | ||||
Steps To Reproduce | procedure TForm1.Button1Click(Sender: TObject); begin SaveDialog1.Filter := 'gz|*.gz|nii.gz|*.nii.gz|nii|*.nii|roi|*.roi'; SaveDialog1.Filename := 'SaveName'; SaveDialog1.FilterIndex:= 2; SaveDialog1.DefaultExt := '.roi'; if not SaveDialog1.Execute then exit; Caption := SaveDialog1.Filename; end; | ||||
Additional Information | Chriss-MacBook-Pro:include rorden$ diff filedialog.inc filedialogOld.inc 306,310c306 < //Filter := ExtractFileExt(Filter); < if (Pos('.',Filter) > 1) then //e.g. "*.nii.gz" < Delete(Filter, 1, Pos('.',Filter)-1) < else < Filter := ExtractFileExt(Filter); --- > Filter := ExtractFileExt(Filter); | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 56997 | ||||
LazTarget | - | ||||
Widgetset | Cocoa | ||||
Attached Files |
|
related to | 0032895 | closed | Dmitry Boyarintsev | Cocoa: TOpenDialog crashes if filter is empty |
related to | 0028687 | closed | Felipe Monteiro de Carvalho | Cocoa Feature Request: SaveDialog Filter |
|
Please create a proper patch. http://wiki.freepascal.org/Creating_A_Patch |
|
multiext.patch (632 bytes)
Index: lcl/include/filedialog.inc =================================================================== --- lcl/include/filedialog.inc (revision 56951) +++ lcl/include/filedialog.inc (working copy) @@ -308,7 +308,10 @@ //debugln('Filter now = ',filter); //Get the associated extension - Filter := ExtractFileExt(Filter); + if (Pos('.',Filter) > 1) then //e.g. "*.nii.gz" + Delete(Filter, 1, Pos('.',Filter)-1) + else + Filter := ExtractFileExt(Filter); //debugln('Filter now = ',filter); //if an extension at this point contains a wildcard, reject it if (Pos('?',Filter) > 0) or (Pos('*',Filter) > 0) then exit; |
|
please test and close if ok |
|
Tested - its fixed. Thanks. |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-06-27 16:50 | Chris Rorden | New Issue | |
2017-10-09 15:09 | Juha Manninen | Note Added: 0103282 | |
2017-10-09 17:16 | Juha Manninen | Note Edited: 0103282 | View Revisions |
2017-12-28 15:44 | Dmitry Boyarintsev | Assigned To | => Dmitry Boyarintsev |
2017-12-28 15:44 | Dmitry Boyarintsev | Status | new => assigned |
2017-12-28 15:44 | Dmitry Boyarintsev | Relationship added | related to 0032895 |
2018-01-04 15:34 | Chris Rorden | File Added: multiext.patch | |
2018-01-07 01:32 | Dmitry Boyarintsev | Relationship added | related to 0028687 |
2018-01-07 01:57 | Dmitry Boyarintsev | Fixed in Revision | => 56997 |
2018-01-07 01:57 | Dmitry Boyarintsev | LazTarget | => - |
2018-01-07 01:57 | Dmitry Boyarintsev | Note Added: 0105421 | |
2018-01-07 01:57 | Dmitry Boyarintsev | Status | assigned => resolved |
2018-01-07 01:57 | Dmitry Boyarintsev | Resolution | open => fixed |
2018-01-07 02:53 | Chris Rorden | Note Added: 0105422 | |
2018-01-07 04:19 | Dmitry Boyarintsev | Status | resolved => closed |