Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4
mozilla-xulrunner20
mozilla-gio-launch-uri.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mozilla-gio-launch-uri.patch of Package mozilla-xulrunner20
# HG changeset patch # Parent 7d47a19639db505e19282ac69c305c636d0fec18 diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp @@ -53,16 +53,18 @@ #include "nsContentHandlerApp.h" #endif #endif #include "nsMIMEInfoUnix.h" #include "nsCommonRegistry.h" #include "nsIGIOService.h" #include "nsIGnomeVFSService.h" +#include "nsNetCID.h" +#include "nsIIOService.h" #include "nsAutoPtr.h" #ifdef MOZ_ENABLE_DBUS #include "nsDBusHandlerApp.h" #endif #if defined(XP_UNIX) && !defined(XP_MACOSX) #include "nsKDEUtils.h" #endif @@ -172,38 +174,47 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns } if (!mDefaultApplication) return NS_ERROR_FILE_NOT_FOUND; return LaunchWithIProcess(mDefaultApplication, nativePath); } nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); + nsCAutoString uriSpec; + if (giovfs) { + // nsGIOMimeApp->Launch wants a URI string instead of local file + nsCOMPtr<nsIIOService> ioservice = do_GetService(NS_IOSERVICE_CONTRACTID); + nsCOMPtr<nsIURI> uri; + ioservice->NewFileURI(aFile, getter_AddRefs(uri)); + uri->GetSpec(uriSpec); + } + nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); if (giovfs) { nsCOMPtr<nsIGIOMimeApp> app; if (NS_SUCCEEDED(giovfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app) - return app->Launch(nativePath); + return app->Launch(uriSpec); } else if (gnomevfs) { /* Fallback to GnomeVFS */ nsCOMPtr<nsIGnomeVFSMimeApp> app; if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app) return app->Launch(nativePath); } // If we haven't got an app we try to get a valid one by searching for the // extension mapped type nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromExtension(nativePath); if (mimeInfo) { nsCAutoString type; mimeInfo->GetType(type); if (giovfs) { nsCOMPtr<nsIGIOMimeApp> app; if (NS_SUCCEEDED(giovfs->GetAppForMimeType(type, getter_AddRefs(app))) && app) - return app->Launch(nativePath); + return app->Launch(uriSpec); } else if (gnomevfs) { nsCOMPtr<nsIGnomeVFSMimeApp> app; if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(type, getter_AddRefs(app))) && app) return app->Launch(nativePath); } } if (!mDefaultApplication)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor