Backing out...saving for a rainy day...

This commit is contained in:
blakeross%telocity.com 2002-03-17 07:23:42 +00:00
Родитель 35776d958b
Коммит 58584dc782
5 изменённых файлов: 36 добавлений и 60 удалений

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

@ -9,4 +9,3 @@ nsIURILoader.idl
nsIDocumentLoader.idl
nsIWebProgress.idl
nsIWebProgressListener.idl
nsIDownload.idl

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

@ -54,7 +54,6 @@ XPIDLSRCS = \
nsIURIContentListener.idl \
nsIURILoader.idl \
nsCURILoader.idl \
nsIDownload.idl \
nsIDocumentLoader.idl \
nsIWebProgress.idl \
nsIWebProgressListener.idl \

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

@ -51,7 +51,6 @@ XPIDLSRCS= \
.\nsIDocumentLoader.idl \
.\nsIWebProgress.idl \
.\nsIWebProgressListener.idl \
.\nsIDownload.idl \
$(NULL)
LIBRARY_NAME=uriloaderbase_s

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

@ -39,7 +39,6 @@
#include "nsCURILoader.h"
#include "nsIWebProgress.h"
#include "nsIWebProgressListener.h"
#include "nsIDownload.h"
#include "nsReadableUtils.h"
// used to manage our in memory data source of helper applications
@ -1385,42 +1384,52 @@ nsresult nsExternalAppHandler::ShowProgressDialog()
{
// we are back from the helper app dialog (where the user chooses to save or open), but we aren't
// done processing the load. in this case, throw up a progress dialog so the user can see what's going on...
nsresult rv;
nsCOMPtr<nsILocalFile> local = do_QueryInterface(mFinalFileDestination);
nsresult rv = NS_OK;
nsCOMPtr<nsIDownload> dl = do_CreateInstance("@mozilla.org/download;1", &rv);
if (NS_FAILED(rv)) return rv;
nsXPIDLString openWith(NS_LITERAL_STRING(""));
nsMIMEInfoHandleAction action = nsIMIMEInfo::saveToDisk;
mMimeInfo->GetPreferredAction(&action);
if (action != nsIMIMEInfo::saveToDisk)
nsCOMPtr<nsIProgressDialog> progressDlg = do_CreateInstance( "@mozilla.org/progressdialog;1", &rv );
if (progressDlg)
{
// Opening with an application; use either description or application file name.
mMimeInfo->GetApplicationDescription(getter_Copies(openWith));
if (openWith.IsEmpty())
// Wire up this progress dialog.
progressDlg->SetSource( mSourceUrl );
progressDlg->SetStartTime( mTimeDownloadStarted );
progressDlg->SetObserver(this);
nsCOMPtr<nsILocalFile> local = do_QueryInterface(mFinalFileDestination);
progressDlg->SetTarget(local);
nsMIMEInfoHandleAction action = nsIMIMEInfo::saveToDisk;
mMimeInfo->GetPreferredAction(&action);
if (action != nsIMIMEInfo::saveToDisk)
{
nsCOMPtr<nsIFile> appl;
mMimeInfo->GetPreferredApplicationHandler(getter_AddRefs(appl));
if (appl)
// Opening with an application; use either description or application file name.
nsXPIDLString openWith;
mMimeInfo->GetApplicationDescription(getter_Copies(openWith));
if (openWith.IsEmpty())
{
nsCOMPtr<nsILocalFile> file = do_QueryInterface(appl);
if (file)
nsCOMPtr<nsIFile> appl;
mMimeInfo->GetPreferredApplicationHandler(getter_AddRefs(appl));
if (appl)
{
file->GetUnicodeLeafName(getter_Copies(openWith));
nsCOMPtr<nsILocalFile> file = do_QueryInterface(appl);
if (file)
{
file->GetUnicodeLeafName(getter_Copies(openWith));
}
}
}
// Tell progress dialog what we're opening with.
progressDlg->SetOpeningWith(openWith);
}
// Open the dialog.
rv = progressDlg->Open(nsnull, nsnull);
if(NS_SUCCEEDED(rv))
{
// Send notifications to the dialog.
this->SetWebProgressListener(progressDlg);
}
}
rv = dl->Init(mSourceUrl, local, nsnull, openWith, mTimeDownloadStarted, nsnull);
if (NS_FAILED(rv)) return rv;
dl->SetObserver(this);
nsCOMPtr<nsIWebProgressListener> listener = do_QueryInterface(dl);
if (listener)
SetWebProgressListener(listener);
return rv;
}

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

@ -727,13 +727,6 @@
<FILEKIND>Text</FILEKIND>
<FILEFLAGS></FILEFLAGS>
</FILE>
<FILE>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsIDownload.idl</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS></FILEFLAGS>
</FILE>
<FILE>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsCURILoader.idl</PATH>
@ -804,11 +797,6 @@
<PATH>nsIURILoader.idl</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
<FILEREF>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsIDownload.idl</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
<FILEREF>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsCURILoader.idl</PATH>
@ -1530,13 +1518,6 @@
<FILEKIND>Text</FILEKIND>
<FILEFLAGS></FILEFLAGS>
</FILE>
<FILE>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsIDownload.idl</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS></FILEFLAGS>
</FILE>
<FILE>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsCURILoader.idl</PATH>
@ -1607,11 +1588,6 @@
<PATH>nsIURILoader.idl</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
<FILEREF>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsIDownload.idl</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
<FILEREF>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsCURILoader.idl</PATH>
@ -1703,12 +1679,6 @@
<PATH>nsIURILoader.idl</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
<FILEREF>
<TARGETNAME>headers</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsIDownload.idl</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
<FILEREF>
<TARGETNAME>headers</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>