aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-04-17 01:46:28 +0800
committerChristian Persch <chpe@src.gnome.org>2004-04-17 01:46:28 +0800
commit541b7314842c98d5efe91c18e8891451ef0b6454 (patch)
tree87361d4c759aec53283f3b74f7f989027c5aa941
parentaf197fd551f8213bd4bfcd1dd3597806314a9b44 (diff)
downloadgsoc2013-epiphany-541b7314842c98d5efe91c18e8891451ef0b6454.tar
gsoc2013-epiphany-541b7314842c98d5efe91c18e8891451ef0b6454.tar.gz
gsoc2013-epiphany-541b7314842c98d5efe91c18e8891451ef0b6454.tar.bz2
gsoc2013-epiphany-541b7314842c98d5efe91c18e8891451ef0b6454.tar.lz
gsoc2013-epiphany-541b7314842c98d5efe91c18e8891451ef0b6454.tar.xz
gsoc2013-epiphany-541b7314842c98d5efe91c18e8891451ef0b6454.tar.zst
gsoc2013-epiphany-541b7314842c98d5efe91c18e8891451ef0b6454.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: (InitiateMozillaDownload): Fix saving of linked content. Don't create the directory; mozilla will do it for us if necessary. Make the "Files" suffix translatable.
-rw-r--r--ChangeLog7
-rw-r--r--embed/mozilla/MozDownload.cpp19
2 files changed, 15 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a28dcba3..546d66ad5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-04-16 Christian Persch <chpe@cvs.gnome.org>
+
+ * embed/mozilla/MozDownload.cpp: (InitiateMozillaDownload):
+
+ Fix saving of linked content. Don't create the directory; mozilla
+ will do it for us if necessary. Make the "Files" suffix translatable.
+
2004-04-14 Christian Persch <chpe@cvs.gnome.org>
* lib/ephy-file-chooser.c: (ephy_file_chooser_constructor),
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index b75add16d..c17c9d436 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,10 @@ nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI
nameMinusExt.Left(nameMinusExt, index);
}
- nameMinusExt += NS_LITERAL_STRING(" Files");
+ nameMinusExt += NS_LITERAL_STRING (" ");
+ nameMinusExt += NS_ConvertUTF8toUTF16 (_("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
{