I have an issue with TSaveDialog on OSX.
I have wrong path when using the folder opened by the TSaveDialog.
In order to reproduce place a button and a TSaveDialog on a form.
The use the code below:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
SaveDialog1: TSaveDialog;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
SaveDialog1.FileName:= 'test.txt';
if SaveDialog1.Execute then
Label1.Caption:= SaveDialog1.FileName;
end;
end.
Click the button and navigate to Documents folder, click ok on the save dialog and you will get the right folder, click again on button1, the savedialog will propose you the Documents folder as default, just press Ok on the save dialog and you will get the following filename that is wrong:
test.txt/test.txt
I saw that there are some bug issues on the bug tracker on open and save dialogs on carbon and cocoa but they seems to be resolved but not on my fpc 3.0.4 las 1.8.4
Any hint?