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'
This commit is contained in:
Christopher Aillon 2011-02-07 18:22:22 -08:00
parent 9226a3c56e
commit 90c267f298
2 changed files with 33 additions and 87 deletions

View File

@ -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 diff -up mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp.default mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp
--- firefox-4.0/mozilla-central/browser/components/preferences/advanced.xul.default 2010-08-06 03:08:58.000000000 +0200 --- mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp.default 2011-02-07 14:53:16.883934747 -0800
+++ firefox-4.0/mozilla-central/browser/components/preferences/advanced.xul 2010-08-30 16:35:21.000000000 +0200 +++ mozilla-central/browser/components/shell/src/nsGNOMEShellService.cpp 2011-02-07 17:11:55.209941360 -0800
@@ -183,10 +183,11 @@ @@ -104,8 +104,6 @@ static const char kDesktopColorKey[] = D
</groupbox> nsresult
nsGNOMEShellService::Init()
#ifdef HAVE_SHELL_SERVICE
+#ifdef MOZ_CRASHREPORTER
<!-- System Defaults -->
<groupbox id="systemDefaultsGroup" orient="vertical">
<caption label="&systemDefaults.label;"/>
-
+#ifdef 0
<hbox id="checkDefaultBox" align="center" flex="1">
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
@@ -196,6 +197,7 @@
oncommand="gAdvancedPane.checkNow()"
preference="pref.general.disable_button.default_browser"/>
</hbox>
+#endif
#ifdef MOZ_CRASHREPORTER
<checkbox id="submitCrashesBox" flex="1"
oncommand="gAdvancedPane.updateSubmitCrashes();"
@@ -203,6 +205,7 @@
#endif
</groupbox>
#endif
+#endif
</tabpanel>
<!-- Network -->
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; - nsresult rv;
-
// GConf _must_ be available, or we do not allow
// CreateInstance to succeed.
- gchar *commandPath; @@ -120,19 +118,9 @@ nsGNOMEShellService::Init()
if (mUseLocaleFilenames) { // the locale encoding. If it's not set, they use UTF-8.
gchar *nativePath = g_filename_from_utf8(aKeyValue, -1, NULL, NULL, NULL); mUseLocaleFilenames = PR_GetEnv("G_BROKEN_FILENAMES") != nsnull;
if (!nativePath) {
NS_ERROR("Error converting path to filesystem encoding"); - nsCOMPtr<nsIProperties> dirSvc
return PR_FALSE; - (do_GetService("@mozilla.org/file/directory_service;1"));
} - NS_ENSURE_TRUE(dirSvc, NS_ERROR_NOT_AVAILABLE);
- -
- commandPath = g_find_program_in_path(nativePath); - nsCOMPtr<nsILocalFile> appPath;
+ appName.Assign(nativePath); - rv = dirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsILocalFile),
g_free(nativePath); - getter_AddRefs(appPath));
} else { - NS_ENSURE_SUCCESS(rv, rv);
- commandPath = g_find_program_in_path(aKeyValue); + mAppPath.Assign(NS_LITERAL_CSTRING(MOZ_APP_NAME));
+ appName.Assign(aKeyValue);
} - rv = appPath->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_NAME));
- NS_ENSURE_SUCCESS(rv, rv);
- -
- if (!commandPath) - return appPath->GetNativePath(mAppPath);
- return PR_FALSE; + return NS_OK;
-
- 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);
} }
NS_IMETHODIMP NS_IMPL_ISUPPORTS1(nsGNOMEShellService, nsIShellService)
@@ -215,8 +209,8 @@ nsGNOMEShellService::SetDefaultBrowser(P
nsCOMPtr<nsIGConfService> 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

View File

@ -33,7 +33,7 @@
Summary: Mozilla Firefox Web browser Summary: Mozilla Firefox Web browser
Name: firefox Name: firefox
Version: 4.0 Version: 4.0
Release: 0.13%{?prever}%{?dist} Release: 0.14%{?prever}%{?dist}
URL: http://www.mozilla.org/projects/firefox/ URL: http://www.mozilla.org/projects/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+ License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet Group: Applications/Internet
@ -106,7 +106,7 @@ sed -e 's/__RPM_VERSION_INTERNAL__/%{internal_version}/' %{P:%%PATCH0} \
# For branding specific patches. # For branding specific patches.
# Fedora patches # Fedora patches
%patch11 -p2 -b .default %patch11 -p1 -b .default
%if %{official_branding} %if %{official_branding}
# Required by Mozilla Corporation # Required by Mozilla Corporation
@ -379,6 +379,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#--------------------------------------------------------------------- #---------------------------------------------------------------------
%changelog %changelog
* Mon Feb 07 2011 Christopher Aillon <caillon@redhat.com> - 4.0-0.14b10
- Bring back the default browser check
* Tue Jan 25 2011 Christopher Aillon <caillon@redhat.com> - 4.0-0.13b10 * Tue Jan 25 2011 Christopher Aillon <caillon@redhat.com> - 4.0-0.13b10
- Firefox 4.0 Beta 10 - Firefox 4.0 Beta 10