Browse Source

Bug 1857: Do not prevent WinSCP from working when jump list cannot be updated (generalization of previous implementation)

https://winscp.net/tracker/1857

Source commit: 58ef1900c45d900989d084c61d14a0da738a8642
Martin Prikryl 5 năm trước cách đây
mục cha
commit
d1d5720f7f
2 tập tin đã thay đổi với 32 bổ sung4 xóa
  1. 24 3
      source/forms/Login.cpp
  2. 8 1
      source/windows/TerminalManager.cpp

+ 24 - 3
source/forms/Login.cpp

@@ -1006,7 +1006,14 @@ void __fastcall TLoginDialog::DeleteSessionActionExecute(TObject * /*Sender*/)
     if (MessageDialog(Message,
           qtConfirmation, qaOK | qaCancel, HELP_DELETE_SESSION, &Params) == qaOK)
     {
-      WinConfiguration->DeleteSessionFromJumpList(Session->SessionName);
+      try
+      {
+        WinConfiguration->DeleteSessionFromJumpList(Session->SessionName);
+      }
+      catch (Exception & E)
+      {
+        ShowExtendedException(&E);
+      }
       Session->Remove();
       DestroySession(Session);
       SessionTree->Selected->Delete();
@@ -1053,7 +1060,14 @@ void __fastcall TLoginDialog::DeleteSessionActionExecute(TObject * /*Sender*/)
     {
       if (IsWorkspaceNode(Node))
       {
-        WinConfiguration->DeleteWorkspaceFromJumpList(Path);
+        try
+        {
+          WinConfiguration->DeleteWorkspaceFromJumpList(Path);
+        }
+        catch (Exception & E)
+        {
+          ShowExtendedException(&E);
+        }
       }
 
       Node = SessionTree->Selected;
@@ -1334,7 +1348,14 @@ void __fastcall TLoginDialog::SaveDataList(TList * DataList)
 
     if (IsWorkspaceNode(Node))
     {
-      WinConfiguration->AddWorkspaceToJumpList(Name);
+      try
+      {
+        WinConfiguration->AddWorkspaceToJumpList(Name);
+      }
+      catch (Exception & E)
+      {
+        ShowExtendedException(&E);
+      }
     }
 
     StoredSessions->GetFolderOrWorkspace(Name, DataList);

+ 8 - 1
source/windows/TerminalManager.cpp

@@ -443,7 +443,14 @@ bool __fastcall TTerminalManager::ConnectActiveTerminal()
   // ad-hoc session cannot be reproduced from just a session name
   if (StoredSessions->FindSame(ActiveTerminal->SessionData) != NULL)
   {
-    WinConfiguration->AddSessionToJumpList(ActiveTerminal->SessionData->SessionName);
+    try
+    {
+      WinConfiguration->AddSessionToJumpList(ActiveTerminal->SessionData->SessionName);
+    }
+    catch (Exception & E)
+    {
+      ShowExtendedException(&E);
+    }
   }
 
   FAuthenticationCancelled = false;