mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:59:20 +02:00
Build profiles: Select a proper default profile when no profiles are saved.
git-svn-id: trunk@28729 -
This commit is contained in:
parent
dff89b431e
commit
3f8614f849
@ -176,7 +176,7 @@ type
|
|||||||
procedure Clear; override;
|
procedure Clear; override;
|
||||||
procedure Assign(Source: TBuildLazarusProfiles);
|
procedure Assign(Source: TBuildLazarusProfiles);
|
||||||
function IndexByName(AName: string): integer;
|
function IndexByName(AName: string): integer;
|
||||||
procedure CreateDefaults;
|
function CreateDefaults: integer;
|
||||||
procedure Load(XMLConfig: TXMLConfig; const Path: string; const FileVersion: integer);
|
procedure Load(XMLConfig: TXMLConfig; const Path: string; const FileVersion: integer);
|
||||||
procedure Save(XMLConfig: TXMLConfig; const Path: string);
|
procedure Save(XMLConfig: TXMLConfig; const Path: string);
|
||||||
procedure Move(CurIndex, NewIndex: Integer); // Replaces TList.Move
|
procedure Move(CurIndex, NewIndex: Integer); // Replaces TList.Move
|
||||||
@ -614,7 +614,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildLazarusProfiles.CreateDefaults;
|
function TBuildLazarusProfiles.CreateDefaults: integer;
|
||||||
|
// Create a set of default profiles when none are saved.
|
||||||
|
// Returns index for the default selected profile.
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
Profile: TBuildLazarusProfile;
|
Profile: TBuildLazarusProfile;
|
||||||
@ -676,7 +678,8 @@ begin
|
|||||||
else
|
else
|
||||||
fMakeModes[i]:=mmBuild;
|
fMakeModes[i]:=mmBuild;
|
||||||
end;
|
end;
|
||||||
Add(Profile);
|
// Return this one as default. Needed when building packages without saved profiles.
|
||||||
|
Result:=Add(Profile);
|
||||||
|
|
||||||
// Clean Up + Build all
|
// Clean Up + Build all
|
||||||
Profile:=TBuildLazarusProfile.Create(Self, lisLazBuildQBOCleanUpBuildAll);
|
Profile:=TBuildLazarusProfile.Create(Self, lisLazBuildQBOCleanUpBuildAll);
|
||||||
@ -718,10 +721,8 @@ begin
|
|||||||
// Latest config file version.
|
// Latest config file version.
|
||||||
2: begin
|
2: begin
|
||||||
ProfCount:=XMLConfig.GetValue(Path+'Profiles/Count',0);
|
ProfCount:=XMLConfig.GetValue(Path+'Profiles/Count',0);
|
||||||
if ProfCount = 0 then begin
|
if ProfCount = 0 then
|
||||||
CreateDefaults; // No saved profiles were found, use defaults.
|
ProfInd:=CreateDefaults // No saved profiles were found, use defaults.
|
||||||
ProfInd:=0;
|
|
||||||
end
|
|
||||||
else begin
|
else begin
|
||||||
// Load list of profiles.
|
// Load list of profiles.
|
||||||
for i:=0 to ProfCount-1 do begin
|
for i:=0 to ProfCount-1 do begin
|
||||||
@ -738,11 +739,9 @@ begin
|
|||||||
FConfirmBuild :=XMLConfig.GetValue(Path+'ConfirmBuild/Value',true);
|
FConfirmBuild :=XMLConfig.GetValue(Path+'ConfirmBuild/Value',true);
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
// A missing (or invalid) config file.
|
// Invalid config file.
|
||||||
else begin
|
else
|
||||||
CreateDefaults;
|
ProfInd:=CreateDefaults;
|
||||||
ProfInd:=0;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
// Load defines, selected profiles and auto install packages.
|
// Load defines, selected profiles and auto install packages.
|
||||||
LoadStringList(XMLConfig,fAllDefines,Path+'AllDefines/');
|
LoadStringList(XMLConfig,fAllDefines,Path+'AllDefines/');
|
||||||
|
Loading…
Reference in New Issue
Block a user