Changeset 38 for trunk/Components/Common/ULastOpenedList.pas
- Timestamp:
- Apr 18, 2019, 3:34:38 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Components/Common/ULastOpenedList.pas
r34 r38 6 6 7 7 uses 8 Classes, SysUtils, Registry, URegistry, Menus, XMLConf ;8 Classes, SysUtils, Registry, URegistry, Menus, XMLConf, DOM; 9 9 10 10 type … … 30 30 procedure SaveToXMLConfig(XMLConfig: TXMLConfig; Path: string); 31 31 procedure AddItem(FileName: string); 32 function GetFirstFileName: string; 32 33 published 33 34 property MaxCount: Integer read FMaxCount write SetMaxCount; … … 139 140 OpenKey(Context.Key, True); 140 141 for I := 0 to Items.Count - 1 do 141 WriteString('File' + IntToStr(I), UTF8Decode(Items[I]));142 WriteString('File' + IntToStr(I), Items[I]); 142 143 finally 143 144 Free; … … 153 154 begin 154 155 with XMLConfig do begin 155 Count := GetValue( Path + '/Count', 0);156 Count := GetValue(DOMString(Path + '/Count'), 0); 156 157 if Count > MaxCount then Count := MaxCount; 157 158 Items.Clear; 158 159 for I := 0 to Count - 1 do begin 159 Value := GetValue(Path + '/File' + IntToStr(I), '');160 Value := string(GetValue(DOMString(Path + '/File' + IntToStr(I)), '')); 160 161 if Trim(Value) <> '' then Items.Add(Value); 161 162 end; … … 170 171 begin 171 172 with XMLConfig do begin 172 SetValue( Path + '/Count', Items.Count);173 SetValue(DOMString(Path + '/Count'), Items.Count); 173 174 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])); 175 176 Flush; 176 177 end; … … 185 186 end; 186 187 188 function TLastOpenedList.GetFirstFileName: string; 189 begin 190 if Items.Count > 0 then Result := Items[0] 191 else Result := ''; 192 end; 193 187 194 end. 188 195
Note:
See TracChangeset
for help on using the changeset viewer.