Ignore:
Timestamp:
May 8, 2019, 11:54:23 AM (6 years ago)
Author:
chronos
Message:
  • Modified: Build under Lazarus 2.0.
  • Modified: Used .lrj files instead of .lrt files.
  • Modified: Removed TemplateGenerics package.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/ULastOpenedList.pas

    r4 r41  
    66
    77uses
    8   Classes, SysUtils, Registry, URegistry, Menus, XMLConf;
     8  Classes, SysUtils, Registry, URegistry, Menus, XMLConf, DOM;
    99
    1010type
     
    3030    procedure SaveToXMLConfig(XMLConfig: TXMLConfig; Path: string);
    3131    procedure AddItem(FileName: string);
     32    function GetFirstFileName: string;
    3233  published
    3334    property MaxCount: Integer read FMaxCount write SetMaxCount;
     
    139140    OpenKey(Context.Key, True);
    140141    for I := 0 to Items.Count - 1 do
    141       WriteString('File' + IntToStr(I), UTF8Decode(Items[I]));
     142      WriteString('File' + IntToStr(I), Items[I]);
    142143  finally
    143144    Free;
     
    153154begin
    154155  with XMLConfig do begin
    155     Count := GetValue(Path + '/Count', 0);
     156    Count := GetValue(DOMString(Path + '/Count'), 0);
    156157    if Count > MaxCount then Count := MaxCount;
    157158    Items.Clear;
    158159    for I := 0 to Count - 1 do begin
    159       Value := GetValue(Path + '/File' + IntToStr(I), '');
     160      Value := string(GetValue(DOMString(Path + '/File' + IntToStr(I)), ''));
    160161      if Trim(Value) <> '' then Items.Add(Value);
    161162    end;
     
    170171begin
    171172  with XMLConfig do begin
    172     SetValue(Path + '/Count', Items.Count);
     173    SetValue(DOMString(Path + '/Count'), Items.Count);
    173174    for I := 0 to Items.Count - 1 do
    174       SetValue(Path + '/File' + IntToStr(I), Items[I]);
     175      SetValue(DOMString(Path + '/File' + IntToStr(I)), DOMString(Items[I]));
    175176    Flush;
    176177  end;
     
    185186end;
    186187
     188function TLastOpenedList.GetFirstFileName: string;
     189begin
     190  if Items.Count > 0 then Result := Items[0]
     191    else Result := '';
     192end;
     193
    187194end.
    188195
Note: See TracChangeset for help on using the changeset viewer.