mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Store last used database directly, not only when closing a session. Closes #983
This commit is contained in:
@@ -3555,6 +3555,13 @@ begin
|
||||
Query(GetSQLSpecifity(spUSEQuery, [s]), False);
|
||||
// FDatabase is set via DetectUSEQuery
|
||||
end;
|
||||
|
||||
// Save last used database in session, see #983
|
||||
if not FParameters.SessionName.IsEmpty then begin
|
||||
AppSettings.SessionPath := FParameters.SessionPath;
|
||||
AppSettings.WriteString(asLastUsedDB, Value);
|
||||
end;
|
||||
|
||||
if Assigned(FOnObjectnamesChanged) then
|
||||
FOnObjectnamesChanged(Self, FDatabase);
|
||||
end;
|
||||
|
||||
@@ -2457,8 +2457,6 @@ begin
|
||||
RefreshHelperNode(HELPERNODE_COLUMNS);
|
||||
|
||||
// Last chance to access connection related properties before disconnecting
|
||||
AppSettings.SessionPath := Item.Parameters.SessionPath;
|
||||
AppSettings.WriteString(asLastUsedDB, Item.Database);
|
||||
|
||||
// Disconnect
|
||||
Item.Active := False;
|
||||
|
||||
Reference in New Issue
Block a user