Changeset 129 for trunk/UCore.pas
- Timestamp:
- Apr 9, 2022, 11:52:13 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r127 r129 114 114 115 115 uses 116 UFormMain, UFormSettings, U Contact, UFormContacts, UFormFindDuplicity, UTest,116 UFormMain, UFormSettings, UVCard, UFormContacts, UFormFindDuplicity, UTest, 117 117 UFormGenerate, UFormError, UFormFind, UFormTest, UFormSource, UFormCompare, 118 UTestCases ;118 UTestCases, UVCardFile; 119 119 120 120 resourcestring … … 156 156 for I := 0 to OpenDialog1.Files.Count - 1 do begin 157 157 if FileExists(OpenDialog1.Files[I]) then begin 158 TempFile := T ContactsFile.Create;158 TempFile := TVCardFile.Create; 159 159 try 160 160 TempFile.LoadFromFile(OpenDialog1.Files[I]); 161 T ContactsFile(DataFile).Contacts.AddContacts(TContactsFile(TempFile).Contacts);161 TVCardFile(DataFile).VCard.Contacts.AddContacts(TVCardFile(TempFile).VCard.Contacts); 162 162 Inc(LoadedFiles); 163 163 finally … … 166 166 end; 167 167 end; 168 if LoadedFiles > 0 then T ContactsFile(DataFile).Modified := True;168 if LoadedFiles > 0 then TVCardFile(DataFile).Modified := True; 169 169 ShowMessage(Format(SCombinedContacts, [LoadedFiles])); 170 170 UpdateFile; … … 193 193 DirectorySeparator + 'Compare' + VCardFileExt; 194 194 ForceDirectories(ExtractFileDir(TempFileName)); 195 T ContactsFile(DataFile).SaveToFile(TempFileName);195 TVCardFile(DataFile).SaveToFile(TempFileName); 196 196 LoadFileLeft(TempFileName); 197 197 LoadFileRight(OpenDialog1.FileName); … … 226 226 if SelectDirectoryDialog1.Execute then begin 227 227 LastSplitDir := SelectDirectoryDialog1.FileName; 228 with T ContactsFile(DataFile).Contacts do228 with TVCardFile(DataFile).VCard.Contacts do 229 229 for I := 0 to Count - 1 do begin 230 230 if Items[I].Fields[cfFullName] <> '' then begin … … 253 253 with TFormFindDuplicity.Create(nil) do 254 254 try 255 Contacts := T ContactsFile(DataFile).Contacts;255 Contacts := TVCardFile(DataFile).VCard.Contacts; 256 256 ShowModal; 257 257 FormContacts.ReloadList; … … 266 266 with TFormFind.Create(nil) do 267 267 try 268 Contacts := T ContactsFile(DataFile).Contacts;268 Contacts := TVCardFile(DataFile).VCard.Contacts; 269 269 ShowModal; 270 270 FormContacts.ReloadList; … … 279 279 with TFormGenerate.Create(nil) do 280 280 try 281 Contacts := T ContactsFile(DataFile).Contacts;281 Contacts := TVCardFile(DataFile).VCard.Contacts; 282 282 if ShowModal = mrOk then begin 283 283 FormContacts.ReloadList; … … 298 298 procedure TCore.ARemoveExactDuplicatesExecute(Sender: TObject); 299 299 begin 300 T ContactsFile(DataFile).Contacts.RemoveExactDuplicates;300 TVCardFile(DataFile).VCard.Contacts.RemoveExactDuplicates; 301 301 UpdateFile; 302 302 end; … … 336 336 with TFormSource.Create(nil) do 337 337 try 338 Source := T ContactsFile(DataFile).AsString;338 Source := TVCardFile(DataFile).VCard.AsString; 339 339 if ShowModal = mrOk then begin 340 T ContactsFile(DataFile).AsString := Source;340 TVCardFile(DataFile).VCard.AsString := Source; 341 341 UpdateFile; 342 342 end; … … 423 423 424 424 DataFile := nil; 425 DefaultDataFileClass := T ContactsFile;425 DefaultDataFileClass := TVCardFile; 426 426 FileClosed := True; 427 427 RecentFileRegistryContext := TRegistryContext.Create(ApplicationInfo1.RegistryRoot, … … 504 504 DataFile := DefaultDataFileClass.Create; 505 505 DataFile.OnModify := FileModified; 506 T ContactsFile(DataFile).OnError := DoError;506 TVCardFile(DataFile).VCard.OnError := DoError; 507 507 end; 508 508 end; … … 514 514 if Assigned(FormContacts) then begin 515 515 if Assigned(DataFile) then 516 FormContacts.Contacts := T ContactsFile(DataFile).Contacts516 FormContacts.Contacts := TVCardFile(DataFile).VCard.Contacts 517 517 else FormContacts.Contacts := nil; 518 518 FormContacts.ReloadList;
Note:
See TracChangeset
for help on using the changeset viewer.