IDE: fixed loading IDE build profiles for version>=3

git-svn-id: trunk@38527 -
This commit is contained in:
mattias 2012-09-05 13:01:39 +00:00
parent 809e0969e4
commit c5c9d45cc0

View File

@ -426,9 +426,13 @@ var
Profile: TBuildLazarusProfile;
begin
Clear;
case FileVersion of
if FileVersion<1 then
begin
// Invalid config file.
ProfInd:=CreateDefaults;
end else if FileVersion=1 then
begin
// Older config file version.
1: begin
CreateDefaults; // Only one profile saved, create defaults always.
// Then create MyProfile.
Profile:=TBuildLazarusProfile.Create(Self, 'MyProfile');
@ -437,9 +441,8 @@ begin
FRestartAfterBuild:=XMLConfig.GetValue(Path+'RestartAfterBuild/Value',true);
FConfirmBuild :=XMLConfig.GetValue(Path+'ConfirmBuild/Value',true);
ProfInd:=Count-1; // Go to last MyProfile.
end;
end else begin
// Latest config file version.
2: begin
ProfCount:=XMLConfig.GetValue(Path+'Profiles/Count',0);
if ProfCount = 0 then
ProfInd:=CreateDefaults // No saved profiles were found, use defaults.
@ -459,10 +462,6 @@ begin
FConfirmBuild :=XMLConfig.GetValue(Path+'ConfirmBuild/Value',true);
end
end;
// Invalid config file.
else
ProfInd:=CreateDefaults;
end;
// Load defines, selected profiles and auto install packages.
LoadStringList(XMLConfig,fAllDefines,Path+'AllDefines/');
LoadStringList(XMLConfig,fSelected,Path+'SelectedProfiles/');