ALT Linux Bugzilla
– Attachment 3890 Details for
Bug 21511
Firefox KDE4 integration
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
mozilla-helper-app.patch
mozilla-helper-app.patch (text/plain), 4.01 KB, created by
Zerg
on 2009-09-15 23:38:05 MSD
(
hide
)
Description:
mozilla-helper-app.patch
Filename:
MIME Type:
Creator:
Zerg
Created:
2009-09-15 23:38:05 MSD
Size:
4.01 KB
patch
obsolete
>From: Wolfgang Rosenauer <wr@rosenauer.org> >Subject: no helper app for application/octet-stream but recognized extensions >References: >https://bugzilla.novell.com/show_bug.cgi?id=406979 >https://bugzilla.mozilla.org/show_bug.cgi?id=327323 > >Index: uriloader/exthandler/nsMIMEInfoImpl.cpp >=================================================================== >RCS file: /cvsroot/mozilla/uriloader/exthandler/nsMIMEInfoImpl.cpp,v >retrieving revision 1.69 >diff -u -p -6 -r1.69 nsMIMEInfoImpl.cpp >--- uriloader/exthandler/nsMIMEInfoImpl.cpp 19 Oct 2007 04:15:43 -0000 1.69 >+++ uriloader/exthandler/nsMIMEInfoImpl.cpp 20 Aug 2008 15:45:32 -0000 >@@ -408,13 +408,13 @@ nsMIMEInfoBase::LaunchWithURI(nsIURI* aU > } > > void > nsMIMEInfoBase::CopyBasicDataTo(nsMIMEInfoBase* aOther) > { > aOther->mType = mType; >- aOther->mDefaultAppDescription = mDefaultAppDescription; >+ //aOther->mDefaultAppDescription = mDefaultAppDescription; > aOther->mExtensions = mExtensions; > > aOther->mMacType = mMacType; > aOther->mMacCreator = mMacCreator; > } > >Index: uriloader/exthandler/unix/nsOSHelperAppService.cpp >=================================================================== >RCS file: /cvsroot/mozilla/uriloader/exthandler/unix/nsOSHelperAppService.cpp,v >retrieving revision 1.74 >diff -u -p -6 -r1.74 nsOSHelperAppService.cpp >--- uriloader/exthandler/unix/nsOSHelperAppService.cpp 20 Feb 2008 06:10:33 -0000 1.74 >+++ uriloader/exthandler/unix/nsOSHelperAppService.cpp 20 Aug 2008 15:45:33 -0000 >@@ -1621,12 +1621,16 @@ nsOSHelperAppService::GetMIMEInfoFromOS( > > return retval; > } > > // Copy the attributes of retval onto miByExt, to return it > retval->CopyBasicDataTo(miByExt); >+ // But set the extensions primary since CopyBasicDataTo overwrites the >+ // list >+ if (!aFileExt.IsEmpty()) >+ retval->SetPrimaryExtension(aFileExt); > > miByExt.swap(retval); > } > return retval; > } > >--- uriloader/exthandler/unix/nsMIMEInfoUnix.cpp.orig 2008-10-01 00:19:35.000000000 +0200 >+++ uriloader/exthandler/unix/nsMIMEInfoUnix.cpp 2008-10-01 00:22:16.000000000 +0200 >@@ -46,12 +46,13 @@ > #include "nsMIMEInfoUnix.h" > #include "nsGNOMERegistry.h" > #include "nsIGnomeVFSService.h" > #ifdef MOZ_ENABLE_DBUS > #include "nsDBusHandlerApp.h" > #endif >+#include "nsAutoPtr.h" > > > nsresult > nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI) > { > nsresult rv = nsGNOMERegistry::LoadURL(aURI); >@@ -71,19 +72,22 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI * > } > > NS_IMETHODIMP > nsMIMEInfoUnix::GetHasDefaultHandler(PRBool *_retval) > { > *_retval = PR_FALSE; >- nsCOMPtr<nsIGnomeVFSService> vfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); >- if (vfs) { >- nsCOMPtr<nsIGnomeVFSMimeApp> app; >- if (NS_SUCCEEDED(vfs->GetAppForMimeType(mType, getter_AddRefs(app))) && app) >- *_retval = PR_TRUE; >+ nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mType); >+ if (!mimeInfo) { >+ nsCAutoString ext; >+ GetPrimaryExtension(ext); >+ mimeInfo = nsGNOMERegistry::GetFromExtension(ext); > } > >+ if (mimeInfo) >+ *_retval = PR_TRUE; >+ > if (*_retval) > return NS_OK; > > #ifdef MOZ_PLATFORM_HILDON > HildonURIAction *action = hildon_uri_get_default_action(mType.get(), nsnull); > if (action) { >@@ -106,12 +110,22 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns > nsCOMPtr<nsIGnomeVFSService> vfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); > > if (vfs) { > nsCOMPtr<nsIGnomeVFSMimeApp> app; > if (NS_SUCCEEDED(vfs->GetAppForMimeType(mType, 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 = nsGNOMERegistry::GetFromExtension(nativePath); >+ if (mimeInfo) { >+ nsCAutoString type; >+ mimeInfo->GetType(type); >+ if (NS_SUCCEEDED(vfs->GetAppForMimeType(type, getter_AddRefs(app))) && app) >+ return app->Launch(nativePath); >+ } > } > > if (!mDefaultApplication) > return NS_ERROR_FILE_NOT_FOUND; > > return LaunchWithIProcess(mDefaultApplication, nativePath);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 21511
:
3870
|
3889
| 3890 |
3891