mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Change cm_AddToQueue parameter to a form of "queueid=x".
This commit is contained in:
parent
fc7e83e840
commit
81a01a5b8c
2 changed files with 24 additions and 1 deletions
|
|
@ -124,8 +124,9 @@ end;
|
|||
procedure TfrmCopyDlg.cm_AddToQueue(const Params: array of String);
|
||||
var
|
||||
Value: Integer;
|
||||
sQueueId: String;
|
||||
begin
|
||||
if (Length(Params) > 0) and TryStrToInt(Params[0], Value) then
|
||||
if GetParamValue(Params, 'queueid', sQueueId) and TryStrToInt(sQueueId, Value) then
|
||||
FQueueIdentifier := Value
|
||||
else
|
||||
FQueueIdentifier := SingleQueueId;
|
||||
|
|
|
|||
|
|
@ -135,6 +135,13 @@ type
|
|||
end;
|
||||
|
||||
function GetDefaultParam(const Params: array of String): String;
|
||||
{en
|
||||
Searches for parameters starting with "Key=" and sets Value to the
|
||||
the rest of the parameter string (Key=Value).
|
||||
If the key is not found it sets Value to empty string and returns @false.
|
||||
@returns(@true if the key was found, @false if it was not found)
|
||||
}
|
||||
function GetParamValue(const Params: array of String; Key: String; out Value: String): Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
|
|
@ -352,5 +359,20 @@ begin
|
|||
Result := '';
|
||||
end;
|
||||
|
||||
function GetParamValue(const Params: array of String; Key: String; out Value: String): Boolean;
|
||||
var
|
||||
Param: String;
|
||||
begin
|
||||
Key := Key + '=';
|
||||
for Param in Params do
|
||||
if StrBegins(Param, Key) then
|
||||
begin
|
||||
Value := Copy(Param, Length(Key) + 1, MaxInt);
|
||||
Exit(True);
|
||||
end;
|
||||
Value := '';
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue