Minor code cosmetic

This commit is contained in:
Ansgar Becker
2010-07-20 07:55:32 +00:00
parent d58265372f
commit c297024b60

View File

@ -1119,7 +1119,7 @@ end;
procedure TMainForm.FormDestroy(Sender: TObject); procedure TMainForm.FormDestroy(Sender: TObject);
var var
filename, WinState: String; WinState: String;
i: Integer; i: Integer;
begin begin
// Destroy editors and dialogs. Must be done before connection gets closed, as some destructors do SQL stuff. // Destroy editors and dialogs. Must be done before connection gets closed, as some destructors do SQL stuff.
@ -1730,10 +1730,8 @@ begin
end; end;
end; end;
// By default, select the host node // By default, select the host node
if not Assigned(DBtree.FocusedNode) then begin if not Assigned(DBtree.FocusedNode) then
DBtree.Selected[DBtree.GetFirst] := true; SelectNode(DBTree, DBtree.GetFirst);
DBtree.FocusedNode := DBtree.GetFirst;
end;
// Create function menu items in popupQuery and popupFilter // Create function menu items in popupQuery and popupFilter
menuQueryInsertFunction.Clear; menuQueryInsertFunction.Clear;
@ -1994,9 +1992,7 @@ var
Connections: TStringList; Connections: TStringList;
begin begin
// Delete dynamically added connection menu items. // Delete dynamically added connection menu items.
for i := menuConnections.Items.Count - 1 downto 0 do begin menuConnections.Items.Clear;
menuConnections.Items.Delete(i);
end;
// "Session manager" and "New window" items // "Session manager" and "New window" items
item := TMenuItem.Create(menuConnections); item := TMenuItem.Create(menuConnections);
@ -2006,6 +2002,9 @@ begin
item := TMenuItem.Create(menuConnections); item := TMenuItem.Create(menuConnections);
item.Action := actNewWindow; item.Action := actNewWindow;
menuConnections.Items.Add(item); menuConnections.Items.Add(item);
item := TMenuItem.Create(menuConnections);
item.Caption := '-';
menuConnections.Items.Add(item);
// All sessions // All sessions
if MainReg.OpenKey(REGPATH + REGKEY_SESSIONS, False) then begin if MainReg.OpenKey(REGPATH + REGKEY_SESSIONS, False) then begin