Browse Source

Suppress deprecated cmdline warning

git-svn-id: trunk@29107 -
pierre 10 years ago
parent
commit
542a4ea423
1 changed files with 28 additions and 28 deletions
  1. 28 28
      packages/fcl-process/src/process.pp

+ 28 - 28
packages/fcl-process/src/process.pp

@@ -173,11 +173,11 @@ Var
   Function DetectXTerm : String;
   Function DetectXTerm : String;
 {$endif unix}
 {$endif unix}
 
 
-function RunCommandIndir(const curdir:string;const exename:string;const commands:array of string;var outputstring:string;var exitstatus:integer):integer; 
-function RunCommandIndir(const curdir:string;const exename:string;const commands:array of string;var outputstring:string):boolean; 
+function RunCommandIndir(const curdir:string;const exename:string;const commands:array of string;var outputstring:string;var exitstatus:integer):integer;
+function RunCommandIndir(const curdir:string;const exename:string;const commands:array of string;var outputstring:string):boolean;
 function RunCommandInDir(const curdir,cmdline:string;var outputstring:string):boolean; deprecated;
 function RunCommandInDir(const curdir,cmdline:string;var outputstring:string):boolean; deprecated;
 
 
-function RunCommand(const exename:string;const commands:array of string;var outputstring:string):boolean; 
+function RunCommand(const exename:string;const commands:array of string;var outputstring:string):boolean;
 function RunCommand(const cmdline:string;var outputstring:string):boolean; deprecated;
 function RunCommand(const cmdline:string;var outputstring:string):boolean; deprecated;
 
 
 implementation
 implementation
@@ -321,7 +321,7 @@ end;
 procedure TProcess.Loaded;
 procedure TProcess.Loaded;
 begin
 begin
   inherited Loaded;
   inherited Loaded;
-  If (csDesigning in ComponentState) and (CommandLine<>'') then
+  If (csDesigning in ComponentState) and (FCommandLine<>'') then
     ConvertCommandLine;
     ConvertCommandLine;
 end;
 end;
 
 
@@ -460,7 +460,7 @@ end;
 procedure TProcess.ConvertCommandLine;
 procedure TProcess.ConvertCommandLine;
 begin
 begin
   FParameters.Clear;
   FParameters.Clear;
-  CommandToList(CommandLine,FParameters);
+  CommandToList(FCommandLine,FParameters);
   If FParameters.Count>0 then
   If FParameters.Count>0 then
     begin
     begin
     Executable:=FParameters[0];
     Executable:=FParameters[0];
@@ -468,7 +468,7 @@ begin
     end;
     end;
 end;
 end;
 
 
-Const 
+Const
   READ_BYTES = 65536; // not too small to avoid fragmentation when reading large files.
   READ_BYTES = 65536; // not too small to avoid fragmentation when reading large files.
 
 
 // helperfunction that does the bulk of the work.
 // helperfunction that does the bulk of the work.
@@ -483,25 +483,25 @@ begin
     bytesread:=0;
     bytesread:=0;
     p.Execute;
     p.Execute;
     while p.Running do
     while p.Running do
-      begin          
+      begin
         Setlength(outputstring,BytesRead + READ_BYTES);
         Setlength(outputstring,BytesRead + READ_BYTES);
         NumBytes := p.Output.Read(outputstring[1+bytesread], READ_BYTES);
         NumBytes := p.Output.Read(outputstring[1+bytesread], READ_BYTES);
-        if NumBytes > 0 then 
+        if NumBytes > 0 then
           Inc(BytesRead, NumBytes)
           Inc(BytesRead, NumBytes)
-        else 
-          Sleep(100); 
+        else
+          Sleep(100);
       end;
       end;
     repeat
     repeat
       Setlength(outputstring,BytesRead + READ_BYTES);
       Setlength(outputstring,BytesRead + READ_BYTES);
       NumBytes := p.Output.Read(outputstring[1+bytesread], READ_BYTES);
       NumBytes := p.Output.Read(outputstring[1+bytesread], READ_BYTES);
-      if NumBytes > 0 then 
+      if NumBytes > 0 then
         Inc(BytesRead, NumBytes);
         Inc(BytesRead, NumBytes);
     until NumBytes <= 0;
     until NumBytes <= 0;
     setlength(outputstring,BytesRead);
     setlength(outputstring,BytesRead);
     exitstatus:=p.exitstatus;	
     exitstatus:=p.exitstatus;	
     result:=0; // we came to here, document that.
     result:=0; // we came to here, document that.
     except
     except
-      on e : Exception do 
+      on e : Exception do
          begin
          begin
            result:=1;
            result:=1;
            setlength(outputstring,BytesRead);
            setlength(outputstring,BytesRead);
@@ -512,16 +512,16 @@ begin
     end;
     end;
 end;
 end;
 
 
