summaryrefslogtreecommitdiff
path: root/UConnectionProperties.pas
diff options
context:
space:
mode:
Diffstat (limited to 'UConnectionProperties.pas')
-rw-r--r--UConnectionProperties.pas28
1 files changed, 10 insertions, 18 deletions
diff --git a/UConnectionProperties.pas b/UConnectionProperties.pas
index 27d5bbe..99dbf9a 100644
--- a/UConnectionProperties.pas
+++ b/UConnectionProperties.pas
@@ -44,6 +44,7 @@ type
function ValidSettings: boolean;
public
function MakeURI(Hidden: boolean): string;
+ function GetService: string;
end;
var
@@ -297,25 +298,8 @@ begin
end;
function TFConnectionProperties.MakeURI(Hidden: boolean): string;
-var Prefix: string;
begin
- Prefix := ServiceTypeTable[ServiceTypeTable_Count, 1];
- if ServiceTypeOptionMenu.ItemIndex < ServiceTypeTable_Count - 1
- then Prefix := ServiceTypeTable[ServiceTypeOptionMenu.ItemIndex + 1, 1] else
- if Pos('://', URIEntry.Text) > 1 then Prefix := Copy(URIEntry.Text, 1, Pos('://', URIEntry.Text) - 1);
- Result := Prefix + '://';
- if Length(UserNameEntry.Text) > 0 then begin
- Result := Result + UserNameEntry.Text;
- if Length(PasswordEntry.Text) > 0 then
- if Hidden then Result := Result + ':' + StringOfChar('*', Length(PasswordEntry.Text))
- else Result := Result + ':' + PasswordEntry.Text;
- Result := Result + '@';
- end;
- Result := Result + ServerEntry.Text;
- if Length(TargetDirEntry.Text) > 0 then begin
- if TargetDirEntry.Text[1] <> '/' then Result := Result + '/';
- Result := Result + TargetDirEntry.Text;
- end;
+ Result := ConstructURI(True, Hidden, GetService, ServerEntry.Text, UserNameEntry.Text, PasswordEntry.Text, TargetDirEntry.Text);
end;
procedure TFConnectionProperties.ServiceTypeOptionMenuChanged(Sender: TObject);
@@ -328,6 +312,14 @@ begin
NameEntryChanged(Sender);
end;
+function TFConnectionProperties.GetService: string;
+begin
+ Result := ServiceTypeTable[ServiceTypeTable_Count, 1];
+ if ServiceTypeOptionMenu.ItemIndex < ServiceTypeTable_Count - 1
+ then Result := ServiceTypeTable[ServiceTypeOptionMenu.ItemIndex + 1, 1] else
+ if Pos('://', URIEntry.Text) > 1 then Result := Copy(URIEntry.Text, 1, Pos('://', URIEntry.Text) - 1);
+end;
+
end.