You've already forked lazarus-ccr
tvplanit: Fix ini datastore crashing when reading an old file.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5166 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -211,6 +211,9 @@ begin
|
|||||||
FFormatSettings.DateSeparator := '/';
|
FFormatSettings.DateSeparator := '/';
|
||||||
FFormatSettings.TimeSeparator := ':';
|
FFormatSettings.TimeSeparator := ':';
|
||||||
FDayBuffer := 1000*365; // 1000 years, i.e. deactivate daybuffer mechanism
|
FDayBuffer := 1000*365; // 1000 years, i.e. deactivate daybuffer mechanism
|
||||||
|
|
||||||
|
// For testing of compatibility:
|
||||||
|
// FIniVersionWrite := iv104;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TVpIniDatastore.Destroy;
|
destructor TVpIniDatastore.Destroy;
|
||||||
@ -224,10 +227,13 @@ var
|
|||||||
L: TVpIniStrings;
|
L: TVpIniStrings;
|
||||||
begin
|
begin
|
||||||
case FIniVersionWrite of
|
case FIniVersionWrite of
|
||||||
iv104: L := TVpIniStrings_v104.Create(@FFormatSettings);
|
iv104:
|
||||||
iv105: L := TVpIniStrings_v105.Create(@FFormatSettings);
|
L := TVpIniStrings_v104.Create(@FFormatSettings);
|
||||||
else raise Exception.CreateFmt('Writing of ini version "%s" not supported.',
|
iv105:
|
||||||
[GetEnumName(TypeInfo(TVpIniVersion), ord(FIniVersionWrite))]);
|
L := TVpIniStrings_v105.Create(@FFormatSettings);
|
||||||
|
else
|
||||||
|
raise Exception.CreateFmt('Writing of ini version "%s" not supported.',
|
||||||
|
[GetEnumName(TypeInfo(TVpIniVersion), ord(FIniVersionWrite))]);
|
||||||
end;
|
end;
|
||||||
try
|
try
|
||||||
L.AddField('FirstName', AContact.FirstName); // 0
|
L.AddField('FirstName', AContact.FirstName); // 0
|
||||||
@ -302,10 +308,13 @@ var
|
|||||||
L: TVpIniStrings;
|
L: TVpIniStrings;
|
||||||
begin
|
begin
|
||||||
case FIniVersionWrite of
|
case FIniVersionWrite of
|
||||||
iv104: L := TVpIniStrings_v104.Create(@FFormatSettings);
|
iv104:
|
||||||
iv105: L := TVpIniStrings_v105.Create(@FFormatSettings);
|
L := TVpIniStrings_v104.Create(@FFormatSettings);
|
||||||
else raise Exception.CreateFmt('Writing of ini version "%s" not supported.',
|
iv105:
|
||||||
[GetEnumName(TypeInfo(TVpIniVersion), ord(FIniVersionWrite))]);
|
L := TVpIniStrings_v105.Create(@FFormatSettings);
|
||||||
|
else
|
||||||
|
raise Exception.CreateFmt('Writing of ini version "%s" not supported.',
|
||||||
|
[GetEnumName(TypeInfo(TVpIniVersion), ord(FIniVersionWrite))]);
|
||||||
end;
|
end;
|
||||||
try
|
try
|
||||||
L.AddDateTimeField('StartTime', AEvent.StartTime, 'c'); // short date + long time
|
L.AddDateTimeField('StartTime', AEvent.StartTime, 'c'); // short date + long time
|
||||||
@ -375,10 +384,13 @@ var
|
|||||||
L: TVpIniStrings;
|
L: TVpIniStrings;
|
||||||
begin
|
begin
|
||||||
case FIniVersionWrite of
|
case FIniVersionWrite of
|
||||||
iv104: L := TVpIniStrings_v104.Create(@FFormatSettings);
|
iv104:
|
||||||
iv105: L := TVpIniStrings_v105.Create(@FFormatSettings);
|
L := TVpIniStrings_v104.Create(@FFormatSettings);
|
||||||
else raise Exception.CreateFmt('Writing of ini version "%s" not supported.',
|
iv105:
|
||||||
[GetEnumName(TypeInfo(TVpIniVersion), ord(FIniVersionWrite))]);
|
L := TVpIniStrings_v105.Create(@FFormatSettings);
|
||||||
|
else
|
||||||
|
raise Exception.CreateFmt('Writing of ini version "%s" not supported.',
|
||||||
|
[GetEnumName(TypeInfo(TVpIniVersion), ord(FIniVersionWrite))]);
|
||||||
end;
|
end;
|
||||||
try
|
try
|
||||||
L.AddField('Description', AResource.Description); // 0
|
L.AddField('Description', AResource.Description); // 0
|
||||||
@ -439,10 +451,13 @@ var
|
|||||||
L: TVpIniStrings;
|
L: TVpIniStrings;
|
||||||
begin
|
begin
|
||||||
case FIniVersionWrite of
|
case FIniVersionWrite of
|
||||||
iv104: L := TVpIniStrings_v104.Create(@FFormatSettings);
|
iv104:
|
||||||
iv105: L := TVpIniStrings_v105.Create(@FFormatSettings);
|
L := TVpIniStrings_v104.Create(@FFormatSettings);
|
||||||
else raise Exception.CreateFmt('Writing of ini version "%s" not supported.',
|
iv105:
|
||||||
[GetEnumName(TypeInfo(TVpIniVersion), ord(FIniVersionWrite))]);
|
L := TVpIniStrings_v105.Create(@FFormatSettings);
|
||||||
|
else
|
||||||
|
raise Exception.CreateFmt('Writing of ini version "%s" not supported.',
|
||||||
|
[GetEnumName(TypeInfo(TVpIniVersion), ord(FIniVersionWrite))]);
|
||||||
end;
|
end;
|
||||||
try
|
try
|
||||||
L.AddField('Complete', BoolToStr(ATask.Complete, strTRUE, strFALSE)); // 0
|
L.AddField('Complete', BoolToStr(ATask.Complete, strTRUE, strFALSE)); // 0
|
||||||
@ -778,7 +793,7 @@ begin
|
|||||||
AEvent.AlarmSet := StrToBool(L.Extract(8));
|
AEvent.AlarmSet := StrToBool(L.Extract(8));
|
||||||
AEvent.AlarmAdvance := StrToInt(L.Extract(9));
|
AEvent.AlarmAdvance := StrToInt(L.Extract(9));
|
||||||
AEvent.AlarmAdvanceType := TVpAlarmAdvType(GetEnumValue(TypeInfo(TVpAlarmAdvType), L.Extract(10)));
|
AEvent.AlarmAdvanceType := TVpAlarmAdvType(GetEnumValue(TypeInfo(TVpAlarmAdvType), L.Extract(10)));
|
||||||
AEvent.SnoozeTime := StrToTime(L[11]);
|
AEvent.SnoozeTime := StrToTime(L.Extract(11));
|
||||||
AEvent.RepeatCode := TVpRepeatType(GetEnumValue(TypeInfo(TVpRepeatType), L.Extract(12)));
|
AEvent.RepeatCode := TVpRepeatType(GetEnumValue(TypeInfo(TVpRepeatType), L.Extract(12)));
|
||||||
if L[13] = '' then
|
if L[13] = '' then
|
||||||
AEvent.RepeatRangeEnd := 0 else
|
AEvent.RepeatRangeEnd := 0 else
|
||||||
|
Reference in New Issue
Block a user