aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozDownload.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2008-03-15 00:28:03 +0800
committerChristian Persch <chpe@src.gnome.org>2008-03-15 00:28:03 +0800
commit23e91b40fa63f80ed4bb5e3c2eb44d485974dd67 (patch)
treeacf45743ae15bfa7f7e8b2904cfe5f0752849048 /embed/mozilla/MozDownload.cpp
parent857bd1e30ed30708dbb5b8d30a80bb438d048d15 (diff)
downloadgsoc2013-epiphany-23e91b40fa63f80ed4bb5e3c2eb44d485974dd67.tar
gsoc2013-epiphany-23e91b40fa63f80ed4bb5e3c2eb44d485974dd67.tar.gz
gsoc2013-epiphany-23e91b40fa63f80ed4bb5e3c2eb44d485974dd67.tar.bz2
gsoc2013-epiphany-23e91b40fa63f80ed4bb5e3c2eb44d485974dd67.tar.lz
gsoc2013-epiphany-23e91b40fa63f80ed4bb5e3c2eb44d485974dd67.tar.xz
gsoc2013-epiphany-23e91b40fa63f80ed4bb5e3c2eb44d485974dd67.tar.zst
gsoc2013-epiphany-23e91b40fa63f80ed4bb5e3c2eb44d485974dd67.zip
Remove the unnecessary setting of the preffered action in the casees that action was going to be the default one anyway. Don't open twice, just let gecko handle opening in the preferred application.
Browse-to doesn't seem to work yet. svn path=/trunk/; revision=8106
Diffstat (limited to 'embed/mozilla/MozDownload.cpp')
-rw-r--r--embed/mozilla/MozDownload.cpp36
1 files changed, 16 insertions, 20 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index d24bcb25c..943da0ff8 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -351,26 +351,22 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
{
NS_ENSURE_TRUE (mMIMEInfo, NS_ERROR_FAILURE);
#ifdef HAVE_GECKO_1_9
- nsHandlerInfoAction action;
- mMIMEInfo->GetPreferredAction(&action);
-
- nsCOMPtr<nsIInterfaceRequestor> req (do_QueryInterface (mRequest));
-
- if (action == EPHY_ACTION_BROWSE_TO_FILE) {
- nsCString destSpec;
- rv = mDestination->GetSpec (destSpec);
- NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
-
- GFile *dest;
- dest = g_file_new_for_uri (destSpec.get ());
- ephy_file_browse_to (dest, 0 /* FIXME BUG BUG BUG */);
- g_object_unref (dest);
- } else {
- rv = mMIMEInfo->LaunchWithURI (mDestination, req);
- NS_ENSURE_SUCCESS(rv, rv);
- }
-
- return NS_OK;
+ nsHandlerInfoAction action;
+ mMIMEInfo->GetPreferredAction(&action);
+
+ if (action == EPHY_ACTION_BROWSE_TO_FILE) {
+ nsCString destSpec;
+ rv = mDestination->GetSpec (destSpec);
+ NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
+
+ GFile *dest;
+ dest = g_file_new_for_uri (destSpec.get ());
+ ephy_file_browse_to (dest, 0 /* FIXME BUG BUG BUG */);
+ g_object_unref (dest);
+ }
+ /* All other values are handled by gecko itself */
+
+ return NS_OK;
#else
GDesktopAppInfo *helperApp;