View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004014 | JEDI VCL | 03 Donations | public | 2006-12-08 08:45 | 2006-12-17 14:45 |
Reporter | wesson | Assigned To | jfudickar | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | ||||
Summary | 0004014: Fix incomplete storage of collections | ||||
Description | Collections are also persistent objects. when they are saved/loaded inside a tree of persistent/collections objects, only their "collection" part is saved, and not the "persistent" part. For instance, if a collection contains a published property published property MyTagToSave: Integer read FyMyTagToSave write SetMyTagToSave; it'll not be saved. My proposal is to Add in ReadCollection/WriteCollection a ReadPersistent/WritePersistent inside | ||||
Additional Information | Proposed code: function TJvCustomAppStorage.ReadCollection(const Path: string; List: TCollection; const ClearFirst: Boolean = True; const ItemName: string = cItem): Integer; begin if not ListStored(Path) and StorageOptions.DefaultIfValueNotExists then Result := List.Count else try List.BeginUpdate; if ClearFirst then List.Clear; ReadPersistent(Path,List,True,False); // Collection is also a persistent Result := ReadList(Path, List, ReadCollectionItem, ItemName); finally List.EndUpdate; end; end; procedure TJvCustomAppStorage.WriteCollection(const Path: string; List: TCollection; const ItemName: string = cItem); begin WriteList(Path, List, List.Count, WriteCollectionItem, DeleteCollectionItem, ItemName); WritePersistent(Path,List); // Collection is also a persistent ... end; | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2006-12-08 08:45 | wesson | New Issue | |
2006-12-08 08:45 | wesson | File Added: JvAppStorage.rar | |
2006-12-13 10:49 | jfudickar | Status | new => assigned |
2006-12-13 10:49 | jfudickar | Assigned To | => jfudickar |
2006-12-17 14:45 | jfudickar | Status | assigned => resolved |
2006-12-17 14:45 | jfudickar | Resolution | open => fixed |
2006-12-17 14:45 | jfudickar | Note Added: 0010466 |