Ignore:
Timestamp:
Jan 20, 2025, 11:38:55 AM (42 hours ago)
Author:
chronos
Message:
  • Modified: Do not reference global Core object if possible.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormImportSource.pas

    r221 r227  
    4444    procedure FormShow(Sender: TObject);
    4545  public
     46    AcronymDb: TAcronymDb;
    4647    procedure UpdateInterface;
    4748    procedure Load(ImportSource: TImportSource);
     
    5556
    5657uses
    57   Core, FormImportFormat, FormCategorySelect;
     58  FormImportFormat, FormCategorySelect;
    5859
    5960{ TFormImportSource }
     
    7374        FormImportFormat.Save(NewImportFormat);
    7475        TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]).Assign(NewImportFormat);
    75         Core.Core.AcronymDb.Modified := True;
     76        AcronymDb.Modified := True;
    7677        ComboBox1.Items.Strings[ComboBox1.ItemIndex] := NewImportFormat.Name;
    7778      end;
     
    100101  FormCategorySelect := TFormCategorySelect.Create(Self);
    101102  try
     103    FormCategorySelect.AcronymDb := AcronymDb;
    102104    FormCategorySelect.Load(ListBox1.Items);
    103105    if FormCategorySelect.ShowModal = mrOk then begin
     
    136138  EditName.Text := ImportSource.Name;
    137139  EditURL.Text := ImportSource.URL;
    138   while ComboBox1.Items.Count > Core.Core.AcronymDb.ImportFormats.Count do
     140  while ComboBox1.Items.Count > AcronymDb.ImportFormats.Count do
    139141    ComboBox1.Items.Delete(ComboBox1.Items.Count - 1);
    140   while ComboBox1.Items.Count < Core.Core.AcronymDb.ImportFormats.Count do
     142  while ComboBox1.Items.Count < AcronymDb.ImportFormats.Count do
    141143    ComboBox1.Items.Add('');
    142   for I := 0 to Core.Core.AcronymDb.ImportFormats.Count - 1 do begin
    143     ComboBox1.Items[I] := TImportFormat(Core.Core.AcronymDb.ImportFormats[I]).Name;
    144     ComboBox1.Items.Objects[I] := Core.Core.AcronymDb.ImportFormats[I];
     144  for I := 0 to AcronymDb.ImportFormats.Count - 1 do begin
     145    ComboBox1.Items[I] := TImportFormat(AcronymDb.ImportFormats[I]).Name;
     146    ComboBox1.Items.Objects[I] := AcronymDb.ImportFormats[I];
    145147  end;
    146148  ComboBox1.ItemIndex := ComboBox1.Items.IndexOfObject(ImportSource.Format);
Note: See TracChangeset for help on using the changeset viewer.