mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Fix %db in file pattern being replaced like a %d (current day) with a literal "b" after it.
This commit is contained in:
@ -92,6 +92,15 @@ type
|
|||||||
property LastContent: String read FLastContent;
|
property LastContent: String read FLastContent;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Extended string list with support for empty values
|
||||||
|
TExtStringList = class(TStringList)
|
||||||
|
private
|
||||||
|
function GetValue(const Name: string): string;
|
||||||
|
procedure SetValue(const Name, Value: string); reintroduce;
|
||||||
|
public
|
||||||
|
property Values[const Name: string]: string read GetValue write SetValue;
|
||||||
|
end;
|
||||||
|
|
||||||
// Threading stuff
|
// Threading stuff
|
||||||
TQueryThread = class(TThread)
|
TQueryThread = class(TThread)
|
||||||
private
|
private
|
||||||
@ -2594,12 +2603,12 @@ end;
|
|||||||
|
|
||||||
function GetOutputFilename(FilenameWithPlaceholders: String; DBObj: TDBObject): String;
|
function GetOutputFilename(FilenameWithPlaceholders: String; DBObj: TDBObject): String;
|
||||||
var
|
var
|
||||||
Arguments: TStringList;
|
Arguments: TExtStringList;
|
||||||
Year, Month, Day, Hour, Min, Sec, MSec: Word;
|
Year, Month, Day, Hour, Min, Sec, MSec: Word;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
// Rich format output filename, replace certain markers. See issue #2622
|
// Rich format output filename, replace certain markers. See issue #2622
|
||||||
Arguments := TStringList.Create;
|
Arguments := TExtStringList.Create;
|
||||||
|
|
||||||
if Assigned(DBObj) then begin
|
if Assigned(DBObj) then begin
|
||||||
Arguments.Values['session'] := ValidFilename(DBObj.Connection.Parameters.SessionName);
|
Arguments.Values['session'] := ValidFilename(DBObj.Connection.Parameters.SessionName);
|
||||||
@ -3332,6 +3341,26 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{ TExtStringList }
|
||||||
|
// taken from https://stackoverflow.com/questions/33893377/can-i-prevent-tstringlist-removing-key-value-pair-when-value-set-to-empty
|
||||||
|
|
||||||
|
function TExtStringList.GetValue(const Name: string): string;
|
||||||
|
begin
|
||||||
|
Result := Self.GetValue(Name);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TExtStringList.SetValue(const Name, Value: string);
|
||||||
|
var
|
||||||
|
I: Integer;
|
||||||
|
begin
|
||||||
|
I := IndexOfName(Name);
|
||||||
|
if I < 0 then I := Add('');
|
||||||
|
Put(I, Name + NameValueSeparator + Value);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ TAppSettings }
|
{ TAppSettings }
|
||||||
|
|
||||||
constructor TAppSettings.Create;
|
constructor TAppSettings.Create;
|
||||||
|
Reference in New Issue
Block a user