Skip to content

Commit 2e290f1

Browse files
committed
refactor: prefer Delphi friendly SysUtils.PathDelim over hard-coded backslash
1 parent 6878578 commit 2e290f1

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

source/apphelpers.pas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3861,7 +3861,7 @@ constructor TAppSettings.Create;
38613861
InitSetting(asIgnoreDatabasePattern, 'IgnoreDatabasePattern', 0, False, '', True);
38623862
InitSetting(asLogFileDdl, 'LogFileDdl', 0, False, '', True);
38633863
InitSetting(asLogFileDml, 'LogFileDml', 0, False, '', True);
3864-
InitSetting(asLogFilePath, 'LogFilePath', 0, False, DirnameUserAppData + 'Logs\%session\%db\%y%m%d.sql', True);
3864+
InitSetting(asLogFilePath, 'LogFilePath', 0, False, DirnameUserAppData + 'Logs'+PathDelim+'%session'+PathDelim+'%db'+PathDelim+'%y%m%d.sql', True);
38653865
if Screen.Fonts.IndexOf('Consolas') > -1 then
38663866
InitSetting(asFontName, 'FontName', 0, False, 'Consolas')
38673867
else
@@ -3877,7 +3877,7 @@ constructor TAppSettings.Create;
38773877
InitSetting(asHightlightSameTextBackground, 'HightlightSameTextBackground', GetThemeColor(clInfoBk));
38783878
InitSetting(asLogsqlnum, 'logsqlnum', 300);
38793879
InitSetting(asLogsqlwidth, 'logsqlwidth', 2000);
3880-
InitSetting(asSessionLogsDirectory, 'SessionLogsDirectory', 0, False, DirnameUserAppData + 'Sessionlogs\');
3880+
InitSetting(asSessionLogsDirectory, 'SessionLogsDirectory', 0, False, DirnameUserAppData + 'Sessionlogs' + PathDelim);
38813881
InitSetting(asLogHorizontalScrollbar, 'LogHorizontalScrollbar', 0, False);
38823882
InitSetting(asSQLColActiveLine, 'SQLColActiveLine', 0, False, 'clNone');
38833883
InitSetting(asSQLColMatchingBraceForeground, 'SQLColMatchingBraceForeground', 0, False, 'clBlack');
@@ -4075,7 +4075,7 @@ constructor TAppSettings.Create;
40754075
InitSetting(asDisplayReverseForeignKeys, 'DisplayReverseForeignKeys', 0, False);
40764076
InitSetting(asGenerateDataNumRows, 'GenerateDataNumRows', 1000);
40774077
InitSetting(asGenerateDataNullAmount, 'GenerateDataNullAmount', 10);
4078-
InitSetting(asCustomSnippetsDirectory, 'CustomSnippetsDirectory', 0, False, DirnameUserDocuments + 'Snippets\');
4078+
InitSetting(asCustomSnippetsDirectory, 'CustomSnippetsDirectory', 0, False, DirnameUserDocuments + 'Snippets' + PathDelim);
40794079
InitSetting(asPromptSaveFileOnTabClose, 'PromptSaveFileOnTabClose', 0, True);
40804080
// Restore tabs feature crashes often on old XP systems, see https://www.heidisql.com/forum.php?t=34044
40814081
InitSetting(asRestoreTabs, 'RestoreTabs', 0, Win32MajorVersion >= 6);
@@ -4775,7 +4775,7 @@ function TAppSettings.DirnameSnippets: String;
47754775
function TAppSettings.DirnameBackups: String;
47764776
begin
47774777
// Create backup folder if it does not exist and return it
4778-
Result := DirnameUserAppData + 'Backups\';
4778+
Result := DirnameUserAppData + 'Backups' + PathDelim;
47794779
if not DirectoryExists(Result) then begin
47804780
ForceDirectories(Result);
47814781
end;
@@ -4784,7 +4784,7 @@ function TAppSettings.DirnameBackups: String;
47844784

47854785
function TAppSettings.DirnameHighlighters: string;
47864786
begin
4787-
Result := DirnameUserAppData + 'Highlighters\';
4787+
Result := DirnameUserAppData + 'Highlighters' + PathDelim;
47884788
if not DirectoryExists(Result) then begin
47894789
ForceDirectories(Result);
47904790
end;

source/main.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5302,7 +5302,7 @@ procedure TMainform.popupQueryLoadClick(Sender: TObject);
53025302
// Click on the popupQueryLoad
53035303
Filename := (Sender as TMenuItem).Caption;
53045304
Filename := StripHotkey(Filename);
5305-
if Pos('\', Filename) = 0 then // assuming we load a snippet
5305+
if Pos(PathDelim, Filename) = 0 then // assuming we load a snippet
53065306
Filename := AppSettings.DirnameSnippets + Filename + FILEEXT_SNIPPET
53075307
else begin // assuming we load a file from the recent-list
53085308
p := Pos(' ', Filename) + 1;

source/tabletools.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,7 @@ procedure TfrmTableTools.DoExport(DBObj: TDBObject);
18481848

18491849
if ToDir then begin
18501850
FreeAndNil(ExportStream);
1851-
DbDir := IncludeTrailingPathDelimiter(GetOutputFilename(comboExportOutputTarget.Text, DBObj)) + DBObj.Database + '\';
1851+
DbDir := GetOutputFilename(comboExportOutputTarget.Text, DBObj) + PathDelim + DBObj.Database + PathDelim;
18521852
if not DirectoryExists(DbDir) then
18531853
ForceDirectories(DbDir);
18541854
ExportStream := TFileStream.Create(DbDir + DBObj.ObjType.ToLower + '-' + DBObj.Name+'.sql', fmCreate or fmOpenWrite);

0 commit comments

Comments
 (0)