aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-04-17 01:51:14 +0800
committerChristian Persch <chpe@src.gnome.org>2004-04-17 01:51:14 +0800
commit196e2ef0e21d62be54de74a66b5321ce12036efd (patch)
tree267e8d16c2e8165bc2fc75340b890b7644144588
parent88ed9f332854171763ad372fad9e4f7d1f718960 (diff)
downloadgsoc2013-epiphany-196e2ef0e21d62be54de74a66b5321ce12036efd.tar
gsoc2013-epiphany-196e2ef0e21d62be54de74a66b5321ce12036efd.tar.gz
gsoc2013-epiphany-196e2ef0e21d62be54de74a66b5321ce12036efd.tar.bz2
gsoc2013-epiphany-196e2ef0e21d62be54de74a66b5321ce12036efd.tar.lz
gsoc2013-epiphany-196e2ef0e21d62be54de74a66b5321ce12036efd.tar.xz
gsoc2013-epiphany-196e2ef0e21d62be54de74a66b5321ce12036efd.tar.zst
gsoc2013-epiphany-196e2ef0e21d62be54de74a66b5321ce12036efd.zip
Fix saving of linked content. Don't create the directory; mozilla will do
2004-04-16 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/MozDownload.cpp: Fix saving of linked content. Don't create the directory; mozilla will do it for us if necessary.
-rw-r--r--ChangeLog7
-rw-r--r--embed/mozilla/MozDownload.cpp17
2 files changed, 13 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index ecca6a7cb..ead728444 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-04-16 Christian Persch <chpe@cvs.gnome.org>
+
+ * embed/mozilla/MozDownload.cpp:
+
+ Fix saving of linked content. Don't create the directory;
+ mozilla will do it for us if necessary.
+
2004-04-13 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/Makefile.am:
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index a5c37e0f3..571a937d0 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -503,10 +503,12 @@ nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI
PRInt32 encodingFlags = 0;
nsCOMPtr<nsILocalFile> filesFolder;
- if (contentType && strcmp (contentType, "text/plain") == 0)
+ if (!contentType || strcmp (contentType, "text/plain") != 0)
{
- /* Create a local directory in the same dir as our file. It
- will hold our associated files. */
+ /**
+ * Construct a directory path to hold the associated files; mozilla
+ * will create the directory as needed.
+ */
filesFolder = do_CreateInstance("@mozilla.org/file/local;1");
nsAutoString unicodePath;
@@ -522,15 +524,8 @@ nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI
nameMinusExt.Left(nameMinusExt, index);
}
- nameMinusExt += NS_LITERAL_STRING(" Files");
+ nameMinusExt += NS_LITERAL_STRING (" Files");
filesFolder->SetLeafName(nameMinusExt);
- PRBool exists = PR_FALSE;
- filesFolder->Exists(&exists);
- if (!exists)
- {
- rv = filesFolder->Create(nsILocalFile::DIRECTORY_TYPE, 0755);
- if (NS_FAILED(rv)) return rv;
- }
}
else
{