aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozDownload.cpp
diff options
context:
space:
mode:
authorWouter Bolsterlee <wbolster@gnome.org>2006-10-15 22:05:40 +0800
committerWouter Bolsterlee <wbolster@src.gnome.org>2006-10-15 22:05:40 +0800
commitc1e9da9eed75fc314c113000d7fe01e7de1ae913 (patch)
tree8fe52c695808de3066e5a3652035b0406463f0fe /embed/mozilla/MozDownload.cpp
parentccb73eb4348e4fb957fe4a2f8ed5ca7eac6835d9 (diff)
downloadgsoc2013-epiphany-c1e9da9eed75fc314c113000d7fe01e7de1ae913.tar
gsoc2013-epiphany-c1e9da9eed75fc314c113000d7fe01e7de1ae913.tar.gz
gsoc2013-epiphany-c1e9da9eed75fc314c113000d7fe01e7de1ae913.tar.bz2
gsoc2013-epiphany-c1e9da9eed75fc314c113000d7fe01e7de1ae913.tar.lz
gsoc2013-epiphany-c1e9da9eed75fc314c113000d7fe01e7de1ae913.tar.xz
gsoc2013-epiphany-c1e9da9eed75fc314c113000d7fe01e7de1ae913.tar.zst
gsoc2013-epiphany-c1e9da9eed75fc314c113000d7fe01e7de1ae913.zip
Automatically open a Nautilus window after downloading has finished. Fixes
2006-10-15 Wouter Bolsterlee <wbolster@gnome.org> * embed/mozilla/ContentHandler.cpp: * embed/mozilla/MozDownload.cpp: * lib/ephy-file-helpers.c: (ephy_file_browse_to): * lib/ephy-file-helpers.h: * src/popup-commands.c: (save_property_url_completed_cb), (save_property_url): Automatically open a Nautilus window after downloading has finished. Fixes bug #138876, patch by Ed Catmur.
Diffstat (limited to 'embed/mozilla/MozDownload.cpp')
-rw-r--r--embed/mozilla/MozDownload.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index 673aa5788..bf1a1c28f 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -357,6 +357,23 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
gnome_vfs_mime_application_free (helperApp);
g_strfreev (str);
}
+ else if (g_str_has_prefix (cDesc.get(), "gnome-browse-to-file:"))
+ {
+ /* Format gnome-browse-to-file:<usertime> */
+ char **str = g_strsplit (cDesc.get(), ":", -1);
+ g_return_val_if_fail (g_strv_length (str) == 2, NS_ERROR_FAILURE);
+
+ char *end;
+ guint32 user_time = strtoul (str[1], &end, 0);
+
+ nsCString aDest;
+ rv = mDestination->GetSpec (aDest);
+ NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
+
+ ephy_file_browse_to (aDest.get (), user_time);
+
+ g_strfreev (str);
+ }
}
}
@@ -519,6 +536,15 @@ nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI
EphyEmbedPersistFlags ephy_flags;
ephy_flags = ephy_embed_persist_get_flags (EPHY_EMBED_PERSIST (embedPersist));
+ if (!ephy_embed_persist_get_dest (EPHY_EMBED_PERSIST (embedPersist)))
+ {
+ nsCString cPath;
+ inDestFile->GetNativePath (cPath);
+
+ ephy_embed_persist_set_dest (EPHY_EMBED_PERSIST (embedPersist),
+ cPath.get());
+ }
+
PRBool isHTML = (contentType &&
(strcmp (contentType, "text/html") == 0 ||
strcmp (contentType, "text/xml") == 0 ||