View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001304 | JEDI VCL | 00 JVCL Components | public | 2004-01-23 06:12 | 2004-03-09 02:47 |
| Reporter | anonymous | Assigned To | user72 | ||
| Priority | normal | Severity | block | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | |||||
| Target Version | Fixed in Version | ||||
| Summary | 0001304: TJvFormStorage/TJvAppIniFileStorage delete Sections | ||||
| Description | If I try to save the property "TComboBox.Items" all existing Sections will be deleted from the IniFile. Ingo | ||||
| Tags | No tags attached. | ||||
|
|
Hi Ingo, is it possible to get a little bit more on informations. Maybe an sample application. Greetings Jens |
|
2004-01-29 04:47
|
Storage.zip (3,284 bytes) |
|
|
Hi Jens, Seee the attached sample application. Open Test.ini and notice the three Sections: Section1,Section2 and Section3. They should be called by another application and never modified from Test.exe. -compile and run Test.exe. -notice the black shape -click btnSettings -click btnColor and change the color to red the ShapeColor in frmMain is now red -close the aplication -restart Test.exe - the ShapeColor is now red ok - till this point it works! Open Test.ini again and notice the three Sections: Section1,Section2 and Section3 - they are still there -now select SettingsStorage from Unit2 and include the property Combobox1.Items to the stored property's -compile and run Test.exe. Open Test.ini the Combobox1.Items are stored but all other sections are deleted! Greetings Ingo |
|
|
Seems to me that the problem is in TJvPropertyStorage.StoreStringsProperty and TJvPropertyStorage.LoadStringsProperty (in JvPropertyStorage.pas). I think we need to change the following (in both):
if Section <> '' then
SectName := Format('%s.%s', [Section, GetItemName(PropInfo^.Name)])
else
SectName := Format('%s', [GetItemName(PropInfo^.Name)]);
I haven't debugged it fully, but it seems AppStorage.OptimizePaths doesn't like the initial '.' in the section name |
|
|
Might want to take a quick look through the code to find any other property save/restore functions that exhibit the same problem. |
|
|
With the modified LoadStringsProperty/StoreStringsProperty it works now. There are a few other Format('%s.%s'... calls which maybe also make problems. Isn't it better to modify OptimizePaths to handle the initial '.'? This has the advantage that JVCL 2.x settings can be restored. Greetings Ingo |
|
|
Do you have an example of the old style ini files with sections containing dots? |
|
2004-01-30 00:21
|
Old_Ini.zip (2,159 bytes) |
|
|
I have uploaded an example which uses JVCL 2.x style settings. If you change [Main.Event_Items] to [MainEvent_Items] the Items can be restored. Note that TJvMRUManager still works with dots. Greetings Ingo |
|
|
OK, I've uploaded a fixed version that should be able to store items using the [Section.Component_Items] syntax. This also updates 0001312 edited on: 01-30-04 00:52 |
|
|
I just tested the OldIni project with the changes I've made and it seems to work OK. |
|
|
I have found another solution that might work better. |
|
|
Get the latest version from CVS and let me know if it works or not. The fix is in JvFormPlacement and JvPropertyStorage, JvAppStorage etc has been restored to their previous state |
|
|
I have tested the OldIni project with the latest version from CVS. The values for Event.Items and TJvMRUManager get restored and saved. Then I switched to a real project and...it doesn't work. Back in OldIni project I have made additional tests. The problem is in the Active property. To reproduce it - set JvFormStorage1.Active to false. Insert two manual calls to FormCreate/FormDestroy. procedure TfrmMain.FormCreate(Sender: TObject); begin JvFormStorage1.RestoreFormPlacement; end; procedure TfrmMain.FormDestroy(Sender: TObject); begin JvFormStorage1.SaveFormPlacement; end; Now you can see: Event.Items get restored/saved - but the recent list from TJvMRUManager doesn't. This also relate: Changed TJvFormPlacement behavior/Bug ID: 0001312 Greetings Ingo |
|
|
Seems to be caused by the JvMRUManager checking Storage.IsActive, which it shouldn't... I just tested changing all IniStorage.IsActive in JvMRUManager to Assigned(IniStorage) and that seems to solve it. edited on: 02-02-04 11:04 |
|
|
I've asked on the newsgroups if it's OK to change the behavior of JvRUManager (and other components using IsActive to initiate save/restore). If it's OK, I'll change it in a day or so. |
|
|
Seems to be working now |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2004-01-25 15:21 | jfudickar | Note Added: 0002828 | |
| 2004-01-27 23:23 |
|
Status | new => feedback |
| 2004-01-29 04:47 | anonymous | File Added: Storage.zip | |
| 2004-01-29 04:48 | anonymous | Note Added: 0002865 | |
| 2004-01-29 14:36 |
|
Note Added: 0002879 | |
| 2004-01-29 14:37 |
|
Note Added: 0002880 | |
| 2004-01-29 16:06 |
|
Status | feedback => assigned |
| 2004-01-29 16:06 |
|
Assigned To | => user72 |
| 2004-01-29 16:31 | Ingo | Note Added: 0002882 | |
| 2004-01-29 18:58 |
|
Note Added: 0002884 | |
| 2004-01-30 00:21 | Ingo | File Added: Old_Ini.zip | |
| 2004-01-30 00:21 | Ingo | Note Added: 0002890 | |
| 2004-01-30 00:56 |
|
Note Added: 0002891 | |
| 2004-01-30 00:57 |
|
Note Edited: 0002891 | |
| 2004-01-30 11:13 |
|
Note Added: 0002893 | |
| 2004-01-30 12:42 |
|
Note Added: 0002894 | |
| 2004-02-01 00:16 |
|
Note Added: 0002908 | |
| 2004-02-01 13:54 |
|
Status | assigned => feedback |
| 2004-02-01 15:26 | Ingo | Note Added: 0002921 | |
| 2004-02-02 11:07 |
|
Note Added: 0002924 | |
| 2004-02-02 11:10 |
|
Note Edited: 0002924 | |
| 2004-02-02 11:20 |
|
Note Added: 0002925 | |
| 2004-02-13 14:07 |
|
Status | feedback => resolved |
| 2004-02-13 14:07 |
|
Resolution | open => fixed |
| 2004-02-13 14:07 |
|
Note Added: 0002935 | |
| 2004-03-09 02:47 |
|
Status | resolved => closed |