mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 05:59:28 +02:00
--- Merging r30260 into '.':
U packages/fcl-json/src/jsonconf.pp --- Recording mergeinfo for merge of r30260 into '.': U . --- Merging r30294 into '.': U packages/fcl-res/src/versionresource.pp --- Recording mergeinfo for merge of r30294 into '.': G . --- Merging r30303 into '.': U packages/fcl-process/src/simpleipc.pp --- Recording mergeinfo for merge of r30303 into '.': G . --- Merging r30304 into '.': U packages/fcl-process/src/unix/simpleipc.inc --- Recording mergeinfo for merge of r30304 into '.': G . # revisions: 30260,30294,30303,30304 git-svn-id: branches/fixes_3_0@31111 -
This commit is contained in:
parent
a8ab6208f9
commit
2b6c1e12fc
@ -73,6 +73,7 @@ type
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
Procedure Reload;
|
||||
procedure Clear;
|
||||
procedure Flush; // Writes the JSON file
|
||||
procedure OpenKey(const aPath: WideString; AllowCreate : Boolean);
|
||||
@ -528,11 +529,16 @@ begin
|
||||
DeletePath(APath);
|
||||
end;
|
||||
|
||||
Procedure TJSONConfig.Reload;
|
||||
|
||||
begin
|
||||
if Length(Filename) > 0 then
|
||||
DoSetFilename(Filename,True);
|
||||
end;
|
||||
procedure TJSONConfig.Loaded;
|
||||
begin
|
||||
inherited Loaded;
|
||||
if Length(Filename) > 0 then
|
||||
DoSetFilename(Filename,True);
|
||||
Reload;
|
||||
end;
|
||||
|
||||
function TJSONConfig.FindPath(const APath: WideString; AllowCreate: Boolean
|
||||
|
@ -76,6 +76,7 @@ Type
|
||||
Procedure CheckActive;
|
||||
Procedure Activate; virtual; abstract;
|
||||
Procedure Deactivate; virtual; abstract;
|
||||
Procedure Loaded; override;
|
||||
Property Busy : Boolean Read FBusy;
|
||||
Published
|
||||
Property Active : Boolean Read FActive Write SetActive;
|
||||
@ -238,24 +239,29 @@ end;
|
||||
|
||||
procedure TSimpleIPC.CheckInactive;
|
||||
begin
|
||||
If Active then
|
||||
DoError(SErrActive,[]);
|
||||
if not (csLoading in ComponentState) then
|
||||
If Active then
|
||||
DoError(SErrActive,[]);
|
||||
end;
|
||||
|
||||
procedure TSimpleIPC.CheckActive;
|
||||
begin
|
||||
If Not Active then
|
||||
DoError(SErrInActive,[]);
|
||||
if not (csLoading in ComponentState) then
|
||||
If Not Active then
|
||||
DoError(SErrInActive,[]);
|
||||
end;
|
||||
|
||||
procedure TSimpleIPC.SetActive(const AValue: Boolean);
|
||||
begin
|
||||
if (FActive<>AValue) then
|
||||
begin
|
||||
If AValue then
|
||||
Activate
|
||||
else
|
||||
Deactivate;
|
||||
if (csLoading in ComponentState) then
|
||||
FActive:=AValue
|
||||
else
|
||||
If AValue then
|
||||
Activate
|
||||
else
|
||||
Deactivate;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -268,6 +274,20 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
Procedure TSimpleIPC.Loaded;
|
||||
|
||||
Var
|
||||
B : Boolean;
|
||||
|
||||
begin
|
||||
B:=FActive;
|
||||
if B then
|
||||
begin
|
||||
Factive:=False;
|
||||
Activate;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ ---------------------------------------------------------------------
|
||||
TSimpleIPCServer
|
||||
---------------------------------------------------------------------}
|
||||
@ -374,6 +394,9 @@ begin
|
||||
StopServer;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
{ ---------------------------------------------------------------------
|
||||
TSimpleIPCClient
|
||||
---------------------------------------------------------------------}
|
||||
|
@ -110,17 +110,13 @@ end;
|
||||
|
||||
|
||||
constructor TPipeClientComm.Create(AOWner: TSimpleIPCClient);
|
||||
|
||||
Var
|
||||
D : String;
|
||||
|
||||
begin
|
||||
inherited Create(AOWner);
|
||||
FFileName:=Owner.ServerID;
|
||||
If (Owner.ServerInstance<>'') then
|
||||
FFileName:=FFileName+'-'+Owner.ServerInstance;
|
||||
D:='/tmp/'; // Change to something better later
|
||||
FFileName:=D+FFileName;
|
||||
if FFileName[1]<>'/' then
|
||||
FFileName:=GetTempDir(true)+FFileName;
|
||||
end;
|
||||
|
||||
|
||||
@ -200,17 +196,13 @@ Type
|
||||
end;
|
||||
|
||||
constructor TPipeServerComm.Create(AOWner: TSimpleIPCServer);
|
||||
|
||||
Var
|
||||
D : String;
|
||||
|
||||
begin
|
||||
inherited Create(AOWner);
|
||||
FFileName:=Owner.ServerID;
|
||||
If Not Owner.Global then
|
||||
FFileName:=FFileName+'-'+IntToStr(fpGetPID);
|
||||
D:='/tmp/'; // Change to something better later
|
||||
FFileName:=D+FFileName;
|
||||
if FFileName[1]<>'/' then
|
||||
FFileName:=GetTempDir(Owner.Global)+FFileName;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -256,12 +256,18 @@ var block : TVerBlockHeader;
|
||||
tmp : integer;
|
||||
vinfo : TVerTranslationInfo;
|
||||
before : int64;
|
||||
isBlockHeaderRead: boolean;
|
||||
begin
|
||||
Result:=0;
|
||||
isBlockHeaderRead:=false;
|
||||
while toread>0 do
|
||||
begin
|
||||
before:=RawData.Position;
|
||||
ReadBlockHeader(block);
|
||||
if not isBlockHeaderRead then
|
||||
begin
|
||||
ReadBlockHeader(block);
|
||||
isBlockHeaderRead:=true;
|
||||
end;
|
||||
if (block.valtype<>0) or (block.key<>'Translation') then
|
||||
RawData.Seek(block.vallength,soFromCurrent)
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user