1
0

Accepting request 58061 from mozilla:Factory

Accepted submit request 58061 from user wrosenauer

OBS-URL: https://build.opensuse.org/request/show/58061
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/MozillaFirefox?expand=0&rev=99
This commit is contained in:
Marcus Rückert 2011-01-14 01:26:56 +00:00 committed by Git OBS Bridge
commit ac6f811c4d
14 changed files with 494 additions and 2164 deletions

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue Jan 11 06:13:40 UTC 2011 - wr@rosenauer.org
- update to version 4.0b9
- added x-scheme-handler for http and https to desktop file for
newer Gnome environments
- fixed default browser check/set for GIO (bmo#611953)
(mozilla-shellservice.patch)
- removed obsolete firefox-appname.patch (integrated into
shellservice patch)
- renamed desktop file to firefox.desktop for 11.4 and newer
(bnc#664211)
- removed support for 10.3 and older from the spec file
- removed obsolete "Ximian" categories from desktop file
-------------------------------------------------------------------
Mon Jan 3 17:35:46 CET 2011 - meissner@suse.de

View File

@ -8,5 +8,5 @@ Exec=firefox %u
Icon=firefox
Terminal=false
StartupNotify=true
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;application/x-xpinstall;
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;application/x-xpinstall;x-scheme-handler/http;x-scheme-handler/https;
Type=Application

View File

@ -1,8 +1,8 @@
#
# spec file for package MozillaFirefox (Version 4.0b)
# spec file for package MozillaFirefox (Version 4.0b9)
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# 2006-2010 Wolfgang Rosenauer
# 2006-2011 Wolfgang Rosenauer
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -22,21 +22,21 @@
Name: MozillaFirefox
%define use_xulrunner 1
%define xulrunner mozilla-xulrunner20
BuildRequires: Mesa-devel autoconf213 fdupes gcc-c++ libcurl-devel libgnomeui-devel libidl-devel libnotify-devel python unzip update-desktop-files yasm zip
BuildRequires: autoconf213 gcc-c++ libcurl-devel libgnomeui-devel libidl-devel libnotify-devel python unzip update-desktop-files zip fdupes Mesa-devel yasm
%if %suse_version > 1110
BuildRequires: libiw-devel
%else
BuildRequires: wireless-tools
%endif
%if 0%{?use_xulrunner}
BuildRequires: %{xulrunner}-devel = 2.0b
BuildRequires: %{xulrunner}-devel = 2.0b9
%endif
License: GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
Version: 4.0b
Release: 3
Version: 4.0b9
Provides: web_browser
Provides: firefox = %{version}
%define releasedate 2010121400
Release: 1
%define releasedate 2011011000
Summary: Mozilla Firefox Web Browser
Url: http://www.mozilla.org/
Group: Productivity/Networking/Web/Browsers
@ -52,18 +52,18 @@ Source8: firefox-mimeinfo.xml
Source9: firefox-lockdown.js
Source10: compare-locales.tar.bz2
Source11: firefox.1
Patch0: mozilla-firefox-sync.patch
Patch1: toolkit-download-folder.patch
Patch2: firefox-linkorder.patch
Patch3: firefox-browser-css.patch
Patch4: firefox-cross-desktop.patch
Patch5: firefox-appname.patch
Patch6: firefox-kde.patch
Patch7: firefox-ui-lockdown.patch
Patch8: firefox-no-sync-l10n.patch
Patch9: firefox-libxulsdk-locales.patch
Patch10: firefox-no-default-ualocale.patch
Patch11: firefox-multilocale-chrome.patch
Patch5: firefox-kde.patch
Patch6: firefox-ui-lockdown.patch
Patch7: firefox-no-sync-l10n.patch
Patch8: firefox-libxulsdk-locales.patch
Patch9: firefox-no-default-ualocale.patch
Patch10: firefox-multilocale-chrome.patch
Patch11: firefox-shell-bmo624267.patch
Patch12: firefox-shellservice.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(post): coreutils shared-mime-info desktop-file-utils
Requires(postun): shared-mime-info desktop-file-utils
@ -83,6 +83,11 @@ Requires: %{name}-branding >= 4.0
%define progname firefox
%define progdir %{_prefix}/%_lib/%{progname}
%define gnome_dir %{_prefix}
%if %suse_version > 1130
%define desktop_file_name firefox
%else
%define desktop_file_name %{name}
%endif
### build options
%define branding 1
%define localize 1
@ -100,7 +105,6 @@ plethora of extensions.
%if %localize
%package translations-common
Summary: Common translations for MozillaFirefox
License: GPLv2+ ; LGPLv2.1+ ; MPLv1.1+
@ -153,22 +157,22 @@ This package provides upstream look and feel for MozillaFirefox.
%prep
%setup -q -n mozilla -b 7 -b 10
cd $RPM_BUILD_DIR/mozilla
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%if %suse_version >= 1110
%patch6 -p1
%patch5 -p1
# install kde.js
install -m 644 %{SOURCE6} browser/app/profile/kde.js
%endif
#%patch7 -p1
#%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%build
export MOZ_BUILD_DATE=%{releasedate}
@ -227,7 +231,10 @@ rm dist/bin/defaults/preferences/firefox-l10n.js
make -C browser/installer STRIP=/bin/true
# copy tree into RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{progdir}
cp -rf $RPM_BUILD_DIR/obj/dist/firefox/* $RPM_BUILD_ROOT/%{progdir}
cp -rf $RPM_BUILD_DIR/obj/dist/firefox/* $RPM_BUILD_ROOT%{progdir}
# remove some executable permissions
find $RPM_BUILD_ROOT%{progdir} \
-name "*.js" -o -name "*.jsm" -o -name "*.rdf" | xargs chmod a-x
mkdir -p $RPM_BUILD_ROOT%{progdir}/searchplugins
# install additional locales
%if %localize
@ -272,7 +279,7 @@ ln -sf ../..%{progdir}/%{progname}.sh $RPM_BUILD_ROOT%{_bindir}/%{progname}
# desktop definition
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
install -m 644 %{SOURCE1} \
$RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
$RPM_BUILD_ROOT%{_datadir}/applications/%{desktop_file_name}.desktop
# additional mime-types
mkdir -p $RPM_BUILD_ROOT%{_datadir}/mime/packages
cp %{SOURCE8} $RPM_BUILD_ROOT%{_datadir}/mime/packages/%{progname}.xml
@ -292,7 +299,7 @@ for size in 16 32 48; do
$RPM_BUILD_ROOT%{gnome_dir}/share/icons/hicolor/${size}x${size}/apps/%{progname}.png
done
%endif
%suse_update_desktop_file %{name} Network WebBrowser X-Ximian-Main X-Ximian-Toplevel GTK
%suse_update_desktop_file %{desktop_file_name} Network WebBrowser GTK
# excludes
rm -f $RPM_BUILD_ROOT%{progdir}/updater.ini
rm -f $RPM_BUILD_ROOT%{progdir}/removed-files
@ -315,38 +322,18 @@ rm -rf %{_tmppath}/translations.*
if [ -f usr/bin/update-mime-database ] ; then
usr/bin/update-mime-database %{_datadir}/mime > /dev/null || :
fi
%if %suse_version >= 1030
if [ -f usr/bin/update-desktop-database ] ; then
usr/bin/update-desktop-database > /dev/null || :
fi
%else
if [ -f opt/gnome/bin/update-mime-database ] ; then
opt/gnome/bin/update-mime-database > /dev/null || :
fi
%endif
# move plugins to new location
if [ "$1" = "2" ]; then
if [ -d /opt/MozillaFirefox/%{_lib}/plugins ]; then
rm -rf /opt/MozillaFirefox/%{_lib}/plugins/libnullplugin.so
cp -fud /opt/MozillaFirefox/%{_lib}/plugins/* %{progdir}/plugins
rm -rf /opt/MozillaFirefox/%{_lib}/plugins
fi
fi
exit 0
%postun
if [ -f usr/bin/update-mime-database ] ; then
usr/bin/update-mime-database %{_datadir}/mime > /dev/null || :
fi
%if %suse_version >= 1030
if [ -f usr/bin/update-desktop-database ] ; then
usr/bin/update-desktop-database > /dev/null || :
fi
%else
if [ -f opt/gnome/bin/update-mime-database ] ; then
opt/gnome/bin/update-mime-database > /dev/null || :
fi
%endif
%files
%defattr(-,root,root)
@ -374,7 +361,7 @@ fi
%{progdir}/crashreporter-override.ini
%endif
%{progdir}/chrome.manifest
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/%{desktop_file_name}.desktop
%{_datadir}/mime/packages/%{progname}.xml
%{_datadir}/pixmaps/firefox*
%if %branding

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:47a1baf950c41532733eb79e0d375a6e5b9936498ce88cc2fd0d8edaa92db465
size 23407
oid sha256:ac0cc69db526ffba2445d7d75927641e3be89667d1d8f5cd7d6966406d1fb6e1
size 23421

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4ab65679521bb96e45bb0f21916a3fa9cc41df4e44c4c85d7f3f833242d8ba64
size 63741253

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5aeed5bfa6bcb4743d69d1ffc7efa511840df819b8106df39b914c8e7ba961f8
size 63999667

View File

@ -1,36 +0,0 @@
From: Wolfgang Rosenauer <wr@rosenauer.org>
Subject: Hardcode app starter for default check
diff --git a/browser/components/shell/src/nsGNOMEShellService.cpp b/browser/components/shell/src/nsGNOMEShellService.cpp
--- a/browser/components/shell/src/nsGNOMEShellService.cpp
+++ b/browser/components/shell/src/nsGNOMEShellService.cpp
@@ -105,22 +105,26 @@ nsresult
nsGNOMEShellService::Init()
{
nsresult rv;
// GConf _must_ be available, or we do not allow
// CreateInstance to succeed.
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
+ if (!gconf)
+ return NS_ERROR_NOT_AVAILABLE;
+
+ /* This path to firefox is hardcoded for the default path setting */
+ mAppPath.Assign("/usr/bin/firefox");
+ return NS_OK;
+
nsCOMPtr<nsIGIOService> giovfs =
do_GetService(NS_GIOSERVICE_CONTRACTID);
- if (!gconf)
- return NS_ERROR_NOT_AVAILABLE;
-
// Check G_BROKEN_FILENAMES. If it's set, then filenames in glib use
// the locale encoding. If it's not set, they use UTF-8.
mUseLocaleFilenames = PR_GetEnv("G_BROKEN_FILENAMES") != nsnull;
nsCOMPtr<nsIProperties> dirSvc
(do_GetService("@mozilla.org/file/directory_service;1"));
NS_ENSURE_TRUE(dirSvc, NS_ERROR_NOT_AVAILABLE);

View File

@ -23,7 +23,7 @@ diff --git a/browser/base/content/browser-kde.xul b/browser/base/content/browser
new file mode 100644
--- /dev/null
+++ b/browser/base/content/browser-kde.xul
@@ -0,0 +1,1042 @@
@@ -0,0 +1,1058 @@
+#filter substitution
+<?xml version="1.0"?>
+# -*- Mode: HTML -*-
@ -329,7 +329,8 @@ new file mode 100644
+ </menupopup>
+
+ <menupopup id="blockedPopupOptions"
+ onpopupshowing="gPopupBlockerObserver.fillPopupList(event);">
+ onpopupshowing="gPopupBlockerObserver.fillPopupList(event);"
+ onpopuphiding="gPopupBlockerObserver.onPopupHiding(event);">
+ <menuitem observes="blockedPopupAllowSite"/>
+ <menuitem observes="blockedPopupEditSettings"/>
+ <menuitem observes="blockedPopupDontShowMessage"/>
@ -398,7 +399,7 @@ new file mode 100644
+ class="identity-popup-description"/>
+ </hbox>
+ <!-- Footer button to open security page info -->
+ <hbox pack="end">
+ <hbox id="identity-popup-button-container" pack="end">
+ <button id="identity-popup-more-info-button"
+ label="&identity.moreInfoLinkText;"
+ onblur="gIdentityHandler.hideIdentityPopup();"
@ -510,6 +511,11 @@ new file mode 100644
+# hiddenWindow.xul.
+#include browser-menubar.inc
+ </toolbaritem>
+
+#ifdef CAN_DRAW_IN_TITLEBAR
+ <hbox class="titlebar-placeholder" type="appmenu-button" ordinal="0"/>
+ <hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000"/>
+#endif
+ </toolbar>
+
+ <toolbar id="nav-bar" class="toolbar-primary chromeclass-toolbar"
@ -592,6 +598,12 @@ new file mode 100644
+ </box>
+ <label id="urlbar-display" value="&urlbar.switchToTab.label;"/>
+ <hbox id="urlbar-icons">
+ <image id="page-report-button"
+ class="urlbar-icon"
+ hidden="true"
+ tooltiptext="&pageReportIcon.tooltip;"
+ onclick="gPopupBlockerObserver.onReportButtonClick(event);"/>
+
+ <image id="star-button"
+ class="urlbar-icon"
+ onclick="PlacesStarButton.onClick(event);"/>
@ -869,6 +881,10 @@ new file mode 100644
+ label="&closeTab.label;"
+ tooltiptext="&closeTab.label;"/>
+
+#ifdef CAN_DRAW_IN_TITLEBAR
+ <hbox class="titlebar-placeholder" type="appmenu-button" ordinal="0"/>
+ <hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000"/>
+#endif
+ </toolbar>
+
+ <toolbarpalette id="BrowserToolbarPalette">
@ -1543,7 +1559,7 @@ new file mode 100644
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -441,16 +441,17 @@
@@ -442,16 +442,17 @@
#endif
#endif

View File

@ -0,0 +1,82 @@
# HG changeset patch
# Parent 6c4a0e0acb3a071dbfde60e975f68f18c85bbff8
# User timeless@mozdev.org
Bug 624267 Crash on Ubuntu [@ nsGNOMEShellService::SetDefaultBrowser ]
r=roc
diff --git a/browser/components/shell/src/nsGNOMEShellService.cpp b/browser/components/shell/src/nsGNOMEShellService.cpp
--- a/browser/components/shell/src/nsGNOMEShellService.cpp
+++ b/browser/components/shell/src/nsGNOMEShellService.cpp
@@ -214,30 +214,31 @@ nsGNOMEShellService::SetDefaultBrowser(P
#endif
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
-
- nsCAutoString appKeyValue(mAppPath);
- appKeyValue.Append(" \"%s\"");
- unsigned int i;
-
- for (i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
- if (appProtocols[i].essential || aClaimAllTypes) {
- gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name),
- appKeyValue);
+ if (gconf) {
+ nsCAutoString appKeyValue(mAppPath);
+ 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),
+ appKeyValue);
+ }
}
}
// set handler for .html and xhtml files and MIME types:
if (aClaimAllTypes) {
+ nsresult rv;
nsCOMPtr<nsIGIOService> giovfs =
- do_GetService(NS_GIOSERVICE_CONTRACTID);
+ do_GetService(NS_GIOSERVICE_CONTRACTID, &rv);
+ NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStringBundleService> bundleService =
- do_GetService(NS_STRINGBUNDLE_CONTRACTID);
- NS_ENSURE_TRUE(bundleService, NS_ERROR_OUT_OF_MEMORY);
+ do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
+ NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStringBundle> brandBundle;
- bundleService->CreateBundle(BRAND_PROPERTIES, getter_AddRefs(brandBundle));
- NS_ENSURE_TRUE(brandBundle, NS_ERROR_FAILURE);
+ rv = bundleService->CreateBundle(BRAND_PROPERTIES, getter_AddRefs(brandBundle));
+ NS_ENSURE_SUCCESS(rv, rv);
nsString brandShortName, brandFullName;
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
@@ -247,17 +248,16 @@ nsGNOMEShellService::SetDefaultBrowser(P
// use brandShortName as the application id.
NS_ConvertUTF16toUTF8 id(brandShortName);
- if (giovfs) {
- nsCOMPtr<nsIGIOMimeApp> appInfo;
- giovfs->CreateAppFromCommand(mAppPath,
- id,
- getter_AddRefs(appInfo));
+ nsCOMPtr<nsIGIOMimeApp> appInfo;
+ rv = giovfs->CreateAppFromCommand(mAppPath,
+ id,
+ getter_AddRefs(appInfo));
+ NS_ENSURE_SUCCESS(rv, rv);
- // Add mime types for html, xhtml extension and set app to just created appinfo.
- for (i = 0; i < NS_ARRAY_LENGTH(appTypes); ++i) {
- appInfo->SetAsDefaultForMimeType(nsDependentCString(appTypes[i].mimeType));
- appInfo->SetAsDefaultForFileExtensions(nsDependentCString(appTypes[i].extensions));
- }
+ // Add mime types for html, xhtml extension and set app to just created appinfo.
+ for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appTypes); ++i) {
+ appInfo->SetAsDefaultForMimeType(nsDependentCString(appTypes[i].mimeType));
+ appInfo->SetAsDefaultForFileExtensions(nsDependentCString(appTypes[i].extensions));
}
}

