Permalink
Browse files

Issue #60: Store snippets in C:\Users\anse\Documents\HeidiSQL\Snippet…

…s by default, not C:\Users\anse\AppData\Roaming\HeidiSQL\Snippets
  • Loading branch information...
ansgarbecker committed Feb 6, 2018
1 parent eba05e7 commit 8b2966c52efb685b00189037a0507157ed03a368
Showing with 8 additions and 9 deletions.
  1. +8 −9 source/apphelpers.pas
View
@@ -266,8 +266,8 @@ TAppSettings = class(TObject)
function ExtractLiteral(var SQL: String; Prefix: String): String;
function GetShellFolder(CSIDL: integer): string;
// Common directories
function DirnameCommonAppData: String;
function DirnameUserAppData: String;
function DirnameUserDocuments: String;
function DirnameSnippets: String;
function goodfilename( str: String ): String;
function ExtractBaseFileName(FileName: String): String;
@@ -795,19 +795,18 @@ function GetShellFolder(CSIDL: integer): string;
end;
function DirnameCommonAppData: String;
begin
// "All users" folder for HeidiSQL's data (All Users\Application Data)
Result := GetShellFolder(CSIDL_COMMON_APPDATA) + '\' + APPNAME + '\';
end;
function DirnameUserAppData: String;
begin
// User folder for HeidiSQL's data (<user name>\Application Data)
Result := GetShellFolder(CSIDL_APPDATA) + '\' + APPNAME + '\';
end;
function DirnameUserDocuments: String;
begin
// "HeidiSQL" folder under user's documents folder, e.g. c:\Users\Mike\Documents\HeidiSQL\
Result := GetShellFolder(CSIDL_MYDOCUMENTS) + '\' + APPNAME + '\';
end;
function DirnameSnippets: String;
begin
@@ -3485,7 +3484,7 @@ constructor TAppSettings.Create;
if FPortableMode then
DefaultSnippetsDirectory := ExtractFilePath(ParamStr(0))
else
DefaultSnippetsDirectory := DirnameCommonAppData;
DefaultSnippetsDirectory := DirnameUserDocuments;
DefaultSnippetsDirectory := DefaultSnippetsDirectory + 'Snippets\';
InitSetting(asCustomSnippetsDirectory, 'CustomSnippetsDirectory', 0, False, DefaultSnippetsDirectory);
InitSetting(asPromptSaveFileOnTabClose, 'PromptSaveFileOnTabClose', 0, True);

0 comments on commit 8b2966c

Please sign in to comment.