IDE: Formatting.

git-svn-id: trunk@59258 -
This commit is contained in:
juha 2018-10-06 19:32:48 +00:00
parent 66d593c327
commit 38389bb56f
5 changed files with 14 additions and 22 deletions

View File

@ -1491,8 +1491,7 @@ var
AUnitName: String; AUnitName: String;
begin begin
if EnvironmentOptions.AmbiguousFileAction=afaIgnore then exit(mrOK); if EnvironmentOptions.AmbiguousFileAction=afaIgnore then exit(mrOK);
if EnvironmentOptions.AmbiguousFileAction if EnvironmentOptions.AmbiguousFileAction in [afaAsk,afaAutoDelete,afaAutoRename]
in [afaAsk,afaAutoDelete,afaAutoRename]
then begin then begin
ADirectory:=AppendPathDelim(ExtractFilePath(Filename)); ADirectory:=AppendPathDelim(ExtractFilePath(Filename));
if FindFirstUTF8(ADirectory+GetAllFilesMask,faAnyFile,FileInfo)=0 then if FindFirstUTF8(ADirectory+GetAllFilesMask,faAnyFile,FileInfo)=0 then

View File

@ -7688,8 +7688,7 @@ begin
end; end;
end; end;
function TMainIDE.DoBuildFile(ShowAbort: Boolean; Filename: string function TMainIDE.DoBuildFile(ShowAbort: Boolean; Filename: string): TModalResult;
): TModalResult;
var var
ActiveSrcEdit: TSourceEditor; ActiveSrcEdit: TSourceEditor;
ActiveUnitInfo: TUnitInfo; ActiveUnitInfo: TUnitInfo;

View File

@ -301,7 +301,7 @@ type
FUnitResourceFileformat: TUnitResourcefileFormatClass; FUnitResourceFileformat: TUnitResourcefileFormatClass;
function GetEditorInfo(Index: Integer): TUnitEditorInfo; function GetEditorInfo(Index: Integer): TUnitEditorInfo;
function GetHasResources:boolean; function GetHasResources: boolean;
function GetModified: boolean; function GetModified: boolean;
function GetNextAutoRevertLockedUnit: TUnitInfo; function GetNextAutoRevertLockedUnit: TUnitInfo;
function GetNextLoadedUnit: TUnitInfo; function GetNextLoadedUnit: TUnitInfo;

View File

