Changeset 29


Ignore:
Timestamp:
Nov 24, 2021, 7:34:57 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Use fgl and generics instead of contnrs and TObjectList.
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        66*.res
        77vCardStudio.exe
         8vCardStudio.dbg
  • trunk/Forms/UFormContact.pas

    r23 r29  
    8787var
    8888  FormContact: TFormContact;
     89
    8990
    9091implementation
  • trunk/Forms/UFormContacts.pas

    r23 r29  
    4343    FContacts: TContacts;
    4444    procedure SetContacts(AValue: TContacts);
    45 
    4645  public
    4746    property Contacts: TContacts read FContacts write SetContacts;
  • trunk/Forms/UFormFindDuplicity.pas

    r23 r29  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ExtCtrls, StdCtrls, ActnList, Menus, Contnrs, UContact;
     9  ExtCtrls, StdCtrls, ActnList, Menus, fgl, UContact;
    1010
    1111type
     
    2222  { TFoundItems }
    2323
    24   TFoundItems = class(TObjectList)
     24  TFoundItems = class(TFPGObjectList<TFoundItem>)
    2525    function SearchByField(Field: string): TFoundItem;
    2626  end;
     
    4747    FContacts: TContacts;
    4848    procedure SetContacts(AValue: TContacts);
    49 
    5049  public
    5150    FoundItems: TFoundItems;
     
    5958  FormFindDuplicity: TFormFindDuplicity;
    6059
     60
    6161implementation
    6262
     
    8989destructor TFoundItem.Destroy;
    9090begin
    91   Contacts.Free;
    92   inherited Destroy;
     91  FreeAndNil(Contacts);
     92  inherited;
    9393end;
    9494
     
    118118end;
    119119
    120 function FoundItemsSort(Item1, Item2: Pointer): Integer;
    121 begin
    122   if TFoundItem(Item1).Contacts.Count < TFoundItem(Item2).Contacts.Count then Result := 1
    123   else if TFoundItem(Item1).Contacts.Count > TFoundItem(Item2).Contacts.Count then Result := -1
     120function FoundItemsSort(const Item1, Item2: TFoundItem): Integer;
     121begin
     122  if Item1.Contacts.Count < Item2.Contacts.Count then Result := 1
     123  else if Item1.Contacts.Count > Item2.Contacts.Count then Result := -1
    124124  else Result := 0;
    125125end;
     
    206206procedure TFormFindDuplicity.FormDestroy(Sender: TObject);
    207207begin
    208   FoundItems.Free;
     208  FreeAndNil(FoundItems);
    209209end;
    210210
  • trunk/Forms/UFormGenerate.pas

    r23 r29  
    2121    procedure FormCreate(Sender: TObject);
    2222    procedure FormShow(Sender: TObject);
    23   private
    24 
    2523  public
    2624    Contacts: TContacts;
     
    3028var
    3129  FormGenerate: TFormGenerate;
     30
    3231
    3332implementation
  • trunk/Install/snap/snapcraft.yaml

    r26 r29  
    8888      - desktop
    8989      - x11
     90      - home
    9091
    9192layout:
  • trunk/UContact.pas

    r21 r29  
    66
    77uses
    8   Classes, SysUtils, Contnrs, Dialogs, UDataFile, LazUTF8, base64;
     8  Classes, SysUtils, fgl, Dialogs, UDataFile, LazUTF8, base64;
    99
    1010type
     
    3232  { TContactFields }
    3333
    34   TContactFields = class(TObjectList)
     34  TContactFields = class(TFPGObjectList<TContactField>)
    3535    function AddNew(Name: string; Index: TContactFieldIndex; DataType:
    3636      TDataType): TContactField;
     
    8686  { TContacts }
    8787
    88   TContacts = class(TObjectList)
     88  TContacts = class(TFPGObjectList<TContact>)
    8989    ContactsFile: TContactsFile;
    9090    function AddNew: TContact;
  • trunk/UCore.lfm

    r26 r29  
    501501    AppName = 'vCard Studio'
    502502    Description = 'vCard files management tool'
    503     ReleaseDate = 44427
     503    ReleaseDate = 44524
    504504    RegistryKey = '\Software\Chronosoft\vCard Studio'
    505505    RegistryRoot = rrKeyCurrentUser
  • trunk/UCore.pas

    r23 r29  
    9696
    9797uses
    98   UFormMain, UFormAbout, UFormSettings, UContact, UFormContacts, UFormFindDuplicity,
     98  UFormMain, UFormSettings, UContact, UFormContacts, UFormFindDuplicity,
    9999  UFormGenerate;
    100100
  • trunk/UDataFile.pas

    r3 r29  
    66
    77uses
    8   Classes, SysUtils, Contnrs;
     8  Classes, SysUtils, fgl;
    99
    1010type
     
    3333  TDataFileClass = class of TDataFile;
    3434
    35   TDataFiles = class(TObjectList)
     35  TDataFiles = class(TFPGObjectList<TDataFile>)
    3636  end;
    3737
  • trunk/vCardStudio.lpi

    r22 r29  
    197197      <Debugging>
    198198        <UseHeaptrc Value="True"/>
     199        <UseExternalDbgSyms Value="True"/>
    199200      </Debugging>
    200201      <Options>
  • trunk/vCardStudio.lpr

    r23 r29  
    2121begin
    2222  Application.Scaled:=True;
    23   Application.Title:='vCard Studio';
     23  Application.Title := 'vCard Studio';
    2424  {$if declared(UseHeapTrace)}
    2525  DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog);
Note: See TracChangeset for help on using the changeset viewer.