-function RunCommandIndir(const curdir:string;const exename:string;const commands:array of string;var outputstring:string;var exitstatus:integer):integer; 
+function RunCommandIndir(const curdir:string;const exename:string;const commands:array of string;var outputstring:string;var exitstatus:integer):integer;
 Var
 Var
     p : TProcess;
     p : TProcess;
-    i : integer; 
+    i : integer;
 begin
 begin
   p:=TProcess.create(nil);
   p:=TProcess.create(nil);
-  p.Executable:=exename; 
+  p.Executable:=exename;
   if curdir<>'' then
   if curdir<>'' then
     p.CurrentDirectory:=curdir;
     p.CurrentDirectory:=curdir;
-  if high(commands)>=0 then 
+  if high(commands)>=0 then
    for i:=low(commands) to high(commands) do
    for i:=low(commands) to high(commands) do
      p.Parameters.add(commands[i]);
      p.Parameters.add(commands[i]);
   result:=internalruncommand(p,outputstring,exitstatus);
   result:=internalruncommand(p,outputstring,exitstatus);
@@ -530,27 +530,27 @@ end;
 function RunCommandInDir(const curdir,cmdline:string;var outputstring:string):boolean; deprecated;
 function RunCommandInDir(const curdir,cmdline:string;var outputstring:string):boolean; deprecated;
 Var
 Var
     p : TProcess;
     p : TProcess;
-    exitstatus : integer; 
+    exitstatus : integer;
 begin
 begin
   p:=TProcess.create(nil);
   p:=TProcess.create(nil);
-  p.commandline:=cmdline;
+  p.setcommandline(cmdline);
   if curdir<>'' then
   if curdir<>'' then
     p.CurrentDirectory:=curdir;
     p.CurrentDirectory:=curdir;
   result:=internalruncommand(p,outputstring,exitstatus)=0;
   result:=internalruncommand(p,outputstring,exitstatus)=0;
   if exitstatus<>0 then result:=false;
   if exitstatus<>0 then result:=false;
 end;
 end;
 
 
-function RunCommandIndir(const curdir:string;const exename:string;const commands:array of string;var outputstring:string):boolean; 
+function RunCommandIndir(const curdir:string;const exename:string;const commands:array of string;var outputstring:string):boolean;
 Var
 Var
     p : TProcess;
     p : TProcess;
     i,
     i,
-    exitstatus : integer; 
+    exitstatus : integer;
 begin
 begin
   p:=TProcess.create(nil);
   p:=TProcess.create(nil);
-  p.Executable:=exename; 
+  p.Executable:=exename;
   if curdir<>'' then
   if curdir<>'' then
     p.CurrentDirectory:=curdir;
     p.CurrentDirectory:=curdir;
-  if high(commands)>=0 then 
+  if high(commands)>=0 then
    for i:=low(commands) to high(commands) do
    for i:=low(commands) to high(commands) do
      p.Parameters.add(commands[i]);
      p.Parameters.add(commands[i]);
   result:=internalruncommand(p,outputstring,exitstatus)=0;
   result:=internalruncommand(p,outputstring,exitstatus)=0;
@@ -560,23 +560,23 @@ end;
 function RunCommand(const cmdline:string;var outputstring:string):boolean; deprecated;
 function RunCommand(const cmdline:string;var outputstring:string):boolean; deprecated;
 Var
 Var
     p : TProcess;
     p : TProcess;
-    exitstatus : integer; 
+    exitstatus : integer;
 begin
 begin
   p:=TProcess.create(nil);
   p:=TProcess.create(nil);
-  p.commandline:=cmdline;
+  p.setcommandline(cmdline);
   result:=internalruncommand(p,outputstring,exitstatus)=0;
   result:=internalruncommand(p,outputstring,exitstatus)=0;
   if exitstatus<>0 then result:=false;
   if exitstatus<>0 then result:=false;
 end;
 end;
 
 
-function RunCommand(const exename:string;const commands:array of string;var outputstring:string):boolean; 
+function RunCommand(const exename:string;const commands:array of string;var outputstring:string):boolean;
 Var
 Var
     p : TProcess;
     p : TProcess;
     i,
     i,
-    exitstatus : integer; 
+    exitstatus : integer;
 begin
 begin
   p:=TProcess.create(nil);
   p:=TProcess.create(nil);
-  p.Executable:=exename; 
-  if high(commands)>=0 then 
+  p.Executable:=exename;
+  if high(commands)>=0 then
    for i:=low(commands) to high(commands) do
    for i:=low(commands) to high(commands) do
      p.Parameters.add(commands[i]);
      p.Parameters.add(commands[i]);
   result:=internalruncommand(p,outputstring,exitstatus)=0;
   result:=internalruncommand(p,outputstring,exitstatus)=0;