mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Revert commit:424b9f9ab4c620dd6945d69e9652ee828b0b26eb for #159 (migration of files from pre-10.0 snippets directory)
This commit is contained in:
@@ -1751,31 +1751,6 @@ begin
|
||||
on E:EOleSysError do;
|
||||
end;
|
||||
|
||||
// Move files from old default snippets directory, see issue #159
|
||||
if not AppSettings.PortableMode then begin
|
||||
// This was the default folder up to r5244 / 8b2966c52efb685b00189037a0507157ed03a368
|
||||
OldSnippetsDir := GetShellFolder(CSIDL_COMMON_APPDATA) + '\' + APPNAME + '\Snippets\';
|
||||
CurrentSnippetsDir := AppSettings.DirnameSnippets;
|
||||
//showmessage('1:'+crlf+OldSnippetsDir+crlf+CurrentSnippetsDir);
|
||||
if (not OldSnippetsDir.IsEmpty) and (not CurrentSnippetsDir.IsEmpty)
|
||||
and DirectoryExists(OldSnippetsDir) and DirectoryExists(CurrentSnippetsDir)
|
||||
and (CompareText(OldSnippetsDir, CurrentSnippetsDir) <> 0)
|
||||
then begin
|
||||
Files := TDirectory.GetFiles(OldSnippetsDir, '*.sql');
|
||||
if Length(Files) > 0 then begin
|
||||
LogSQL(f_('Migrating snippet files to new folder: %s', [CurrentSnippetsDir]));
|
||||
for i:=Low(Files) to High(Files) do begin
|
||||
TargetSnippet := CurrentSnippetsDir + ExtractFileName(Files[i]);
|
||||
if MoveFile(PChar(Files[i]), PChar(TargetSnippet)) then begin
|
||||
LogSQL(f_('Successfully moved "%s" to "%s"', [Files[i], TargetSnippet]));
|
||||
end else begin
|
||||
LogSQL(f_('Error: Could not move "%s" to "%s" (Error: %s)', [Files[i], TargetSnippet, SysErrorMessage(GetLastError())]), lcError);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// Load snippet filenames
|
||||
SetSnippetFilenames;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user