mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 03:01:07 +08:00
Get rid of global esc() function (which always refers to MainForm.ActiveConnection) and prefer the method's or unit's connection object instead
This commit is contained in:
@ -54,6 +54,7 @@ type
|
||||
|
||||
private
|
||||
{ Private declarations }
|
||||
FConnection: TDBConnection;
|
||||
FKeyword: String;
|
||||
FRootTopics: TDBQuery;
|
||||
function GetHelpResult(Node: PVirtualNode): TDBQuery;
|
||||
@ -97,7 +98,8 @@ begin
|
||||
|
||||
treeTopics.Clear;
|
||||
FreeAndNil(FRootTopics);
|
||||
FRootTopics := MainForm.ActiveConnection.GetResults('HELP '+esc('CONTENTS'));
|
||||
FConnection := MainForm.ActiveConnection;
|
||||
FRootTopics := FConnection.GetResults('HELP '+FConnection.EscapeString('CONTENTS'));
|
||||
treeTopics.RootNodeCount := FRootTopics.RecordCount;
|
||||
end;
|
||||
|
||||
@ -128,7 +130,7 @@ begin
|
||||
|
||||
if FKeyword <> '' then try
|
||||
Screen.Cursor := crHourglass;
|
||||
Results := MainForm.ActiveConnection.GetResults('HELP '+esc(FKeyword));
|
||||
Results := FConnection.GetResults('HELP '+FConnection.EscapeString(FKeyword));
|
||||
Caption := Caption + ' - ' + FKeyword;
|
||||
MemoDescription.Text := fixNewlines(Results.Col('description', True));
|
||||
MemoExample.Text := fixNewlines(Results.Col('example', True));
|
||||
@ -215,7 +217,7 @@ begin
|
||||
// Return number of children for folder
|
||||
VT := Sender as TVirtualStringTree;
|
||||
Results := VT.GetNodeData(Node);
|
||||
Results^ := MainForm.ActiveConnection.GetResults('HELP '+esc(VT.Text[Node, VT.Header.MainColumn]));
|
||||
Results^ := FConnection.GetResults('HELP '+FConnection.EscapeString(VT.Text[Node, VT.Header.MainColumn]));
|
||||
ChildCount := Results.RecordCount;
|
||||
end;
|
||||
|
||||
@ -286,7 +288,7 @@ end;
|
||||
procedure TfrmSQLhelp.ButtonOnlinehelpClick(Sender: TObject);
|
||||
begin
|
||||
// Link/redirect to mysql.com for further help
|
||||
ShellExec(APPDOMAIN + 'sqlhelp.php?mysqlversion='+inttostr(MainForm.ActiveConnection.ServerVersionInt)+
|
||||
ShellExec(APPDOMAIN + 'sqlhelp.php?mysqlversion='+inttostr(FConnection.ServerVersionInt)+
|
||||
'&keyword='+EncodeURLParam(keyword));
|
||||
end;
|
||||
|
||||
@ -311,7 +313,7 @@ begin
|
||||
FKeyword := Value;
|
||||
if FKeyword = '' then
|
||||
Exit;
|
||||
Results := MainForm.ActiveConnection.GetResults('HELP '+esc(FKeyword));
|
||||
Results := FConnection.GetResults('HELP '+FConnection.EscapeString(FKeyword));
|
||||
while not Results.Eof do begin
|
||||
if Results.Col('is_it_category', true) = 'N' then begin
|
||||
FKeyword := Results.Col('name');
|
||||
|
Reference in New Issue
Block a user