325
firefox-shellservice.patch Normal file
View File

@ -0,0 +1,325 @@
# HG changeset patch
# Parent 7530e890ad6ed214783244371ec1ef816d24083e
diff --git a/browser/components/shell/src/nsGNOMEShellService.cpp b/browser/components/shell/src/nsGNOMEShellService.cpp
--- a/browser/components/shell/src/nsGNOMEShellService.cpp
+++ b/browser/components/shell/src/nsGNOMEShellService.cpp
@@ -101,30 +101,33 @@ static const char kDesktopOptionsKey[] =
static const char kDesktopDrawBGKey[] = DG_BACKGROUND "/draw_background";
static const char kDesktopColorKey[] = DG_BACKGROUND "/primary_color";
nsresult
nsGNOMEShellService::Init()
{
nsresult rv;
- // GConf _must_ be available, or we do not allow
+ // GConf or GIO _must_ be available, or we do not allow
// CreateInstance to succeed.
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
nsCOMPtr<nsIGIOService> giovfs =
do_GetService(NS_GIOSERVICE_CONTRACTID);
- if (!gconf)
+ if (!gconf && !giovfs)
return NS_ERROR_NOT_AVAILABLE;
// Check G_BROKEN_FILENAMES. If it's set, then filenames in glib use
// the locale encoding. If it's not set, they use UTF-8.
mUseLocaleFilenames = PR_GetEnv("G_BROKEN_FILENAMES") != nsnull;
+ if (GetAppPathFromLauncher())
+ return NS_OK;
+
nsCOMPtr<nsIProperties> dirSvc
(do_GetService("@mozilla.org/file/directory_service;1"));
NS_ENSURE_TRUE(dirSvc, NS_ERROR_NOT_AVAILABLE);
nsCOMPtr<nsILocalFile> appPath;
rv = dirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsILocalFile),
getter_AddRefs(appPath));
NS_ENSURE_SUCCESS(rv, rv);
@@ -133,16 +136,44 @@ nsGNOMEShellService::Init()
NS_ENSURE_SUCCESS(rv, rv);
return appPath->GetNativePath(mAppPath);
}
NS_IMPL_ISUPPORTS1(nsGNOMEShellService, nsIShellService)
PRBool
+nsGNOMEShellService::GetAppPathFromLauncher()
+{
+ gchar *tmp;
+
+ const char *launcher = PR_GetEnv("MOZ_APP_LAUNCHER");
+ if (!launcher)
+ return PR_FALSE;
+
+ if (g_path_is_absolute(launcher)) {
+ mAppPath = launcher;
+ tmp = g_path_get_basename(launcher);
+ gchar *fullpath = g_find_program_in_path(tmp);
+ if (fullpath && mAppPath.Equals(fullpath))
+ mAppIsInPath = PR_TRUE;
+ g_free(fullpath);
+ } else {
+ tmp = g_find_program_in_path(launcher);
+ if (!tmp)
+ return PR_FALSE;
+ mAppPath = tmp;
+ mAppIsInPath = PR_TRUE;
+ }
+
+ g_free(tmp);
+ return PR_TRUE;
+}
+
+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");
@@ -158,84 +189,119 @@ nsGNOMEShellService::KeyMatchesAppName(c
if (!commandPath)
return PR_FALSE;
PRBool matches = mAppPath.Equals(commandPath);
g_free(commandPath);
return matches;
}
+PRBool
+nsGNOMEShellService::CheckHandlerMatchesAppName(const nsACString &handler) const
+{
+ gint argc;
+ gchar **argv;
+ nsCAutoString command(handler);
+
+ // The string will be something of the form: [/path/to/]browser "%s"
+ // We want to remove all of the parameters and get just the binary name.
+ if (g_shell_parse_argv(command.get(), &argc, &argv, NULL) && argc > 0) {
+ command.Assign(argv[0]);
+ g_strfreev(argv);
+ }
+
+ if (!KeyMatchesAppName(command.get()))
+ return PR_FALSE; // the handler is disabled or set to another app
+
+ return PR_TRUE;
+}
+
NS_IMETHODIMP
nsGNOMEShellService::IsDefaultBrowser(PRBool aStartupCheck,
PRBool* aIsDefaultBrowser)
{
*aIsDefaultBrowser = PR_FALSE;
if (aStartupCheck)
mCheckedThisSession = PR_TRUE;
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
+ nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
PRBool enabled;
nsCAutoString handler;
+ nsCOMPtr<nsIGIOMimeApp> gioApp;
for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
if (!appProtocols[i].essential)
continue;
- handler.Truncate();
- gconf->GetAppForProtocol(nsDependentCString(appProtocols[i].name),
- &enabled, handler);
+ if (gconf) {
+ handler.Truncate();
+ gconf->GetAppForProtocol(nsDependentCString(appProtocols[i].name),
+ &enabled, handler);
- // The string will be something of the form: [/path/to/]browser "%s"
- // We want to remove all of the parameters and get just the binary name.
-
- gint argc;
- gchar **argv;
-
- if (g_shell_parse_argv(handler.get(), &argc, &argv, NULL) && argc > 0) {
- handler.Assign(argv[0]);
- g_strfreev(argv);
+ if (!CheckHandlerMatchesAppName(handler) || !enabled)
+ return NS_OK; // the handler is disabled or set to another app
}
- if (!KeyMatchesAppName(handler.get()) || !enabled)
- return NS_OK; // the handler is disabled or set to another app
+ if (giovfs) {
+ handler.Truncate();
+ giovfs->GetAppForURIScheme(nsDependentCString(appProtocols[i].name),
+ getter_AddRefs(gioApp));
+ if (!gioApp)
+ return NS_OK;
+
+ gioApp->GetCommand(handler);
+
+ if (!CheckHandlerMatchesAppName(handler))
+ return NS_OK; // the handler is set to another app
+ }
}
*aIsDefaultBrowser = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP
nsGNOMEShellService::SetDefaultBrowser(PRBool aClaimAllTypes,
PRBool aForAllUsers)
{
#ifdef DEBUG
if (aForAllUsers)
NS_WARNING("Setting the default browser for all users is not yet supported");
#endif
+ nsCAutoString appKeyValue;
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
+ nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
+
+ if (mAppIsInPath) {
+ // mAppPath is in the users path, so use only the basename as the
+ // launcher
+ gchar *tmp = g_path_get_basename(mAppPath.get());
+ appKeyValue = tmp;
+ g_free(tmp);
+ } else {
+ appKeyValue = mAppPath;
+ }
+ appKeyValue.AppendLiteral(" %s");
+
if (gconf) {
- nsCAutoString appKeyValue(mAppPath);
- 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),
appKeyValue);
}
}
}
- // set handler for .html and xhtml files and MIME types:
- if (aClaimAllTypes) {
+ if (giovfs) {
nsresult rv;
- nsCOMPtr<nsIGIOService> giovfs =
- do_GetService(NS_GIOSERVICE_CONTRACTID, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
+ unsigned int i;
nsCOMPtr<nsIStringBundleService> bundleService =
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStringBundle> brandBundle;
rv = bundleService->CreateBundle(BRAND_PROPERTIES, getter_AddRefs(brandBundle));
NS_ENSURE_SUCCESS(rv, rv);
@@ -249,20 +315,30 @@ nsGNOMEShellService::SetDefaultBrowser(P
// use brandShortName as the application id.
NS_ConvertUTF16toUTF8 id(brandShortName);
nsCOMPtr<nsIGIOMimeApp> appInfo;
rv = giovfs->CreateAppFromCommand(mAppPath,
id,
getter_AddRefs(appInfo));
NS_ENSURE_SUCCESS(rv, rv);
- // Add mime types for html, xhtml extension and set app to just created appinfo.
- for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appTypes); ++i) {
- appInfo->SetAsDefaultForMimeType(nsDependentCString(appTypes[i].mimeType));
- appInfo->SetAsDefaultForFileExtensions(nsDependentCString(appTypes[i].extensions));
+ // set handler for the protocols
+ for (i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
+ if (appProtocols[i].essential || aClaimAllTypes) {
+ appInfo->SetAsDefaultForURIScheme(nsDependentCString(appProtocols[i].name));
+ }
+ }
+
+ // set handler for .html and xhtml files and MIME types:
+ if (aClaimAllTypes) {
+ // Add mime types for html, xhtml extension and set app to just created appinfo.
+ for (i = 0; i < NS_ARRAY_LENGTH(appTypes); ++i) {
+ appInfo->SetAsDefaultForMimeType(nsDependentCString(appTypes[i].mimeType));
+ appInfo->SetAsDefaultForFileExtensions(nsDependentCString(appTypes[i].extensions));
+ }
}
}
return NS_OK;
}
NS_IMETHODIMP
nsGNOMEShellService::GetShouldCheckDefaultBrowser(PRBool* aResult)
@@ -451,17 +527,27 @@ nsGNOMEShellService::OpenApplication(PRI
nsCAutoString scheme;
if (aApplication == APPLICATION_MAIL)
scheme.Assign("mailto");
else if (aApplication == APPLICATION_NEWS)
scheme.Assign("news");
else
return NS_ERROR_NOT_AVAILABLE;
+ nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
+ if (giovfs) {
+ nsCOMPtr<nsIGIOMimeApp> gioApp;
+ giovfs->GetAppForURIScheme(scheme, getter_AddRefs(gioApp));
+ if (gioApp)
+ return gioApp->Launch(EmptyCString());
+ }
+
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
+ if (!gconf)
+ return NS_ERROR_FAILURE;
PRBool enabled;
nsCAutoString appCommand;
gconf->GetAppForProtocol(scheme, &enabled, appCommand);
if (!enabled)
return NS_ERROR_FAILURE;
diff --git a/browser/components/shell/src/nsGNOMEShellService.h b/browser/components/shell/src/nsGNOMEShellService.h
--- a/browser/components/shell/src/nsGNOMEShellService.h
+++ b/browser/components/shell/src/nsGNOMEShellService.h
@@ -38,26 +38,29 @@
#define nsgnomeshellservice_h____
#include "nsIShellService.h"
#include "nsStringAPI.h"
class nsGNOMEShellService : public nsIShellService
{
public:
- nsGNOMEShellService() : mCheckedThisSession(PR_FALSE) { }
+ nsGNOMEShellService() : mCheckedThisSession(PR_FALSE), mAppIsInPath(PR_FALSE) { }
NS_DECL_ISUPPORTS
NS_DECL_NSISHELLSERVICE
nsresult Init() NS_HIDDEN;
private:
~nsGNOMEShellService() {}
NS_HIDDEN_(PRBool) KeyMatchesAppName(const char *aKeyValue) const;
+ NS_HIDDEN_(PRBool) CheckHandlerMatchesAppName(const nsACString& handler) const;
+ NS_HIDDEN_(PRBool) GetAppPathFromLauncher();
PRPackedBool mCheckedThisSession;
PRPackedBool mUseLocaleFilenames;
nsCString mAppPath;
+ PRPackedBool mAppIsInPath;
};
#endif // nsgnomeshellservice_h____

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8c47f90b7b1236f1bd7914a2a3028b89dc6f71b26658ff789b1ca421ad7dc6dc
size 36318691

3
l10n-4.0b9.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bec7fa71fa6b7458407bc7c78b98518e3b5d432baa4dc2754ce95682b45c2215
size 39499839

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Contributor(s):
# Wolfgang Rosenauer <wolfgang.rosenauer@suse.de>
# <wr@rosenauer.org>
#
@ -38,7 +38,7 @@
#
# ***** END LICENSE BLOCK *****
##
##
## Usage:
##
## $ mozilla [args]
@ -59,7 +59,16 @@ MOZ_DIST_LIB="%PROGDIR"
MOZ_APPNAME="%APPNAME"
MOZ_PROGRAM="$MOZ_DIST_LIB/$MOZ_APPNAME"
export MOZ_APP_LAUNCHER="$MOZ_DIST_LIB/$MOZ_APPNAME.sh"
MOZ_APP_LAUNCHER="$MOZ_DIST_LIB/$MOZ_APPNAME.sh"
if [ "$0" = "$MOZ_APP_LAUNCHER" ]; then
[ -h "/usr/bin/$MOZ_APPNAME" ] && \
_link=$(readlink -f "/usr/bin/$MOZ_APPNAME")
if [ "$_link" = "$MOZ_APP_LAUNCHER" ]; then
export MOZ_APP_LAUNCHER="/usr/bin/$MOZ_APPNAME"
fi
else
export MOZ_APP_LAUNCHER="/usr/bin/$MOZ_APPNAME"
fi
mozilla_lib=`file $MOZ_PROGRAM`
LIB=lib