user1580348
user1580348

Reputation: 6053

TJvAppXMLFileStorage OnGetFileName event never executed

In Delphi 10 Seattle, with JVCL 3.48, after having implemented TJvAppXMLFileStorage OnGetFileName event handler, it never gets executed:

procedure TForm1.JvAppXMLFileStorage1GetFileName(Sender:
    TJvCustomAppStorage; var FileName: TFileName);
begin
  // never gets executed!
  CodeSite.Send('JvAppXMLFileStorage1GetFileName', FileName.ToString);
end;

I need this event to set the JvAppXMLFileStorage1.Location property with the var FileName parameter depending from other settings.

So how can I get this event executed?

Upvotes: 0

Views: 161

Answers (1)

Ken White
Ken White

Reputation: 125728

A quick look at JvAppStorage.pas seems to show that the only place that calls DoGetFileName (which is where OnGetFileName is triggered if there is one assigned) is in TJvCustomAppMemoryFileStorage.RecalculateFullFileName. Looking at that method, DoGetFileName is only called from the case Location of branch for flCustom.

This seems to indicate that the event is only fired if it's assigned and the Location is flCustom.

Upvotes: 1

Related Questions