From aa49666b280123dd20ea65ec9ef705a1bace053d Mon Sep 17 00:00:00 2001 From: vincents Date: Fri, 3 Dec 2004 14:35:30 +0000 Subject: [PATCH] implemented TIDEExceptions.LoadFromXMLConfig and SaveToXMLConfig git-svn-id: trunk@6329 - --- components/README.txt | 3 +++ debugger/debugger.pp | 30 ++++++++++++++++++++++++++++-- ide/debugmanager.pas | 5 +++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/components/README.txt b/components/README.txt index 42f09c1ecb..b2115f5181 100644 --- a/components/README.txt +++ b/components/README.txt @@ -8,6 +8,9 @@ codetools custom Obsolete: Use packages instead User defined components for the IDE + +fpcunit + template for a fpcunit gui test runner gtk GTK specific components diff --git a/debugger/debugger.pp b/debugger/debugger.pp index 0976bcc01a..f91cfed828 100644 --- a/debugger/debugger.pp +++ b/debugger/debugger.pp @@ -121,6 +121,7 @@ const XMLBreakPointsNode = 'BreakPoints'; XMLBreakPointGroupsNode = 'BreakPointGroups'; XMLWatchesNode = 'Watches'; + XMLExceptionsNode = 'Exceptions'; type EDebuggerException = class(Exception); @@ -3514,14 +3515,36 @@ end; procedure TIDEExceptions.LoadFromXMLConfig (const AXMLConfig: TXMLConfig; const APath: string); +var + NewCount: Integer; + i: Integer; + IDEException: TIDEException; begin - // TODO + Clear; + NewCount := AXMLConfig.GetValue(APath + 'Count', 0); + for i := 0 to NewCount-1 do + begin + IDEException := TIDEException(inherited Add('')); + IDEException.LoadFromXMLConfig(AXMLConfig, + Format('%sItem%d/', [APath, i + 1])); + end; end; procedure TIDEExceptions.SaveToXMLConfig (const AXMLConfig: TXMLConfig; const APath: string); +var + Cnt: Integer; + i: Integer; + IDEException: TIDEException; begin - // TODO + Cnt := Count; + AXMLConfig.SetDeleteValue(APath + 'Count', Cnt, 0); + for i := 0 to Cnt - 1 do + begin + IDEException := Items[i]; + IDEException.SaveToXMLConfig(AXMLConfig, + Format('%sItem%d/', [APath, i + 1])); + end; end; procedure TIDEExceptions.SetItem(const AIndex: Integer; @@ -3552,6 +3575,9 @@ finalization end. { ============================================================================= $Log$ + Revision 1.66 2004/12/03 14:35:30 vincents + implemented TIDEExceptions.LoadFromXMLConfig and SaveToXMLConfig + Revision 1.65 2004/11/23 12:25:47 vincents fixed fpc 1.0.x compilation diff --git a/ide/debugmanager.pas b/ide/debugmanager.pas index 03c9b6d1b2..250e389cc8 100644 --- a/ide/debugmanager.pas +++ b/ide/debugmanager.pas @@ -1495,6 +1495,7 @@ begin @Project1.LongenFilename, @FBreakPointGroups.GetGroupByName); FWatches.LoadFromXMLConfig(XMLConfig,'Debugging/'+XMLWatchesNode+'/'); + FExceptions.LoadFromXMLConfig(XMLConfig,'Debugging/'+XMLExceptionsNode+'/'); end; {------------------------------------------------------------------------------ @@ -1509,6 +1510,7 @@ begin FBreakPoints.SaveToXMLConfig(XMLConfig,'Debugging/'+XMLBreakPointsNode+'/', @Project1.ShortenFilename); FWatches.SaveToXMLConfig(XMLConfig,'Debugging/'+XMLWatchesNode+'/'); + FExceptions.SaveToXMLConfig(XMLConfig,'Debugging/'+XMLExceptionsNode+'/'); end; procedure TDebugManager.DoRestoreDebuggerMarks(AnUnitInfo: TUnitInfo); @@ -1941,6 +1943,9 @@ end. { ============================================================================= $Log$ + Revision 1.80 2004/12/03 14:35:30 vincents + implemented TIDEExceptions.LoadFromXMLConfig and SaveToXMLConfig + Revision 1.79 2004/11/24 08:18:13 mattias TTextStrings improvements (Exchange, Put), clean ups