Bug 1341211 - Temporary C++ bustage fix since nsIFilePicker::Show() was removed. rs=bustage-fix
☠☠ backed out by 91182177f8e7 ☠ ☠
authorJorg K <jorgk@jorgk.com>
Sun, 13 Aug 2017 00:04:55 +0200
changeset 29540 8802479e93e761eed1ee4497b92e22f6bb0f043b
parent 29539 f305e8b4e790388b0a891c5bcba942a5086f90c8
child 29541 c91c7c77fa2e9c4bab26f810bf484a6bfd9af9b7
push id378
push userclokep@gmail.com
push dateMon, 13 Nov 2017 18:45:35 +0000
reviewersbustage-fix
bugs1341211
Bug 1341211 - Temporary C++ bustage fix since nsIFilePicker::Show() was removed. rs=bustage-fix
mailnews/base/src/nsMessenger.cpp
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -365,17 +365,20 @@ nsMessenger::PromptIfFileExists(nsIFile 
 
       nsCOMPtr <nsIFile> lastSaveDir;
       rv = GetLastSaveDirectory(getter_AddRefs(lastSaveDir));
       if (NS_SUCCEEDED(rv) && lastSaveDir) {
         filePicker->SetDisplayDirectory(lastSaveDir);
       }
 
       int16_t dialogReturn;
-      rv = filePicker->Show(&dialogReturn);
+      // Temporary bustage fix, see bug 1341211 - nsMessenger::PromptIfFileExists()
+      // rv = filePicker->Show(&dialogReturn);
+      dialogReturn = nsIFilePicker::returnCancel;
+      rv = NS_ERROR_FAILURE;
       if (NS_FAILED(rv) || dialogReturn == nsIFilePicker::returnCancel) {
         // XXX todo
         // don't overload the return value like this
         // change this function to have an out boolean
         // that we check to see if the user cancelled
         return NS_ERROR_FAILURE;
       }
 
@@ -852,17 +855,20 @@ nsMessenger::SaveOneAttachment(const cha
   }
 
   filePicker->AppendFilters(nsIFilePicker::filterAll);
 
   rv = GetLastSaveDirectory(getter_AddRefs(lastSaveDir));
   if (NS_SUCCEEDED(rv) && lastSaveDir)
     filePicker->SetDisplayDirectory(lastSaveDir);
 
-  rv = filePicker->Show(&dialogResult);
+  // Temporary bustage fix, see bug 1341211 - nsMessenger::SaveOneAttachment()
+  // rv = filePicker->Show(&dialogReturn);
+  dialogResult = nsIFilePicker::returnCancel;
+  rv = NS_ERROR_FAILURE;
   if (NS_FAILED(rv) || dialogResult == nsIFilePicker::returnCancel)
     return rv;
 
   rv = filePicker->GetFile(getter_AddRefs(localFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
   SetLastSaveDirectory(localFile);
 
@@ -922,17 +928,20 @@ nsMessenger::SaveAllAttachments(uint32_t
   filePicker->Init(mWindow,
                    saveAttachmentStr,
                    nsIFilePicker::modeGetFolder);
 
   rv = GetLastSaveDirectory(getter_AddRefs(lastSaveDir));
   if (NS_SUCCEEDED(rv) && lastSaveDir)
     filePicker->SetDisplayDirectory(lastSaveDir);
 
-  rv = filePicker->Show(&dialogResult);
+  // Temporary bustage fix, see bug 1341211 - nsMessenger::SaveAllAttachments()
+  // rv = filePicker->Show(&dialogReturn);
+  dialogResult = nsIFilePicker::returnCancel;
+  rv = NS_ERROR_FAILURE;
   if (NS_FAILED(rv) || dialogResult == nsIFilePicker::returnCancel)
     return rv;
 
   rv = filePicker->GetFile(getter_AddRefs(localFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = SetLastSaveDirectory(localFile);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1245,17 +1254,20 @@ nsMessenger::GetSaveAsFile(const nsAStri
   int16_t dialogResult;
 
   nsCOMPtr <nsIFile> lastSaveDir;
   rv = GetLastSaveDirectory(getter_AddRefs(lastSaveDir));
   if (NS_SUCCEEDED(rv) && lastSaveDir)
     filePicker->SetDisplayDirectory(lastSaveDir);
 
   nsCOMPtr<nsIFile> localFile;
-  rv = filePicker->Show(&dialogResult);
+  // Temporary bustage fix, see bug 1341211 - nsMessenger::GetSaveAsFile()
+  // rv = filePicker->Show(&dialogReturn);
+  dialogResult = nsIFilePicker::returnCancel;
+  rv = NS_ERROR_FAILURE;
   NS_ENSURE_SUCCESS(rv, rv);
   if (dialogResult == nsIFilePicker::returnCancel)
   {
     // We'll indicate this by setting the outparam to null.
     *aSaveAsFile = nullptr;
     return NS_OK;
   }
 
@@ -1333,17 +1345,20 @@ nsMessenger::GetSaveToDir(nsIFile **aSav
   filePicker->Init(mWindow, chooseFolderStr, nsIFilePicker::modeGetFolder);
 
   nsCOMPtr<nsIFile> lastSaveDir;
   rv = GetLastSaveDirectory(getter_AddRefs(lastSaveDir));
   if (NS_SUCCEEDED(rv) && lastSaveDir)
     filePicker->SetDisplayDirectory(lastSaveDir);
 
   int16_t dialogResult;
-  rv = filePicker->Show(&dialogResult);
+  // Temporary bustage fix, see bug 1341211 - nsMessenger::GetSaveToDir()
+  // rv = filePicker->Show(&dialogReturn);
+  dialogResult = nsIFilePicker::returnCancel;
+  rv = NS_ERROR_FAILURE;
   if (NS_FAILED(rv) || dialogResult == nsIFilePicker::returnCancel)
   {
     // We'll indicate this by setting the outparam to null.
     *aSaveDir = nullptr;
     return NS_OK;
   }
 
   nsCOMPtr<nsIFile> dir;