Skip to content

Commit f6494a0

Browse files
author
joachim.marder
committed
TUIRibbon.SaveSettings() now ensures that the directory exists in which the ribbon settings file should be written.
1 parent 073c18f commit f6494a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/UIRibbon.pas

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ function TUIRibbon.GetRibbonSettingsFilePath(): string;
869869
// Portable editions have their settings stored beside the executable.
870870
if not FileExists(fRibbonSettingsFilePath) then begin
871871
// If no settings file found beside the executable, we use appdata path, e.g.
872-
// "C:\Users\foo\AppData\Roaming\JAM Software\My Application"
872+
// "C:\Users\foo\AppData\Roaming\My Application"
873873
fRibbonSettingsFilePath := IncludeTrailingPathDelimiter(GetHomePath) + Application.Title + PathDelim + lRibbonFilename;
874874
end;//if
875875
end;//if
@@ -1105,7 +1105,8 @@ procedure TUIRibbon.SaveRibbonSettings;
11051105
exit;
11061106
// Save ribbon user settings
11071107
try
1108-
Self.SaveSettings(Self.RibbonSettingsFilePath);
1108+
ForceDirectories(ExtractfilePath(RibbonSettingsFilePath));
1109+
Self.SaveSettings(RibbonSettingsFilePath);
11091110
except
11101111
on E: EFileStreamError do
11111112
begin

0 commit comments

Comments
 (0)