View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002620 | JEDI VCL | 00 JVCL Components | public | 2005-02-10 13:57 | 2005-02-13 05:52 |
Reporter | remkobonte | Assigned To | obones | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.00 BETA 2 | ||||
Target Version | Fixed in Version | 3.00 | |||
Summary | 0002620: Run-time constructed AppStorage empties the storage. | ||||
Description | If you create an appstorage at run-time, don't reload it, then on destruction it will empty the storage. Code: with TJvAppXmlFileStorage.Create(nil) do try FileName := 'temp.xml'; finally Free; end; temp.xml will be filled with: <?xml version="1.0" encoding="iso-8859-1"?> <Configuration/> | ||||
Additional Information | * TJvCustomAppStorage.Loaded solves this for components dropped on a form by calling Reload (Loaded is offcourse not called for components created at run-time). I think when AutoReload is False, the component should NOT automatically load the storage in memory. procedure TJvCustomAppStorage.Loaded; begin inherited Loaded; if not IsUpdating then Reload; end; * TJvCustomAppMemoryFileStorage.SetFileName calls Reload when FLoadedFinished is set to true. I suspect the creator of that code wanted it to work the same as the csLoading flag, but for run-time created storages FLoadedFinished will always be false (because Loaded is never called). | ||||
Tags | No tags attached. | ||||
|
What if you replace this: if FLoadedFinished and not IsUpdating then by this: if not (csLoading in ComponentState) and not IsUpdating then In both SetFileName and SetLocation. I tried this here, it seems to work with both methods: Design time and Run time. |
|
Yeah, that probably works, although you have to set Location before FileName now at run-time. Any reason why these components do not have an Active property? |
|
This is now in CVS. Note that you don't have to set the properties in any particular order, as it will load the file in both cases, and do it silently if the file does not exist. As to getting an Active property, I don't see the point as it is all in memory after all. |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-02-10 13:57 | remkobonte | New Issue | |
2005-02-11 03:31 | obones | Status | new => assigned |
2005-02-11 03:31 | obones | Assigned To | => obones |
2005-02-12 09:31 | obones | Note Added: 0006472 | |
2005-02-12 09:31 | obones | Status | assigned => feedback |
2005-02-13 05:18 | remkobonte | Note Added: 0006477 | |
2005-02-13 05:52 | obones | Status | feedback => resolved |
2005-02-13 05:52 | obones | Fixed in Version | => 3.00 |
2005-02-13 05:52 | obones | Resolution | open => fixed |
2005-02-13 05:52 | obones | Note Added: 0006478 |