1
0
Wolfgang Rosenauer 2011-08-02 12:57:20 +00:00 committed by Git OBS Bridge
parent 9c7247ddcb
commit 1ff3cdc8d5
15 changed files with 77 additions and 585 deletions

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Fri Jul 30 08:30:11 CEST 2011 - jslaby@suse.de
- update enigmail to 1.2.99 (1.3a1pre)
-------------------------------------------------------------------
Fri Jul 29 21:13:54 UTC 2011 - wr@rosenauer.org
- update to version 6.0b2
* removed obsolete patches
- mozilla-gio.patch
- thunderbird-gio.patch
- fix symbol dumper for linux3 platform
-------------------------------------------------------------------
Sat Jul 9 11:16:51 UTC 2011 - wr@rosenauer.org

View File

@ -20,14 +20,14 @@
Name: MozillaThunderbird
BuildRequires: Mesa-devel autoconf213 fdupes gcc-c++ hunspell-devel libcurl-devel libgnomeui-devel libidl-devel libnotify-devel python startup-notification-devel unzip update-desktop-files yasm zip
BuildRequires: autoconf213 fdupes gcc-c++ hunspell-devel libcurl-devel libgnomeui-devel libidl-devel libnotify-devel python startup-notification-devel unzip update-desktop-files Mesa-devel yasm zip
BuildRequires: mozilla-nss-devel >= 3.12.8
BuildRequires: nss-shared-helper-devel
License: MPLv1.1 or GPLv2+ or LGPLv2+
%define mainversion 5.0
%define mainversion 5.99
Version: %{mainversion}
Release: 1
%define releasedate 2011062400
%define releasedate 2011072900
Provides: thunderbird = %{version}
Summary: The Stand-Alone Mozilla Mail Component
Url: http://www.mozilla.org/products/thunderbird/
@ -41,21 +41,20 @@ Source4: l10n-%{version}.tar.bz2
Source6: suse-default-prefs.js
Source7: find-external-requires.sh
Source8: MozillaThunderbird-rpmlintrc
Source9: enigmail-1.2.tar.gz
Source9: enigmail-1.2.99.tar.bz2
Source10: create-tar.sh
Source11: compare-locales.tar.bz2
# Gecko/Toolkit
Patch1: mozilla-shared-nss-db.patch
Patch2: mozilla-cairo-lcd.patch
Patch3: mozilla-language.patch
Patch4: mozilla-gio.patch
Patch4: mozilla-linux3.patch
Patch5: mozilla-cairo-return.patch
Patch6: mozilla-dump_syms-static.patch
# Thunderbird/mail
Patch10: tb-ssldap.patch
Patch11: tb-develdirs.patch
Patch12: thunderbird-shared-nss-db.patch
Patch13: thunderbird-gio.patch
#enigmail
Patch20: enigmail-cz-CZ-fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -88,7 +87,6 @@ cross-platform. It is a stand-alone application instead of part of the
Mozilla application suite.
%if %localize
%package translations-common
License: MPLv1.1 or GPLv2+ or LGPLv2+
Summary: Common translations for MozillaThunderbird
@ -128,7 +126,6 @@ Software Development Kit to build plugins/extensions against Thunderbird.
%if %crashreporter
%package buildsymbols
License: MPLv1.1 or GPLv2+ or LGPLv2+
Summary: Breakpad buildsymbols for %{name}
@ -140,9 +137,8 @@ symbols meant for upload to Mozilla's crash collector database.
%endif
%if %build_enigmail
%package -n enigmail
Version: 1.2
Version: 1.2.99
Release: 1
License: MPLv1.1 or GPLv2+
Summary: OpenPGP addon for Thunderbird and SeaMonkey
@ -178,10 +174,11 @@ popd
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%if %build_enigmail
pushd ../enigmail
%patch20 -p1
popd
%endif
%build
# no need to add build time to binaries
@ -476,7 +473,6 @@ exit 0
%{_bindir}/%{progname}
%if %localize
%files translations-common -f %{_tmppath}/translations.common
%defattr(-,root,root)
@ -488,13 +484,11 @@ exit 0
%defattr(-,root,root)
%{_libdir}/%{progname}/*.a
%{_libdir}/%{progname}/xpidl
%{_libdir}/%{progname}/xpt_dump
%{_libdir}/%{progname}/xpt_link
%{_libdir}/%{progname}/xpt.py
#%{_libdir}/pkgconfig/*.pc
%{_includedir}/%{progname}/
%if %build_enigmail
%files -n enigmail
%defattr(-,root,root)
%dir %{_libdir}/mozilla
@ -502,7 +496,6 @@ exit 0
%endif
%if %crashreporter
%files buildsymbols
%defattr(-,root,root)
%{_datadir}/mozilla/

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cd5366bf0c4db4c38f29f7230cac1fa6c8f539dd9fb830531a901bd065f3bf42
size 25651
oid sha256:5ea7fc0c4be1b775b5d87c397417cb08aa054ec5ae0829845d8c4b6374344970
size 25672

View File

@ -1,9 +1,9 @@
#!/bin/bash
BRANCH="releases/comm-miramar"
RELEASE_TAG="THUNDERBIRD_5_0_RELEASE "
VERSION="5.0"
BRANCH="releases/comm-beta"
RELEASE_TAG="THUNDERBIRD_6_0b2_RELEASE"
VERSION="5.99"
echo "cloning $BRANCH..."
hg clone http://hg.mozilla.org/$BRANCH thunderbird
@ -12,7 +12,7 @@ hg update -r $RELEASE_TAG
echo "running client.py..."
[ "$RELEASE_TAG" == "default" ] || _extra="--comm-rev=$RELEASE_TAG --mozilla-rev=$RELEASE_TAG"
# temporary!
#_extra="--mozilla-repo=http://hg.mozilla.org/releases/mozilla-miramar $_extra"
_extra="--mozilla-repo=http://hg.mozilla.org/releases/mozilla-beta $_extra"
python client.py checkout --skip-chatzilla --skip-venkman $_extra
popd
echo "creating archive..."
@ -33,7 +33,7 @@ for locale in $(awk '{ print $1; }' $SHIPPED_LOCALES); do
;;
*)
echo "fetching $locale ..."
hg clone http://hg.mozilla.org/releases/l10n-miramar/$locale l10n/$locale
hg clone http://hg.mozilla.org/releases/l10n/mozilla-beta/$locale l10n/$locale
hg -R l10n/$locale up -C -r $RELEASE_TAG
;;
esac

3
enigmail-1.2.99.tar.bz2 Normal file
View File

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

View File

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

View File

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

3
l10n-5.99.tar.bz2 Normal file
View File

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

View File

@ -1,284 +0,0 @@
# HG changeset patch
# User Chris Coulson
# Parent 0ebe30f9eacfe67fa0b699457e524d5a9c96359e
Bug 611953 - GNOME 3.0 readiness (patch 2 + 3)
diff --git a/toolkit/system/gnome/nsGIOService.cpp b/toolkit/system/gnome/nsGIOService.cpp
--- a/toolkit/system/gnome/nsGIOService.cpp
+++ b/toolkit/system/gnome/nsGIOService.cpp
@@ -101,25 +101,25 @@ nsGIOMimeApp::GetName(nsACString& aName)
return NS_OK;
}
NS_IMETHODIMP
nsGIOMimeApp::GetCommand(nsACString& aCommand)
{
get_commandline_t g_app_info_get_commandline_ptr;
- void *libHandle = dlopen("libgio-2.0.so", RTLD_LAZY);
+ void *libHandle = dlopen("libgio-2.0.so.0", RTLD_LAZY);
if (!libHandle) {
return NS_ERROR_FAILURE;
}
dlerror(); /* clear any existing error */
g_app_info_get_commandline_ptr =
(get_commandline_t) dlsym(libHandle, "g_app_info_get_commandline");
- if (dlerror() != NULL) {
- const char cmd = *g_app_info_get_commandline_ptr(mApp);
+ if (dlerror() == NULL) {
+ const char *cmd = g_app_info_get_commandline_ptr(mApp);
if (!cmd) {
dlclose(libHandle);
return NS_ERROR_FAILURE;
}
aCommand.Assign(cmd);
}
dlclose(libHandle);
return NS_OK;
@@ -277,16 +277,43 @@ nsGIOMimeApp::SetAsDefaultForFileExtensi
} else {
*ext_pos = '\0';
}
}
g_free(extensions);
return NS_OK;
}
+/**
+ * Set default application for URI's of a particular scheme
+ * @param aURIScheme string containing the URI scheme
+ * @return NS_OK when application was set as default for URI scheme,
+ * NS_ERROR_FAILURE otherwise
+ */
+NS_IMETHODIMP
+nsGIOMimeApp::SetAsDefaultForURIScheme(nsACString const& aURIScheme)
+{
+ GError *error = NULL;
+ nsCAutoString contentType("x-scheme-handler/");
+ contentType.Append(aURIScheme);
+
+ g_app_info_set_as_default_for_type(mApp,
+ contentType.get(),
+ &error);
+ if (error) {
+ g_warning("Cannot set application as default for URI scheme (%s): %s",
+ PromiseFlatCString(aURIScheme).get(),
+ error->message);
+ g_error_free(error);
+ return NS_ERROR_FAILURE;
+ }
+
+ return NS_OK;
+}
+
nsresult
nsGIOService::Init()
{
// do nothing, gvfs/gio does not init.
return NS_OK;
}
NS_IMPL_ISUPPORTS1(nsGIOService, nsIGIOService)
@@ -317,29 +344,45 @@ nsGIOService::GetMimeTypeFromExtension(c
g_free(mime_type);
g_free(content_type);
return NS_OK;
}
// used in nsGNOMERegistry
// -----------------------------------------------------------------------------
NS_IMETHODIMP
+nsGIOService::GetAppForURIScheme(const nsACString& aURIScheme,
+ nsIGIOMimeApp** aApp)
+{
+ *aApp = nsnull;
+
+ GAppInfo *app_info = g_app_info_get_default_for_uri_scheme(
+ PromiseFlatCString(aURIScheme).get());
+ if (app_info) {
+ nsGIOMimeApp *mozApp = new nsGIOMimeApp(app_info);
+ NS_ADDREF(*aApp = mozApp);
+ } else {
+ return NS_ERROR_FAILURE;
+ }
+ return NS_OK;
+}
+
+NS_IMETHODIMP
nsGIOService::GetAppForMimeType(const nsACString& aMimeType,
nsIGIOMimeApp** aApp)
{
*aApp = nsnull;
char *content_type =
get_content_type_from_mime_type(PromiseFlatCString(aMimeType).get());
if (!content_type)
return NS_ERROR_FAILURE;
GAppInfo *app_info = g_app_info_get_default_for_type(content_type, false);
if (app_info) {
nsGIOMimeApp *mozApp = new nsGIOMimeApp(app_info);
- NS_ENSURE_TRUE(mozApp, NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(*aApp = mozApp);
} else {
g_free(content_type);
return NS_ERROR_FAILURE;
}
g_free(content_type);
return NS_OK;
}
@@ -414,75 +457,46 @@ nsGIOService::CreateAppFromCommand(nsACS
nsIGIOMimeApp** appInfo)
{
GError *error = NULL;
*appInfo = nsnull;
GAppInfo *app_info = NULL, *app_info_from_list = NULL;
GList *apps = g_app_info_get_all();
GList *apps_p = apps;
- get_commandline_t g_app_info_get_commandline_ptr;
-
- void *libHandle = dlopen("libgio-2.0.so", RTLD_LAZY);
- if (!libHandle) {
- return NS_ERROR_FAILURE;
- }
- dlerror(); /* clear any existing error */
- g_app_info_get_commandline_ptr =
- (get_commandline_t) dlsym(libHandle, "g_app_info_get_commandline");
- if (dlerror() != NULL) {
- g_app_info_get_commandline_ptr = NULL;
- }
// Try to find relevant and existing GAppInfo in all installed application
+ // We do this by comparing each GAppInfo's executable with out own
while (apps_p) {
app_info_from_list = (GAppInfo*) apps_p->data;
- /* This is a silly test. It just compares app names but not
- * commands. This is due to old version of Glib/Gio. The required
- * function which allows to do a regular check of existence of desktop file
- * is possible by using function g_app_info_get_commandline. This function
- * has been introduced in Glib 2.20. */
- if (app_info_from_list && strcmp(g_app_info_get_name(app_info_from_list),
- PromiseFlatCString(appName).get()) == 0 )
- {
- if (g_app_info_get_commandline_ptr)
- {
- /* Following test is only possible with Glib >= 2.20.
- * Compare path only by using strncmp */
- if (strncmp(g_app_info_get_commandline_ptr(app_info_from_list),
- PromiseFlatCString(cmd).get(),
- strlen(PromiseFlatCString(cmd).get())) == 0)
- {
- app_info = app_info_from_list;
- break;
- } else {
- g_object_unref(app_info_from_list);
- }
- } else {
+ if (!app_info) {
+ // If the executable is not absolute, get it's full path
+ char *executable = g_find_program_in_path(g_app_info_get_executable(app_info_from_list));
+
+ if (executable && strcmp(executable, PromiseFlatCString(cmd).get()) == 0) {
+ g_object_ref (app_info_from_list);
app_info = app_info_from_list;
- break;
}
- } else {
- g_object_unref(app_info_from_list);
+ g_free(executable);
}
+
+ g_object_unref(app_info_from_list);
apps_p = apps_p->next;
}
g_list_free(apps);
if (!app_info) {
app_info = g_app_info_create_from_commandline(PromiseFlatCString(cmd).get(),
PromiseFlatCString(appName).get(),
G_APP_INFO_CREATE_SUPPORTS_URIS,
&error);
}
if (!app_info) {
g_warning("Cannot create application info from command: %s", error->message);
g_error_free(error);
- dlclose(libHandle);
return NS_ERROR_FAILURE;
}
nsGIOMimeApp *mozApp = new nsGIOMimeApp(app_info);
NS_ENSURE_TRUE(mozApp, NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(*appInfo = mozApp);
- dlclose(libHandle);
return NS_OK;
}
diff --git a/xpcom/system/nsIGIOService.idl b/xpcom/system/nsIGIOService.idl
--- a/xpcom/system/nsIGIOService.idl
+++ b/xpcom/system/nsIGIOService.idl
@@ -39,17 +39,17 @@
#include "nsISupports.idl"
interface nsIUTF8StringEnumerator;
interface nsIURI;
/* nsIGIOMimeApp holds information about an application that is looked up
with nsIGIOService::GetAppForMimeType. */
-// 66009894-9877-405b-9321-bf30420e34e6 prev uuid
+// e77021b4-4012-407d-b686-7a1f18050109 prev uuid
[scriptable, uuid(e77021b4-4012-407d-b686-7a1f18050109)]
interface nsIGIOMimeApp : nsISupports
{
const long EXPECTS_URIS = 0;
const long EXPECTS_PATHS = 1;
const long EXPECTS_URIS_FOR_NON_FILES = 2;
@@ -57,41 +57,45 @@ interface nsIGIOMimeApp : nsISupports
readonly attribute AUTF8String name;
readonly attribute AUTF8String command;
readonly attribute long expectsURIs; // see constants above
readonly attribute nsIUTF8StringEnumerator supportedURISchemes;
void launch(in AUTF8String uri);
void setAsDefaultForMimeType(in AUTF8String mimeType);
void setAsDefaultForFileExtensions(in AUTF8String extensions);
+ void setAsDefaultForURIScheme(in AUTF8String uriScheme);
};
/*
* The VFS service makes use of two distinct registries.
*
* The application registry holds information about applications (uniquely
* identified by id), such as which MIME types and URI schemes they are
* capable of handling, whether they run in a terminal, etc.
*
* The MIME registry holds information about MIME types, such as which
* extensions map to a given MIME type. The MIME registry also stores the
* id of the application selected to handle each MIME type.
*/
-// prev id dea20bf0-4e4d-48c5-b932-dc3e116dc64b
-[scriptable, uuid(47e372c2-78bb-4899-8114-56aa7d9cdac5)]
+// prev id 47e372c2-78bb-4899-8114-56aa7d9cdac5
+[scriptable, uuid(74ca8791-330d-4786-9569-2a2a19f0b486)]
interface nsIGIOService : nsISupports
{
/*** MIME registry methods ***/
/* Obtain the MIME type registered for an extension. The extension
should not include a leading dot. */
AUTF8String getMimeTypeFromExtension(in AUTF8String extension);
+ /* Obtain the preferred application for opening a given URI scheme */
+ nsIGIOMimeApp getAppForURIScheme(in AUTF8String aURIScheme);
+
/* Obtain the preferred application for opening a given MIME type */
nsIGIOMimeApp getAppForMimeType(in AUTF8String mimeType);
/* Obtain the preferred application for opening a given MIME type */
nsIGIOMimeApp createAppFromCommand(in AUTF8String cmd,
in AUTF8String appName);
/* Obtain a description for the given MIME type */

23
mozilla-linux3.patch Normal file
View File

@ -0,0 +1,23 @@
# HG changeset patch
# Parent bf7c3e1c6174630743f9f94808c4dd3a2edc0c6b
diff --git a/toolkit/crashreporter/tools/symbolstore.py b/toolkit/crashreporter/tools/symbolstore.py
--- a/toolkit/crashreporter/tools/symbolstore.py
+++ b/toolkit/crashreporter/tools/symbolstore.py
@@ -376,16 +376,17 @@ def GetVCSFilename(file, srcdirs):
return (file.replace("\\", "/"), root)
def GetPlatformSpecificDumper(**kwargs):
"""This function simply returns a instance of a subclass of Dumper
that is appropriate for the current platform."""
return {'win32': Dumper_Win32,
'cygwin': Dumper_Win32,
'linux2': Dumper_Linux,
+ 'linux3': Dumper_Linux,
'sunos5': Dumper_Solaris,
'darwin': Dumper_Mac}[sys.platform](**kwargs)
def SourceIndex(fileStream, outputPath, vcs_root):
"""Takes a list of files, writes info to a data block in a .stream file"""
# Creates a .pdb.stream file in the mozilla\objdir to be used for source indexing
# Create the srcsrv data block that indexes the pdb file
result = True

View File

@ -1,13 +1,13 @@
From: Hans Petter Jansson <hpj@copyleft.no>
Wolfgang Rosenauer <wr@rosenauer.org>
Subject: use libnsssharedhelper if available at compile time
(can be disabled by exporting MOZ_TB_NO_NSSHELPER=1)
(can be disabled by exporting MOZ_XRE_NO_NSSHELPER=1)
References:
diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -571,16 +571,20 @@ MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS
@@ -582,16 +582,20 @@ MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
@ -31,7 +31,7 @@ diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -8610,16 +8610,31 @@ AC_SUBST(QCMS_LIBS)
@@ -8507,16 +8507,31 @@ AC_SUBST(QCMS_LIBS)
dnl ========================================================
dnl HarfBuzz
@ -66,7 +66,7 @@ diff --git a/configure.in b/configure.in
diff --git a/security/manager/ssl/src/Makefile.in b/security/manager/ssl/src/Makefile.in
--- a/security/manager/ssl/src/Makefile.in
+++ b/security/manager/ssl/src/Makefile.in
@@ -117,19 +117,20 @@ CSRCS += md4.c
@@ -114,19 +114,20 @@ CSRCS += md4.c
EXTRA_DEPS = $(NSS_DEP_LIBS)
@ -115,7 +115,7 @@ diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/
#include "nsNetUtil.h"
#include "nsAppDirectoryServiceDefs.h"
@@ -1658,18 +1665,34 @@ nsNSSComponent::InitializeNSS(PRBool sho
@@ -1733,18 +1740,34 @@ nsNSSComponent::InitializeNSS(PRBool sho
ConfigureInternalPKCS11Token();
// The NSS_INIT_NOROOTINIT flag turns off the loading of the root certs
@ -155,12 +155,12 @@ diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/
diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -169,17 +169,17 @@ ifndef MOZ_ENABLE_LIBXUL
EXTRA_DSO_LDOPTS += \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_JS_LIBS) \
$(NULL)
@@ -139,17 +139,17 @@ ifdef MOZ_DEBUG
EXTRA_DSO_LDOPTS += -INCREMENTAL:NO
endif
endif
EXTRA_DSO_LDOPTS += $(LIBS_DIR) $(EXTRA_DSO_LIBS)
DEFINES += -DIMPL_XREAPI

View File

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

View File

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

View File

@ -1,254 +0,0 @@
Bug 624341 - Update check for default mailer to work the new way (glib >= 2.27.1)
diff --git a/mail/components/shell/nsMailGNOMEIntegration.cpp b/mail/components/shell/nsMailGNOMEIntegration.cpp
--- a/mail/components/shell/nsMailGNOMEIntegration.cpp
+++ b/mail/components/shell/nsMailGNOMEIntegration.cpp
@@ -33,28 +33,30 @@
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsMailGNOMEIntegration.h"
#include "nsIGConfService.h"
+#include "nsIGIOService.h"
#include "nsCOMPtr.h"
#include "nsIServiceManager.h"
#include "prenv.h"
#include "nsIFile.h"
#include "nsIStringBundle.h"
#include "nsIPromptService.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
#include "nsEmbedCID.h"
#include "nsMemory.h"
+#include "nsIStringBundle.h"
#include <glib.h>
#include <limits.h>
#include <stdlib.h>
static const char* const sMailProtocols[] = {
"mailto"
};
@@ -77,18 +79,19 @@ nsMailGNOMEIntegration::nsMailGNOMEInteg
nsresult
nsMailGNOMEIntegration::Init()
{
nsresult rv;
// GConf _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;
@@ -117,18 +120,18 @@ nsMailGNOMEIntegration::GetAppPathFromLa
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);
}
+ g_free(fullpath);
} else {
tmp = g_find_program_in_path(launcher);
if (!tmp)
return PR_FALSE;
mAppPath = tmp;
mAppIsInPath = PR_TRUE;
}
@@ -210,66 +213,117 @@ nsMailGNOMEIntegration::KeyMatchesAppNam
return PR_FALSE;
PRBool matches = mAppPath.Equals(commandPath);
g_free(commandPath);
return matches;
}
PRBool
+nsMailGNOMEIntegration::CheckHandlerMatchesAppName(const nsACString &handler) const
+{
+ gint argc;
+ gchar **argv;
+ nsCAutoString command(handler);
+
+ if (g_shell_parse_argv(command.get(), &argc, &argv, NULL)) {
+ command.Assign(argv[0]);
+ g_strfreev(argv);
+ } else {
+ return PR_FALSE;
+ }
+
+ return KeyMatchesAppName(command.get());
+}
+
+PRBool
nsMailGNOMEIntegration::checkDefault(const char* const *aProtocols, unsigned int aLength)
{
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
+ nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
PRBool enabled;
nsCAutoString handler;
+ nsresult rv;
for (unsigned int i = 0; i < aLength; ++i) {
- handler.Truncate();
- nsresult rv = gconf->GetAppForProtocol(nsDependentCString(aProtocols[i]),
- &enabled, handler);
- if (NS_SUCCEEDED(rv))
- {
- // The string will be something of the form: [/path/to/]app "%s"
- // We want to remove all of the parameters and get just the binary name.
+ if (gconf) {
+ handler.Truncate();
+ rv = gconf->GetAppForProtocol(nsDependentCString(aProtocols[i]),
+ &enabled, handler);
+ if (NS_SUCCEEDED(rv) && (!CheckHandlerMatchesAppName(handler) || !enabled)) {
+ return PR_FALSE;
+ }
+ }
- gint argc;
- gchar **argv;
-
- if (g_shell_parse_argv(handler.get(), &argc, &argv, NULL) && argc > 0) {
- handler.Assign(argv[0]);
- g_strfreev(argv);
- } else
+ if (giovfs) {
+ handler.Truncate();
+ nsCOMPtr<nsIGIOMimeApp> app;
+ rv = giovfs->GetAppForURIScheme(nsDependentCString(aProtocols[i]),
+ getter_AddRefs(app));
+ if (NS_FAILED(rv) || !app) {
return PR_FALSE;
-
- if (!KeyMatchesAppName(handler.get()) || !enabled)
- return PR_FALSE; // the handler is disabled or set to another app
+ }
+ rv = app->GetCommand(handler);
+ if (NS_SUCCEEDED(rv) && !CheckHandlerMatchesAppName(handler)) {
+ return PR_FALSE;
+ }
}
}
return PR_TRUE;
}
nsresult
nsMailGNOMEIntegration::MakeDefault(const char* const *aProtocols,
unsigned int aLength)
{
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");
- for (unsigned int i = 0; i < aLength; ++i) {
- nsresult rv = gconf->SetAppForProtocol(nsDependentCString(aProtocols[i]),
- appKeyValue);
+ nsresult rv;
+ if (gconf) {
+ for (unsigned int i = 0; i < aLength; ++i) {
+ rv = gconf->SetAppForProtocol(nsDependentCString(aProtocols[i]),
+ appKeyValue);
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
+ }
+
+ if (giovfs) {
+ 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);
+
+ nsString brandShortName;
+ brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
+ getter_Copies(brandShortName));
+
+ // use brandShortName as the application id.
+ NS_ConvertUTF16toUTF8 id(brandShortName);
+
+ nsCOMPtr<nsIGIOMimeApp> app;
+ rv = giovfs->CreateAppFromCommand(mAppPath, id, getter_AddRefs(app));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ for (unsigned int i = 0; i < aLength; ++i) {
+ rv = app->SetAsDefaultForURIScheme(nsDependentCString(aProtocols[i]));
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
}
return NS_OK;
}
diff --git a/mail/components/shell/nsMailGNOMEIntegration.h b/mail/components/shell/nsMailGNOMEIntegration.h
--- a/mail/components/shell/nsMailGNOMEIntegration.h
+++ b/mail/components/shell/nsMailGNOMEIntegration.h
@@ -37,16 +37,18 @@
* ***** END LICENSE BLOCK ***** */
#ifndef nsMailGNOMEIntegration_h_
#define nsMailGNOMEIntegration_h_
#include "nsIShellService.h"
#include "nsStringGlue.h"
+#define BRAND_PROPERTIES "chrome://branding/locale/brand.properties"
+
#define NS_MAILGNOMEINTEGRATION_CID \
{0xbddef0f4, 0x5e2d, 0x4846, {0xbd, 0xec, 0x86, 0xd0, 0x78, 0x1d, 0x8d, 0xed}}
class nsMailGNOMEIntegration : public nsIShellService
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISHELLSERVICE
@@ -57,15 +59,16 @@ public:
protected:
virtual ~nsMailGNOMEIntegration() {};
PRBool KeyMatchesAppName(const char *aKeyValue) const;
PRBool checkDefault(const char* const *aProtocols, unsigned int aLength);
nsresult MakeDefault(const char* const *aProtocols, unsigned int aLength);
private:
PRBool GetAppPathFromLauncher();
+ PRBool CheckHandlerMatchesAppName(const nsACString& handler) const;
PRPackedBool mUseLocaleFilenames;
PRPackedBool mCheckedThisSession;
nsCString mAppPath;
PRPackedBool mAppIsInPath;
};
#endif

View File

@ -7,7 +7,7 @@ References:
diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -459,16 +459,20 @@ MOZ_PANGO_LIBS = @MOZ_PANGO_LIB
@@ -458,16 +458,20 @@ MOZ_PANGO_LIBS = @MOZ_PANGO_LIB
XT_LIBS = @XT_LIBS@
MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS@
@ -31,7 +31,7 @@ diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -6796,16 +6796,31 @@ AC_SUBST(QCMS_LIBS)
@@ -6759,16 +6759,31 @@ AC_SUBST(QCMS_LIBS)
dnl ========================================================
dnl HarfBuzz
@ -66,9 +66,9 @@ diff --git a/configure.in b/configure.in
diff --git a/mail/app/Makefile.in b/mail/app/Makefile.in
--- a/mail/app/Makefile.in
+++ b/mail/app/Makefile.in
@@ -124,16 +124,17 @@ MOZILLA_INTERNAL_API = 1
APP_XPCOM_LIBS = $(XPCOM_LIBS)
endif
@@ -119,16 +119,17 @@ endif
APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
LIBS += \
$(STATIC_COMPONENTS_LINKER_PATH) \