aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorNguyen Thai Ngoc Duy <pclouds@src.gnome.org>2007-07-11 21:23:33 +0800
committerNguyen Thai Ngoc Duy <pclouds@src.gnome.org>2007-07-11 21:23:33 +0800
commit2f0d425780b73d51897552f3d6d0fe19be979b23 (patch)
tree79e4028829593f5d40e1fbd08d174b3793ea1180 /embed/mozilla
parent2f2d7c441a41193f0dd2fcf2818d523ea4d551bd (diff)
downloadgsoc2013-epiphany-2f0d425780b73d51897552f3d6d0fe19be979b23.tar
gsoc2013-epiphany-2f0d425780b73d51897552f3d6d0fe19be979b23.tar.gz
gsoc2013-epiphany-2f0d425780b73d51897552f3d6d0fe19be979b23.tar.bz2
gsoc2013-epiphany-2f0d425780b73d51897552f3d6d0fe19be979b23.tar.lz
gsoc2013-epiphany-2f0d425780b73d51897552f3d6d0fe19be979b23.tar.xz
gsoc2013-epiphany-2f0d425780b73d51897552f3d6d0fe19be979b23.tar.zst
gsoc2013-epiphany-2f0d425780b73d51897552f3d6d0fe19be979b23.zip
Fixes bug #452707
svn path=/trunk/; revision=7151
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/MozDownload.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index 31cdb99dc..b1de84944 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -633,19 +633,24 @@ nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI
nsCString cPath;
inDestFile->GetNativePath (cPath);
- GString *path = g_string_new (cPath.get());
- char *dot_pos = strchr (path->str, '.');
+ char *basename = g_path_get_basename (cPath.get());
+ char *dirname = g_path_get_dirname (cPath.get());
+ char *dot_pos = strchr (basename, '.');
if (dot_pos)
{
- g_string_truncate (path, dot_pos - path->str);
+ *dot_pos = 0;
}
- g_string_append (path, " ");
- g_string_append (path, _("Files"));
+ /* translators: this is the directory name to store auxilary files when saving html files */
+ char *new_basename = g_strdup_printf (_("%s Files"), basename);
+ char *new_path = g_build_filename (dirname, new_basename, NULL);
+ g_free (new_basename);
+ g_free (basename);
+ g_free (dirname);
filesFolder = do_CreateInstance ("@mozilla.org/file/local;1");
- filesFolder->InitWithNativePath (nsCString(path->str));
+ filesFolder->InitWithNativePath (nsCString(new_path));
- g_string_free (path, TRUE);
+ g_free (new_path);
rv = webPersist->SaveDocument (domDocument, inDestFile, filesFolder,
contentType, encodingFlags, 80);