Fix conversion from uri to file
This commit is contained in:
parent
aa8debb4cb
commit
da7606e681
@ -1,6 +1,8 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <nsIFactory.h>
|
||||
#include <nsIFile.h>
|
||||
#include <nsIFileURL.h>
|
||||
|
||||
#include "sugar-download-manager.h"
|
||||
|
||||
@ -47,12 +49,19 @@ GeckoDownload::Init (nsIURI *aSource,
|
||||
nsICancelable *aCancelable)
|
||||
{
|
||||
mSource = aSource;
|
||||
aTarget->GetPath (mTargetFileName);
|
||||
mMIMEInfo = aMIMEInfo;
|
||||
mTempFile = aTempFile;
|
||||
// mCancelable = aCancelable; Just a reminder for when we implement cancelling downloads.
|
||||
|
||||
return NS_OK;
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(aTarget);
|
||||
NS_ENSURE_TRUE(fileURL, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIFile> file;
|
||||
rv = fileURL->GetFile(getter_AddRefs(file));
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||
|
||||
file->GetNativePath (mTargetFileName);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
Loading…
Reference in New Issue
Block a user