From 90c267f298fd2c6abd646376593f5ce5caa694e1 Mon Sep 17 00:00:00 2001 From: Christopher Aillon Date: Mon, 7 Feb 2011 18:22:22 -0800 Subject: Bring back the default browser check but we don't want the default of '/usr/lib{,64}/firefox-XYZ/firefox %s' change it to be simply 'firefox %s' --- firefox-default.patch | 111 ++++++++++++-------------------------------------- 1 file changed, 27 insertions(+), 84 deletions(-) (limited to 'firefox-default.patch') diff --git a/firefox-default.patch b/firefox-default.patch index 6a1d83b..bd631bb 100644 --- a/firefox-default.patch +++ b/firefox-default.patch @@ -1,91 +1,34 @@ -diff -up firefox-4.0/mozilla-central/browser/components/preferences/advanced.xul.default firefox-4.0/mozilla-central/browser/components/preferences/advanced.xul ---- firefox-4.0/mozilla-central/browser/components/preferences/advanced.xul.default 2010-08-06 03:08:58.000000000 +0200 -+++ firefox-4.0/mozilla-central/browser/components/preferences/advanced.xul 2010-08-30 16:35:21.000000000 +0200 -@@ -183,10 +183,11 @@ - - - #ifdef HAVE_SHELL_SERVICE -+#ifdef MOZ_CRASHREPORTER - - - +diff -up mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp.default mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp +--- mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp.default 2011-02-07 14:53:16.883934747 -0800 ++++ mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp 2011-02-07 17:11:55.209941360 -0800 +@@ -104,8 +104,6 @@ static const char kDesktopColorKey[] = D + nsresult + nsGNOMEShellService::Init() + { +- nsresult rv; - -+#ifdef 0 - - - -+#endif - #ifdef MOZ_CRASHREPORTER - - #endif -+#endif - + // GConf _must_ be available, or we do not allow + // CreateInstance to succeed. - -diff -up firefox-4.0/mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp.default firefox-4.0/mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp ---- firefox-4.0/mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp.default 2010-08-06 03:08:59.000000000 +0200 -+++ firefox-4.0/mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp 2010-08-30 16:37:41.000000000 +0200 -@@ -140,27 +140,21 @@ NS_IMPL_ISUPPORTS1(nsGNOMEShellService, - PRBool - nsGNOMEShellService::KeyMatchesAppName(const char *aKeyValue) const - { -+ nsCAutoString appName; +@@ -120,19 +118,9 @@ nsGNOMEShellService::Init() + // the locale encoding. If it's not set, they use UTF-8. + mUseLocaleFilenames = PR_GetEnv("G_BROKEN_FILENAMES") != nsnull; -- gchar *commandPath; - if (mUseLocaleFilenames) { - gchar *nativePath = g_filename_from_utf8(aKeyValue, -1, NULL, NULL, NULL); - if (!nativePath) { - NS_ERROR("Error converting path to filesystem encoding"); - return PR_FALSE; - } -- -- commandPath = g_find_program_in_path(nativePath); -+ appName.Assign(nativePath); - g_free(nativePath); - } else { -- commandPath = g_find_program_in_path(aKeyValue); -+ appName.Assign(aKeyValue); - } +- nsCOMPtr dirSvc +- (do_GetService("@mozilla.org/file/directory_service;1")); +- NS_ENSURE_TRUE(dirSvc, NS_ERROR_NOT_AVAILABLE); - -- if (!commandPath) -- return PR_FALSE; +- nsCOMPtr appPath; +- rv = dirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsILocalFile), +- getter_AddRefs(appPath)); +- NS_ENSURE_SUCCESS(rv, rv); ++ mAppPath.Assign(NS_LITERAL_CSTRING(MOZ_APP_NAME)); + +- rv = appPath->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_NAME)); +- NS_ENSURE_SUCCESS(rv, rv); - -- PRBool matches = mAppPath.Equals(commandPath); -- g_free(commandPath); -- return matches; -+ // Compare default browser command retrieved from gconf with MOZ_APP_NAME -+ return appName.EqualsLiteral(MOZ_APP_NAME); +- return appPath->GetNativePath(mAppPath); ++ return NS_OK; } - NS_IMETHODIMP -@@ -215,8 +209,8 @@ nsGNOMEShellService::SetDefaultBrowser(P - - nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); - if (gconf) { -- nsCAutoString appKeyValue(mAppPath); -- appKeyValue.Append(" \"%s\""); -+ nsCAutoString appKeyValue(MOZ_APP_NAME); -+ appKeyValue.Append(" %s"); - for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) { - if (appProtocols[i].essential || aClaimAllTypes) { - gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name), -diff -up firefox-4.0/mozilla-central/browser/components/shell/src/nsGNOMEShellService.h.default firefox-4.0/mozilla-central/browser/components/shell/src/nsGNOMEShellService.h ---- firefox-4.0/mozilla-central/browser/components/shell/src/nsGNOMEShellService.h.default 2010-08-06 03:08:59.000000000 +0200 -+++ firefox-4.0/mozilla-central/browser/components/shell/src/nsGNOMEShellService.h 2010-08-30 16:35:22.000000000 +0200 -@@ -43,7 +43,7 @@ - class nsGNOMEShellService : public nsIShellService - { - public: -- nsGNOMEShellService() : mCheckedThisSession(PR_FALSE) { } -+ nsGNOMEShellService() : mCheckedThisSession(PR_TRUE) { } - - NS_DECL_ISUPPORTS - NS_DECL_NSISHELLSERVICE + NS_IMPL_ISUPPORTS1(nsGNOMEShellService, nsIShellService) -- cgit