Mainform.SessionName is used for write operations to registry. If you

a) connect a session
b) open the session manager
c) rename the current session
... your registry has a nearly empty session folder, after DoDisconnect() stores the last active database with the old session name.
This change fixes the SessionName variable and window caption immediately after a session was renamed.
This commit is contained in:
Ansgar Becker
2009-08-18 19:35:47 +00:00
parent 4d7a301b78
commit 4bf22d785e
2 changed files with 28 additions and 17 deletions

View File

@ -473,6 +473,11 @@ begin
SessionKey := REGPATH + REGKEY_SESSIONS + SelectedSession;
if MainReg.KeyExists(SessionKey) then
MainReg.MoveKey(SessionKey, REGPATH + REGKEY_SESSIONS + NewText, true);
// Also fix internal session name in main form, which gets used to store e.g. "lastuseddb" later
if Mainform.SessionName = SelectedSession then begin
Mainform.SessionName := NewText;
Mainform.SetWindowCaption;
end;
FSessionNames[FSessionNames.IndexOf(SelectedSession)] := NewText;
RefreshSessionList(False);
end;