Changeset 63 for trunk/UContact.pas


Ignore:
Timestamp:
Dec 9, 2021, 11:17:22 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Open directory with saved split contact files in default file manager under Linux.
  • Fixed: Don't use forbidden characters in saved contact file name.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UContact.pas

    r61 r63  
    110110    Properties: TContactProperties;
    111111    Parent: TContactsFile;
     112    function FullNameToFileName: string;
    112113    function GetProperty(Field: TContactField): TContactProperty; overload;
    113114    function GetProperty(FieldIndex: TContactFieldIndex): TContactProperty; overload;
     
    728729end;
    729730
     731function TContact.FullNameToFileName: string;
     732var
     733  I: Integer;
     734begin
     735  Result := Fields[cfFullName];
     736  for I := 1 to Length(Result) do begin
     737    if Result[I] in [':', '/', '\', '.', '"', '*', '|', '?', '<', '>'] then
     738      Result[I] := '_';
     739  end;
     740end;
     741
    730742function TContact.GetProperty(Field: TContactField): TContactProperty;
    731743var
Note: See TracChangeset for help on using the changeset viewer.