mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 09:19:14 +02:00
Patches from bug #17761 TShellListView Mask: duplicated items if mask is " *.ext;*.ext "
git-svn-id: trunk@30896 -
This commit is contained in:
parent
e14704beb2
commit
82427d006f
@ -38,7 +38,7 @@ uses
|
|||||||
LCLProc, Forms, Controls, GraphType, StringHashList, ButtonPanel,
|
LCLProc, Forms, Controls, GraphType, StringHashList, ButtonPanel,
|
||||||
Graphics, StdCtrls, Buttons, Menus, LCLType, ExtCtrls, LCLIntf,
|
Graphics, StdCtrls, Buttons, Menus, LCLType, ExtCtrls, LCLIntf,
|
||||||
Dialogs, Grids, EditBtn, PropertyStorage, TextTools, FrmSelectProps,
|
Dialogs, Grids, EditBtn, PropertyStorage, TextTools, FrmSelectProps,
|
||||||
StringsPropEditDlg, ColumnDlg, FileUtil, ObjInspStrConsts,
|
StringsPropEditDlg, ColumnDlg, FileUtil, FileCtrl, ObjInspStrConsts,
|
||||||
CollectionPropEditForm, PropEditUtils;
|
CollectionPropEditForm, PropEditUtils;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -6254,6 +6254,7 @@ begin
|
|||||||
RegisterPropertyEditor(TypeInfo(TComponent), nil, '', TComponentPropertyEditor);
|
RegisterPropertyEditor(TypeInfo(TComponent), nil, '', TComponentPropertyEditor);
|
||||||
RegisterPropertyEditor(TypeInfo(TCollection), nil, '', TCollectionPropertyEditor);
|
RegisterPropertyEditor(TypeInfo(TCollection), nil, '', TCollectionPropertyEditor);
|
||||||
RegisterPropertyEditor(TypeInfo(AnsiString), TFileDialog, 'Filter', TFileDlgFilterProperty);
|
RegisterPropertyEditor(TypeInfo(AnsiString), TFileDialog, 'Filter', TFileDlgFilterProperty);
|
||||||
|
RegisterPropertyEditor(TypeInfo(AnsiString), TFilterComboBox, 'Filter', TFileDlgFilterProperty);
|
||||||
RegisterPropertyEditor(TypeInfo(AnsiString), TFileNameEdit, 'Filter', TFileDlgFilterProperty);
|
RegisterPropertyEditor(TypeInfo(AnsiString), TFileNameEdit, 'Filter', TFileDlgFilterProperty);
|
||||||
RegisterPropertyEditor(TypeInfo(AnsiString), TCustomPropertyStorage, 'Filename', TFileNamePropertyEditor);
|
RegisterPropertyEditor(TypeInfo(AnsiString), TCustomPropertyStorage, 'Filename', TFileNamePropertyEditor);
|
||||||
RegisterPropertyEditor(TypeInfo(TAnchorSide), TControl, 'AnchorSideLeft', THiddenPropertyEditor);
|
RegisterPropertyEditor(TypeInfo(TAnchorSide), TControl, 'AnchorSideLeft', THiddenPropertyEditor);
|
||||||
|
@ -564,10 +564,11 @@ begin
|
|||||||
|
|
||||||
ParserState := 0;
|
ParserState := 0;
|
||||||
Position := 1;
|
Position := 1;
|
||||||
|
AFilter := AFilter + '|'; // to prevent ignoring of last filter
|
||||||
|
|
||||||
for i := 1 to Length(AFilter) do
|
for i := 1 to Length(AFilter) do
|
||||||
begin
|
begin
|
||||||
if Copy(AFilter, i, 1) = '|' then
|
if AFilter[i] = '|' then
|
||||||
begin
|
begin
|
||||||
case ParserState of
|
case ParserState of
|
||||||
0:
|
0:
|
||||||
|
@ -443,6 +443,7 @@ begin
|
|||||||
|
|
||||||
for i := 0 to MaskStrings.Count - 1 do
|
for i := 0 to MaskStrings.Count - 1 do
|
||||||
begin
|
begin
|
||||||
|
if MaskStrings.IndexOf(MaskStrings[i]) < i then Continue; // From patch from bug 17761: TShellListView Mask: duplicated items if mask is " *.ext;*.ext "
|
||||||
SearchStr := IncludeTrailingPathDelimiter(ABaseDir) + MaskStrings.Strings[i];
|
SearchStr := IncludeTrailingPathDelimiter(ABaseDir) + MaskStrings.Strings[i];
|
||||||
|
|
||||||
FindResult := FindFirstUTF8(SearchStr, faAnyFile, DirInfo);
|
FindResult := FindFirstUTF8(SearchStr, faAnyFile, DirInfo);
|
||||||
@ -478,6 +479,7 @@ begin
|
|||||||
// Mark if it is a directory (ObjectData <> nil)
|
// Mark if it is a directory (ObjectData <> nil)
|
||||||
if IsDirectory then ObjectData := AResult
|
if IsDirectory then ObjectData := AResult
|
||||||
else ObjectData := nil;
|
else ObjectData := nil;
|
||||||
|
if AResult.IndexOf(DirInfo.Name) < 0 then // From patch from bug 17761: TShellListView Mask: duplicated items if mask is " *.ext;*.ext "
|
||||||
AResult.AddObject(DirInfo.Name, ObjectData)
|
AResult.AddObject(DirInfo.Name, ObjectData)
|
||||||
end else
|
end else
|
||||||
Files.Add ( TFileItem.Create(DirInfo));
|
Files.Add ( TFileItem.Create(DirInfo));
|
||||||
@ -502,6 +504,8 @@ begin
|
|||||||
|
|
||||||
for i:=0 to Files.Count-1 do begin
|
for i:=0 to Files.Count-1 do begin
|
||||||
FileItem:=TFileItem(Files[i]);
|
FileItem:=TFileItem(Files[i]);
|
||||||
|
if (i > 0) and (TFileItem(Files[i]).Name = TFileItem(Files[i - 1]).Name) then
|
||||||
|
Continue; // cause Files is sorted // From patch from bug 17761: TShellListView Mask: duplicated items if mask is " *.ext;*.ext "
|
||||||
if FileItem.isFolder then
|
if FileItem.isFolder then
|
||||||
AResult.AddObject(FileItem.Name, ObjectData)
|
AResult.AddObject(FileItem.Name, ObjectData)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user