Mailinglist Archive: opensuse-commit (861 mails)
| < Previous | Next > |
commit MozillaFirefox for openSUSE:Factory
- From: root@xxxxxxxxxxxxxxx (h_root)
- Date: Fri, 14 Jan 2011 02:26:56 +0100
- Message-id: <20110114012656.4C5E820234@hilbert.suse.de>
Hello community,
here is the log from the commit of package MozillaFirefox for openSUSE:Factory
checked in at Fri Jan 14 02:26:56 CET 2011.
--------
--- MozillaFirefox/MozillaFirefox.changes 2011-01-03 17:36:26.000000000
+0100
+++ MozillaFirefox/MozillaFirefox.changes 2011-01-13 12:12:52.000000000
+0100
@@ -1,0 +2,15 @@
+Tue Jan 11 06:13:40 UTC 2011 - wr@xxxxxxxxxxxxx
+
+- 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
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
firefox-4.0b-source.tar.bz2
firefox-appname.patch
l10n-4.0b.tar.bz2
mozilla-firefox-sync.patch
New:
----
firefox-4.0b9-source.tar.bz2
firefox-shell-bmo624267.patch
firefox-shellservice.patch
l10n-4.0b9.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ MozillaFirefox.spec ++++++
--- /var/tmp/diff_new_pack.NWKfzS/_old 2011-01-14 02:20:38.000000000 +0100
+++ /var/tmp/diff_new_pack.NWKfzS/_new 2011-01-14 02:20:38.000000000 +0100
@@ -1,8 +1,8 @@
#
-# spec file for package MozillaFirefox (Version 4.0b)
+# spec file for package MozillaFirefox
#
# 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
@@ -29,14 +29,14 @@
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
+Release: 1
Provides: web_browser
Provides: firefox = %{version}
-%define releasedate 2010121400
+%define releasedate 2011011000
Summary: Mozilla Firefox Web Browser
Url: http://www.mozilla.org/
Group: Productivity/Networking/Web/Browsers
@@ -52,18 +52,18 @@
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 @@
%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
@@ -153,22 +158,22 @@
%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 +232,10 @@
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 +280,7 @@
# 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 +300,7 @@
$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 +323,18 @@
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 +362,7 @@
%{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
++++++ MozillaFirefox.desktop ++++++
--- /var/tmp/diff_new_pack.NWKfzS/_old 2011-01-14 02:20:38.000000000 +0100
+++ /var/tmp/diff_new_pack.NWKfzS/_new 2011-01-14 02:20:38.000000000 +0100
@@ -8,5 +8,5 @@
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
++++++ compare-locales.tar.bz2 ++++++
++++++ firefox-4.0b-source.tar.bz2 -> firefox-4.0b9-source.tar.bz2 ++++++
MozillaFirefox/firefox-4.0b-source.tar.bz2
MozillaFirefox/firefox-4.0b9-source.tar.bz2 differ: char 11, line 1
++++++ firefox-kde.patch ++++++
--- /var/tmp/diff_new_pack.NWKfzS/_old 2011-01-14 02:20:38.000000000 +0100
+++ /var/tmp/diff_new_pack.NWKfzS/_new 2011-01-14 02:20:38.000000000 +0100
@@ -23,7 +23,7 @@
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 @@
+ </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 @@
+ 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 @@
+# 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 @@
+ </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 @@
+ 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 @@
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
++++++ firefox-shell-bmo624267.patch ++++++
# HG changeset patch
# Parent 6c4a0e0acb3a071dbfde60e975f68f18c85bbff8
# User timeless@xxxxxxxxxx
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));
}
}
++++++ firefox-shellservice.patch ++++++
# 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____
++++++ l10n-4.0b.tar.bz2 -> l10n-4.0b9.tar.bz2 ++++++
MozillaFirefox/l10n-4.0b.tar.bz2 MozillaFirefox/l10n-4.0b9.tar.bz2 differ: char
11, line 1
++++++ mozilla.sh.in ++++++
--- /var/tmp/diff_new_pack.NWKfzS/_old 2011-01-14 02:20:38.000000000 +0100
+++ /var/tmp/diff_new_pack.NWKfzS/_new 2011-01-14 02:20:38.000000000 +0100
@@ -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@xxxxxxx>
# <wr@xxxxxxxxxxxxx>
#
@@ -38,7 +38,7 @@
#
# ***** END LICENSE BLOCK *****
-##
+##
## Usage:
##
## $ mozilla [args]
@@ -59,7 +59,16 @@
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
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx
| < Previous | Next > |