Skip to content

Commit

Permalink
Make sure connection settings always end up in "Connection.ConnName" …
Browse files Browse the repository at this point in the history
…sections

Fixes #126.
  • Loading branch information
lighterowl committed Feb 2, 2025
1 parent f208b07 commit 7892872
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion connoptionsframes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ procedure TConnOptionsFrames.SaveConnSettings(const ConnName: string; Ini: TIniF
var
Section: String;
begin
Section := ConnNameToSectionName(ConnName, Ini);
Section := 'Connection.' + ConnName;
transmission.SaveConnSettings(Section, Ini);
proxy.SaveConnSettings(Section, Ini);
paths.SaveConnSettings(Section, Ini);
Expand All @@ -143,6 +143,11 @@ class function TConnOptionsFrames.ConnNameToSectionName(const ConnName: string;
var
Section: String;
begin
{ to be used only when loading as it preserves compatibility with (I presume)
really old INIs created by single-connection-only transgui versions that
stored all settings in the "Connection" section.
newly created settings should always be stored in "Connection.$conn_name"
sections. }
Section := 'Connection.' + ConnName;
if (ConnName <> '') and not Ini.SectionExists(Section) then
Section := 'Connection';
Expand Down

0 comments on commit 7892872

Please sign in to comment.