epiphany r8153 - branches/gnome-2-22/embed/mozilla
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: epiphany r8153 - branches/gnome-2-22/embed/mozilla
- Date: Fri, 28 Mar 2008 15:08:19 +0000 (GMT)
Author: chpe
Date: Fri Mar 28 15:08:18 2008
New Revision: 8153
URL: http://svn.gnome.org/viewvc/epiphany?rev=8153&view=rev
Log:
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.
Modified:
branches/gnome-2-22/embed/mozilla/ContentHandler.cpp
branches/gnome-2-22/embed/mozilla/MozDownload.cpp
Modified: branches/gnome-2-22/embed/mozilla/ContentHandler.cpp
==============================================================================
--- branches/gnome-2-22/embed/mozilla/ContentHandler.cpp (original)
+++ branches/gnome-2-22/embed/mozilla/ContentHandler.cpp Fri Mar 28 15:08:18 2008
@@ -416,14 +416,7 @@
mLauncher->GetMIMEInfo(getter_AddRefs(mimeInfo));
NS_ENSURE_TRUE (mimeInfo, NS_ERROR_FAILURE);
-#ifdef HAVE_GECKO_1_9
- nsHandlerInfoAction action;
- if (mAction == CONTENT_ACTION_DOWNLOAD) {
- action = EPHY_ACTION_BROWSE_TO_FILE;
- } else {
- action = nsIMIMEInfo::useSystemDefault;
- }
-#else
+#ifndef HAVE_GECKO_1_9
char *info = NULL;
if (mAction == CONTENT_ACTION_OPEN)
@@ -478,5 +471,20 @@
mLauncher->SaveToDisk (nsnull, PR_FALSE);
}
+#ifdef HAVE_GECKO_1_9
+ /* We have to do this work down here because the external helper app modifies the
+ * value after calling SaveToDisk.
+ */
+ nsHandlerInfoAction action;
+ if (mAction == CONTENT_ACTION_DOWNLOAD) {
+ action = EPHY_ACTION_BROWSE_TO_FILE;
+
+ /* This won't be able to transport the activation time so we cannot
+ * do startup notification, but it's the best that was available
+ */
+ mimeInfo->SetPreferredAction (action);
+ }
+#endif
+
return NS_OK;
}
Modified: branches/gnome-2-22/embed/mozilla/MozDownload.cpp
==============================================================================
--- branches/gnome-2-22/embed/mozilla/MozDownload.cpp (original)
+++ branches/gnome-2-22/embed/mozilla/MozDownload.cpp Fri Mar 28 15:08:18 2008
@@ -351,26 +351,22 @@
{
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]