@ -69,7 +69,7 @@ type
resFileName: String; resFileName: String;
lrsFileName: String; lrsFileName: String;
LastResFilename: String; LastResFileName: String;
LastLrsFileName: String; LastLrsFileName: String;
function GetProjectIcon: TProjectIcon; function GetProjectIcon: TProjectIcon;
@ -384,10 +384,8 @@ begin
begin begin
FModified := AValue; FModified := AValue;
if not FModified then if not FModified then
begin
for i := 0 to FResources.Count - 1 do for i := 0 to FResources.Count - 1 do
FResources[i].Modified := False; FResources[i].Modified := False;
end;
if Assigned(FOnModified) then if Assigned(FOnModified) then
OnModified(Self); OnModified(Self);
end; end;
@ -510,7 +508,8 @@ end;
function TProjectResources.Regenerate(const MainFileName: String; UpdateSource, function TProjectResources.Regenerate(const MainFileName: String; UpdateSource,
PerformSave: boolean; const SaveToTestDir: string): Boolean; PerformSave: boolean; const SaveToTestDir: string): Boolean;
begin begin
//DebugLn(['TProjectResources.Regenerate MainFilename=',MainFilename,' UpdateSource=',UpdateSource,' PerformSave=',PerformSave]); //DebugLn(['TProjectResources.Regenerate MainFilename=',MainFilename,
// ' UpdateSource=',UpdateSource,' PerformSave=',PerformSave]);
//DumpStack; //DumpStack;
Result := False; Result := False;
@ -518,7 +517,7 @@ begin
Exit(true); Exit(true);
// remember old codebuffer filenames // remember old codebuffer filenames
LastResFilename := resFileName; LastResFileName := resFileName;
LastLrsFileName := lrsFileName; LastLrsFileName := lrsFileName;
SetFileNames(MainFileName, SaveToTestDir); SetFileNames(MainFileName, SaveToTestDir);
@ -671,8 +670,7 @@ begin
if FLrsIncludeAllowed and HasLazarusResources then if FLrsIncludeAllowed and HasLazarusResources then
begin begin
//debugln(['TProjectResources.UpdateMainSourceFile include directive not found: FCanHaveLrsInclude=',FLrsIncludeAllowed,' HasLazarusResources=',HasLazarusResources]); //debugln(['TProjectResources.UpdateMainSourceFile include directive not found: FCanHaveLrsInclude=',FLrsIncludeAllowed,' HasLazarusResources=',HasLazarusResources]);
if not CodeToolBoss.AddIncludeDirectiveForInit(CodeBuf, if not CodeToolBoss.AddIncludeDirectiveForInit(CodeBuf,Filename,'') then
Filename,'') then
begin begin
Result := False; Result := False;
Messages.Add(Format(lisCouldNotAddIToMainSource, [Filename])); Messages.Add(Format(lisCouldNotAddIToMainSource, [Filename]));
@ -720,7 +718,7 @@ begin
if CodeBuf = nil then if CodeBuf = nil then
Exit; Exit;
LastResFilename := resFileName; LastResFileName := resFileName;
LastLrsFileName := lrsFileName; LastLrsFileName := lrsFileName;
try try
SetFileNames(CurFileName, ''); SetFileNames(CurFileName, '');
@ -850,7 +848,7 @@ procedure TProjectResources.DeleteLastCodeBuffers;
end; end;
begin begin
CleanCodeBuffer(LastResFilename, resFileName); CleanCodeBuffer(LastResFileName, resFileName);
CleanCodeBuffer(LastLrsFileName, lrsFileName); CleanCodeBuffer(LastLrsFileName, lrsFileName);
end; end;

View File

@ -126,16 +126,14 @@ end;
{ TResourceItem } { TResourceItem }
procedure TResourceItem.ReadFromProjectFile(AConfig: TXMLConfig; procedure TResourceItem.ReadFromProjectFile(AConfig: TXMLConfig; const Path: String);
const Path: String);
begin begin
FileName := AConfig.GetValue(Path + 'FileName', ''); FileName := AConfig.GetValue(Path + 'FileName', '');
ResType := StrToResourceType(AConfig.GetValue(Path + 'Type', '')); ResType := StrToResourceType(AConfig.GetValue(Path + 'Type', ''));
ResName := AConfig.GetValue(Path + 'ResourceName', ''); ResName := AConfig.GetValue(Path + 'ResourceName', '');
end; end;
procedure TResourceItem.WriteToProjectFile(AConfig: TXMLConfig; procedure TResourceItem.WriteToProjectFile(AConfig: TXMLConfig; const Path: String);
const Path: String);
begin begin
AConfig.SetValue(Path + 'FileName', FileName); AConfig.SetValue(Path + 'FileName', FileName);
AConfig.SetValue(Path + 'Type', ResourceTypeToStr[ResType]); AConfig.SetValue(Path + 'Type', ResourceTypeToStr[ResType]);
@ -256,8 +254,7 @@ begin
end; end;
end; end;
procedure TProjectUserResources.WriteToProjectFile(AConfig: TObject; procedure TProjectUserResources.WriteToProjectFile(AConfig: TObject; const Path: String);
const Path: String);
var var
I: Integer; I: Integer;
begin begin
@ -266,8 +263,7 @@ begin
List[I]^.WriteToProjectFile(TXMLConfig(AConfig), Path + 'General/Resources/Resource_' + IntToStr(I) + '/') List[I]^.WriteToProjectFile(TXMLConfig(AConfig), Path + 'General/Resources/Resource_' + IntToStr(I) + '/')
end; end;
procedure TProjectUserResources.ReadFromProjectFile(AConfig: TObject; procedure TProjectUserResources.ReadFromProjectFile(AConfig: TObject; const Path: String);
const Path: String);
var var
I, Count: Integer; I, Count: Integer;
begin begin