Changeset 56 for trunk/UAcronym.pas


Ignore:
Timestamp:
Jul 26, 2016, 2:13:41 PM (8 years ago)
Author:
chronos
Message:
  • Added: Show how many new acronyms were imported.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UAcronym.pas

    r52 r56  
    216216    ImportFormats: TImportFormats;
    217217    Modified: Boolean;
     218    AddedCount: Integer;
    218219    constructor Create;
    219220    destructor Destroy; override;
     
    250251  SRemoveOnStart = 'Remove on start';
    251252  SUnsupportedAuthMethod = 'Unsupported HTTP authorization method';
     253  SFileNotFound = 'File %s not found';
    252254
    253255
     
    323325      NewAcronym.Name := SQLQuery1.FieldByName('Acronym').AsString;
    324326      NewAcronym.Meaning := SQLQuery1.FieldByName('Meaning').AsString;
    325       Sources.AcronymDb.AddAcronym(NewAcronym.Name, NewAcronym.Meaning);
     327      if (NewAcronym.Name <> '') and (NewAcronym.Meaning <> '') then
     328        Sources.AcronymDb.AddAcronym(NewAcronym.Name, NewAcronym.Meaning);
    326329      SQLQuery1.Next;
    327330      Inc(ItemCount);
     
    489492          Delete(S, 1, P + Length(EndString) - 1);
    490493
    491           if (Flag = ipfNewItem) and (Trim(NewAcronym.Name) <> '') and
    492             (Trim(NewAcronym.Meaning) <> '') then begin
     494          if (Flag = ipfNewItem) and (NewAcronym.Name <> '') and
     495            (NewAcronym.Meaning <> '') then begin
    493496              AddedAcronym := Sources.AcronymDb.AddAcronym(NewAcronym.Name, NewAcronym.Meaning);
    494497              AddedAcronym.Description := NewAcronym.Description;
     
    749752      S.Free;
    750753    end;
    751   end else ShowMessage('File ' + URL + ' not found');
     754  end else ShowMessage(SysUtils.Format(SFileNotFound, [URL]));
    752755end;
    753756
     
    823826begin
    824827  Categories := TStringList.Create;
     828  Name := '';
     829  Meaning := '';
     830  Description := '';
    825831end;
    826832
     
    14321438    Meaning.Acronym := Acronym;
    14331439    Acronym.Meanings.Add(Meaning);
     1440    Inc(AddedCount);
    14341441  end;
    14351442  Result := Meaning;
Note: See TracChangeset for help on using the changeset viewer.