From 025c7959e438aad9770f9aa801b6ead6e19e79dd Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 28 Oct 2003 11:33:19 +0000 Subject: Open source in the default editor and remove the unused copy api. Add a 2003-10-28 Marco Pesenti Gritti * embed/ephy-embed-persist.h: * embed/ephy-embed.c: * embed/ephy-embed.h: * embed/ephy-favicon-cache.c: (ephy_favicon_cache_download): * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/EphyHeaderSniffer.cpp: * embed/mozilla/EphyHeaderSniffer.h: * embed/mozilla/MozDownload.cpp: * embed/mozilla/MozDownload.h: * embed/mozilla/mozilla-embed-persist.cpp: * embed/mozilla/mozilla-embed.cpp: * src/ephy-shell.c: (delete_files), (ephy_shell_finalize), (ephy_shell_new_tab), (ephy_shell_delete_on_exit): * src/ephy-shell.h: * src/window-commands.c: (get_editor_application), (editor_open_uri), (save_source_completed_cb), (editor_can_open_uri), (save_temp_source), (window_cmd_view_page_source): Open source in the default editor and remove the unused copy api. Add a missing include while at it. --- embed/mozilla/MozDownload.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'embed/mozilla/MozDownload.cpp') diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp index 63901ee35..875d11e3b 100644 --- a/embed/mozilla/MozDownload.cpp +++ b/embed/mozilla/MozDownload.cpp @@ -385,10 +385,13 @@ MozDownload::Resume() nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI, nsILocalFile* inDestFile, const char *contentType, nsIURI* inOriginalURI, MozillaEmbedPersist *embedPersist, - PRBool bypassCache, nsIInputStream *postData) + nsIInputStream *postData, nsISupports *aCacheKey) { nsresult rv = NS_OK; + EmbedPersistFlags ephy_flags; + ephy_flags = ephy_embed_persist_get_flags (EPHY_EMBED_PERSIST (embedPersist)); + PRBool isHTML = (domDocument && contentType && (strcmp (contentType, "text/html") == 0 || strcmp (contentType, "text/xml") == 0 || @@ -410,20 +413,15 @@ nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI PRInt32 flags = nsIWebBrowserPersist::PERSIST_FLAGS_NO_CONVERSION | nsIWebBrowserPersist::PERSIST_FLAGS_REPLACE_EXISTING_FILES; - if (bypassCache) - { - flags |= nsIWebBrowserPersist::PERSIST_FLAGS_BYPASS_CACHE; - } - else + if (ephy_flags & EMBED_PERSIST_COPY_PAGE) { flags |= nsIWebBrowserPersist::PERSIST_FLAGS_FROM_CACHE; } - webPersist->SetPersistFlags(flags); - - if (!isHTML) + + if (!isHTML || ephy_flags & EMBED_PERSIST_COPY_PAGE) { - rv = webPersist->SaveURI (sourceURI, nsnull, nsnull, + rv = webPersist->SaveURI (sourceURI, aCacheKey, nsnull, postData, nsnull, inDestFile); } else -- cgit v1.2.3