Backout bug 1017028 / 99137515f12e. a=backout on SeaMonkey CLOSED TREE

This commit is contained in:
Sebastian Hengst 2015-02-17 18:51:43 +01:00
Родитель acf6090f82
Коммит f45ac030a8
9 изменённых файлов: 24 добавлений и 49 удалений

Просмотреть файл

@ -40,6 +40,8 @@ noNewMessages=There are no new messages.
# %2$S will receive the total number of messages
receivedMsgs=Received %1$S of %2$S messages
pop3OutOfDiskSpace=There is not enough disk space to download new messages. Try deleting old mail, emptying the Trash folder, and compacting your mail folders, and then try again.
# Status - parsing folder
#LOCALIZATION NOTE (buildingSummary): Do not translate %S in the following line.
# Place the word %S where the name of the mailbox should appear

Просмотреть файл

@ -96,7 +96,6 @@ verboseFolderFormat=%1$S on %2$S
filterFolderTruncateFailed=There was an error truncating the Inbox after filtering a message to folder '%1$S'. You may need to shutdown %2$S and delete INBOX.msf.
mailboxTooLarge=The folder %S is full, and can't hold any more messages. To make room for more messages, delete any old or unwanted mail and compact the folder.
outOfDiskSpace=There is not enough disk space to download new messages. Try deleting old mail, emptying the Trash folder, and compacting your mail folders, and then try again.
errorGettingDB=Unable to open the summary file for %S. Perhaps there was an error on disk, or the full path is too long.
defaultServerTag=(Default)

Просмотреть файл

