summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-03-19 13:57:35 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-03-19 13:57:35 +0200
commit2e5e0b34db113e177bf5994ff7a6e2cbcd1d339e (patch)
treeccf163477cb0736057a474f2c51a50579c25adef /src
parentfba3c63cc06de9dc83f4f8a70c92762b6d404fa9 (diff)
downloadfpGUI-2e5e0b34db113e177bf5994ff7a6e2cbcd1d339e.tar.xz
SelectDir dialog: Fixed various issues in the dialog.
* Removed duplicate / char under Linux * Fixed directory selection under Windows - this was totally broken. Thanks to Jean-Pierre ANGHEL <jp.anghel@bbox.fr> for some support on this and bringing it to my attention.
Diffstat (limited to 'src')
-rw-r--r--src/gui/selectdirdialog.inc24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/gui/selectdirdialog.inc b/src/gui/selectdirdialog.inc
index 35bafff6..6415fde9 100644
--- a/src/gui/selectdirdialog.inc
+++ b/src/gui/selectdirdialog.inc
@@ -35,16 +35,30 @@
{$IFDEF read_implementation}
function TfpgSelectDirDialog.GetAbsolutePath(Node: TfpgTreeNode): TfpgString;
+var
+ lResult: TfpgString;
begin
- Result := '';
+ lResult := '';
while Node <> nil do
begin
- if Node.Text = PathDelim then
- Result := Node.Text + Result
- else
- Result := Node.Text + PathDelim + Result;
+ {$IFDEF UNIX}
+ if (Node.Text = PathDelim) then
+ lResult := Node.Text + lResult
+ else if (Node.Text <> '') then
+ lResult := Node.Text + PathDelim + lResult;
+ {$ENDIF}
+ {$IFDEF MSWINDOWS}
+ if (Node.Text <> '') then
+ begin
+ if (Node.Text[Length(Node.Text)] = PathDelim) then
+ lResult := Node.Text + lResult
+ else
+ lResult := Node.Text + PathDelim + lResult;
+ end;
+ {$ENDIF}
Node := Node.Parent;
end;
+ Result := lResult;
end;
procedure TfpgSelectDirDialog.InitializeTreeview;