Репозитории ALT
S: | 118.0-alt1 |
4.1: | 3.0.9-alt0.M41.1 |
+updates: | 3.0.4-alt0.M41.2 |
4.0: | 2.0.0.18-alt0.M40.1 |
3.0: | 1.0.7-alt3 |
+updates: | 1.0.8-alt0.M30.1 |
Группа :: Сети/WWW
Пакет: firefox
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: lp185622_system_path_default_browser.patch
Скачать
Скачать
https://bugzilla.mozilla.org/show_bug.cgi?id=420408
https://bugs.launchpad.net/ubuntu/+bug/196493
---
browser/components/shell/src/nsGNOMEShellService.cpp | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
Index: mozilla/browser/components/shell/src/nsGNOMEShellService.cpp
===================================================================
--- mozilla.orig/browser/components/shell/src/nsGNOMEShellService.cpp
+++ mozilla/browser/components/shell/src/nsGNOMEShellService.cpp
@@ -62,16 +62,18 @@
#endif
#include <glib.h>
#include <glib-object.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <limits.h>
#include <stdlib.h>
+#define SYSTEM_PATH_BUILD 1
+
struct ProtocolAssociation
{
const char *name;
PRBool essential;
};
struct MimeTypeAssociation
{
@@ -135,17 +137,16 @@
return appPath->GetNativePath(mAppPath);
}
NS_IMPL_ISUPPORTS1(nsGNOMEShellService, nsIShellService)
PRBool
nsGNOMEShellService::KeyMatchesAppName(const char *aKeyValue) const
{
-
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;
}
@@ -153,19 +154,25 @@
g_free(nativePath);
} else {
commandPath = g_find_program_in_path(aKeyValue);
}
if (!commandPath)
return PR_FALSE;
+#ifdef SYSTEM_PATH_BUILD
+ PRBool matches = NS_LITERAL_CSTRING("/usr/bin/" MOZ_APP_NAME).Equals(commandPath);
+ g_free(commandPath);
+ return matches;
+#else
PRBool matches = mAppPath.Equals(commandPath);
g_free(commandPath);
return matches;
+#endif
}
NS_IMETHODIMP
nsGNOMEShellService::IsDefaultBrowser(PRBool aStartupCheck,
PRBool* aIsDefaultBrowser)
{
*aIsDefaultBrowser = PR_FALSE;
if (aStartupCheck)
@@ -211,18 +218,23 @@
#ifdef DEBUG
if (aForAllUsers)
NS_WARNING("Setting the default browser for all users is not yet supported");
#endif
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
nsCAutoString schemeList;
+
+#ifdef SYSTEM_PATH_BUILD
+ nsCAutoString appKeyValue(NS_LITERAL_CSTRING("/usr/bin/" MOZ_APP_NAME));
+#else
nsCAutoString appKeyValue(mAppPath);
- appKeyValue.Append(" \"%s\"");
+#endif
+ appKeyValue.Append(" %s");
unsigned int i;
for (i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
schemeList.Append(nsDependentCString(appProtocols[i].name));
schemeList.Append(',');
if (appProtocols[i].essential || aClaimAllTypes) {
gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name),