@ -82,11 +82,6 @@ interface nsIMsgPluggableStore : nsISupports {
*
* @param aFolder folder we want to add messages to.
* @param aSpaceRequested How many bytes we're trying to add to the store.
*
* The function returns an exception if there is not enough space to
* indicate the reason of the shortage:
* NS_ERROR_FILE_TOO_BIG = the store cannot grow further due to internal limits
* NS_ERROR_FILE_DISK_FULL = there is not enough space on the disk
*/
boolean hasSpaceAvailable(in nsIMsgFolder aFolder,
in long long aSpaceRequested);

Просмотреть файл

@ -1469,10 +1469,14 @@ bool nsMsgLocalMailFolder::CheckIfSpaceForCopy(nsIMsgWindow *msgWindow,
bool isMove,
int64_t totalMsgSize)
{
bool spaceNotAvailable = true;
nsresult rv = WarnIfLocalFileTooBig(msgWindow, totalMsgSize, &spaceNotAvailable);
if (NS_FAILED(rv) || spaceNotAvailable)
nsCOMPtr<nsIMsgPluggableStore> msgStore;
nsresult rv = GetMsgStore(getter_AddRefs(msgStore));
NS_ENSURE_SUCCESS(rv, false);
bool spaceAvailable;
rv = msgStore->HasSpaceAvailable(this, totalMsgSize, &spaceAvailable);
if (!spaceAvailable)
{
ThrowAlertMsg("mailboxTooLarge", msgWindow);
if (isMove && srcFolder)
srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgFailedAtom);
OnCopyCompleted(srcSupports, false);
@ -3715,12 +3719,11 @@ nsMsgLocalMailFolder::WarnIfLocalFileTooBig(nsIMsgWindow *aWindow,
bool spaceAvailable = false;
// check if we have a reasonable amount of space left
rv = msgStore->HasSpaceAvailable(this, aSpaceRequested, &spaceAvailable);
if (NS_SUCCEEDED(rv) && spaceAvailable) {
*aTooBig = false;
} else if (rv == NS_ERROR_FILE_TOO_BIG) {
if (NS_FAILED(rv) || !spaceAvailable)
{
ThrowAlertMsg("mailboxTooLarge", aWindow);
} else {
ThrowAlertMsg("outOfDiskSpace", aWindow);
*aTooBig = false;
}
return NS_OK;
}

Просмотреть файл

@ -196,18 +196,13 @@ NS_IMETHODIMP nsMsgBrkMBoxStore::HasSpaceAvailable(nsIMsgFolder *aFolder,
nsresult rv = aFolder->GetFilePath(getter_AddRefs(pathFile));
NS_ENSURE_SUCCESS(rv, rv);
// Allow the mbox to only reach 0xFFC00000 = 4 GiB - 4 MiB for now.
// This limit can be increased after bug 789679 is fixed.
int64_t fileSize;
rv = pathFile->GetFileSize(&fileSize);
NS_ENSURE_SUCCESS(rv, rv);
*aResult = ((fileSize + aSpaceRequested) < 0xFFC00000);
if (!*aResult)
return NS_ERROR_FILE_TOO_BIG;
*aResult = DiskSpaceAvailableInStore(pathFile, aSpaceRequested);
if (!*aResult)
return NS_ERROR_FILE_DISK_FULL;
// Allow the mbox to only reach 0xFFC00000 = 4 GiB - 4 MiB for now.
*aResult = ((fileSize + aSpaceRequested) < 0xFFC00000) &&
DiskSpaceAvailableInStore(pathFile, aSpaceRequested);
return NS_OK;
}

Просмотреть файл

@ -263,19 +263,7 @@ NS_IMETHODIMP nsMsgMaildirStore::HasSpaceAvailable(nsIMsgFolder *aFolder,
nsresult rv = aFolder->GetFilePath(getter_AddRefs(pathFile));
NS_ENSURE_SUCCESS(rv, rv);
// Allow the folder to only reach 0xFFC00000 = 4 GiB - 4 MiB for now.
// This limit can be increased after bug 1078367 is fixed.
uint32_t folderSize;
rv = aFolder->GetSizeOnDisk(&folderSize);
NS_ENSURE_SUCCESS(rv, rv);
*aResult = (0xFFC00000ULL - aSpaceRequested > folderSize);
if (!*aResult)
return NS_ERROR_FILE_TOO_BIG;
*aResult = DiskSpaceAvailableInStore(pathFile, aSpaceRequested);
if (!*aResult)
return NS_ERROR_FILE_DISK_FULL;
return NS_OK;
}

Просмотреть файл

@ -31,7 +31,6 @@
#include "nsCOMPtr.h"
#include "nsIMsgWindow.h"
#include "nsIMsgFolder.h" // TO include biffState enum. Change to bool later...
#include "nsIMsgLocalMailFolder.h"
#include "nsIDocShell.h"
#include "nsMsgUtils.h"
#include "nsISocketTransport.h"
@ -2933,25 +2932,18 @@ int32_t nsPop3Protocol::GetMsg()
if (NS_FAILED(rv))
return -1;
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(m_url, &rv);
if (NS_FAILED(rv) || !mailnewsUrl)
return -1;
nsCOMPtr<nsIMsgWindow> msgWindow;
(void)mailnewsUrl->GetMsgWindow(getter_AddRefs(msgWindow));
bool spaceNotAvailable = true;
nsCOMPtr<nsIMsgLocalMailFolder> localFolder(do_QueryInterface(folder, &rv));
if (NS_FAILED(rv) || !localFolder)
return -1;
nsCOMPtr<nsIMsgPluggableStore> msgStore;
rv = folder->GetMsgStore(getter_AddRefs(msgStore));
NS_ENSURE_SUCCESS(rv, -1);
bool spaceAvailable;
// check if we have a reasonable amount of space left
rv = localFolder->WarnIfLocalFileTooBig(msgWindow, m_totalDownloadSize, &spaceNotAvailable);
if (NS_FAILED(rv) || spaceNotAvailable) {
rv = msgStore->HasSpaceAvailable(folder, m_totalDownloadSize, &spaceAvailable);
if (NS_FAILED(rv) || !spaceAvailable) {
#ifdef DEBUG
printf("Not enough disk space! Raising error!\n");
#endif
return -1;
return Error("pop3OutOfDiskSpace");
}
// Here we know how many messages we're going to download, so let

Просмотреть файл

@ -40,6 +40,8 @@ noNewMessages=There are no new messages.
# %2$S will receive the total number of messages
receivedMsgs=Received %1$S of %2$S messages
pop3OutOfDiskSpace=There is not enough disk space to download new messages. Try deleting old mail, emptying the Trash folder, and compacting your mail folders, and then try again.
# Status - parsing folder
#LOCALIZATION NOTE (buildingSummary): Do not translate %S in the following line.
# Place the word %S where the name of the mailbox should appear

Просмотреть файл

@ -93,7 +93,6 @@ verboseFolderFormat=%1$S on %2$S
filterFolderTruncateFailed=There was an error truncating the Inbox after filtering a message to folder '%1$S'. You may need to shutdown %2$S and delete INBOX.msf.
mailboxTooLarge=The folder %S is full, and can't hold any more messages. To make room for more messages, delete any old or unwanted mail and compact the folder.
outOfDiskSpace=There is not enough disk space to download new messages. Try deleting old mail, emptying the Trash folder, and compacting your mail folders, and then try again.
errorGettingDB=Unable to open the summary file for '%S'. Perhaps there was an error on disk, or the full path is too long.
defaultServerTag=(Default)