Accepting request 55669 from GNOME:Factory

Accepted submit request 55669 from user vuntz

OBS-URL: https://build.opensuse.org/request/show/55669
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/evolution?expand=0&rev=95
This commit is contained in:
Marcus Rückert 2010-12-13 11:41:28 +00:00 committed by Git OBS Bridge
commit 71ed6b3089
3 changed files with 151 additions and 6 deletions

View File

@ -0,0 +1,133 @@
commit 61999b493fc4266300eab2907909867e73e4cc1e
Author: Milan Crha <mcrha@redhat.com>
Date: Wed Oct 20 15:24:29 2010 +0200
Bug #631451 - Add handlers for x-scheme-handler/mailto
diff --git a/data/evolution.desktop.in.in b/data/evolution.desktop.in.in
index d69738e..5fdad27 100644
--- a/data/evolution.desktop.in.in
+++ b/data/evolution.desktop.in.in
@@ -14,4 +14,4 @@ X-GNOME-Bugzilla-Product=Evolution
X-GNOME-Bugzilla-Component=BugBuddyBugs
X-GNOME-Bugzilla-Version=@BASE_VERSION@.x
X-GNOME-Bugzilla-OtherBinaries=e-addressbook-factory;e-calendar-factory
-MimeType=text/calendar;text/x-vcard;text/directory;application/mbox;message/rfc822;
+MimeType=text/calendar;text/x-vcard;text/directory;application/mbox;message/rfc822;x-scheme-handler/mailto;
diff --git a/modules/mailto-handler/evolution-mailto-handler.c b/modules/mailto-handler/evolution-mailto-handler.c
index 367d9166..01d1bd2 100644
--- a/modules/mailto-handler/evolution-mailto-handler.c
+++ b/modules/mailto-handler/evolution-mailto-handler.c
@@ -30,7 +30,9 @@
((obj), E_TYPE_MAILTO_HANDLER, EMailtoHandler))
#define MAILTO_COMMAND \
- "evolution --component=mail %s"
+ "evolution --component=mail"
+
+#define MAILTO_HANDLER "x-scheme-handler/mailto"
typedef struct _EMailtoHandler EMailtoHandler;
typedef struct _EMailtoHandlerClass EMailtoHandlerClass;
@@ -63,13 +65,18 @@ mailto_handler_get_shell (EMailtoHandler *extension)
}
static gboolean
-mailto_handler_is_evolution (const gchar *mailto_command)
+mailto_handler_is_evolution (/*const*/ GAppInfo *app_info)
{
gint argc;
gchar **argv;
gchar *basename;
gboolean is_evolution;
+ const gchar *mailto_command;
+
+ if (app_info == NULL)
+ return FALSE;
+ mailto_command = g_app_info_get_commandline (app_info);
if (mailto_command == NULL)
return FALSE;
@@ -174,14 +181,14 @@ mailto_handler_check (EMailtoHandler *extension)
EShell *shell;
EShellSettings *shell_settings;
gboolean check_mailto_handler = TRUE;
- gchar *mailto_command = NULL;
+ GAppInfo *app_info = NULL;
+ GError *error = NULL;
shell = mailto_handler_get_shell (extension);
shell_settings = e_shell_get_shell_settings (shell);
g_object_get (
shell_settings,
- "mailto-handler-command", &mailto_command,
"mailto-handler-check", &check_mailto_handler,
NULL);
@@ -189,25 +196,37 @@ mailto_handler_check (EMailtoHandler *extension)
if (!check_mailto_handler)
goto exit;
+ app_info = g_app_info_get_default_for_type (MAILTO_HANDLER, FALSE);
+
/* Is Evolution already handling "mailto" URIs? */
- if (mailto_handler_is_evolution (mailto_command))
+ if (mailto_handler_is_evolution (app_info))
goto exit;
/* Does the user want Evolution to handle them? */
if (!mailto_handler_prompt (extension))
goto exit;
+ if (app_info)
+ g_object_unref (app_info);
+
/* Configure Evolution to be the "mailto" URI handler. */
+ app_info = g_app_info_create_from_commandline (
+ MAILTO_COMMAND,
+ _("Evolution"),
+ G_APP_INFO_CREATE_SUPPORTS_URIS,
+ &error);
- g_object_set (
- shell_settings,
- "mailto-handler-command", MAILTO_COMMAND,
- "mailto-handler-enabled", TRUE,
- "mailto-handler-needs-terminal", FALSE,
- NULL);
+ if (app_info && !error)
+ g_app_info_set_as_default_for_type (app_info, MAILTO_HANDLER, &error);
exit:
- g_free (mailto_command);
+ if (app_info)
+ g_object_unref (app_info);
+
+ if (error) {
+ g_warning ("Failed to register as default handler: %s", error->message);
+ g_error_free (error);
+ }
}
static void
@@ -226,18 +245,6 @@ mailto_handler_constructed (GObject *object)
"mailto-handler-check",
"/apps/evolution/mail/prompts/checkdefault");
- e_shell_settings_install_property_for_key (
- "mailto-handler-command",
- "/desktop/gnome/url-handlers/mailto/command");
-
- e_shell_settings_install_property_for_key (
- "mailto-handler-enabled",
- "/desktop/gnome/url-handlers/mailto/enabled");
-
- e_shell_settings_install_property_for_key (
- "mailto-handler-needs-terminal",
- "/desktop/gnome/url-handlers/mailto/needs_terminal");
-
g_signal_connect_swapped (
shell, "event::ready-to-start",
G_CALLBACK (mailto_handler_check), extension);

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Fri Dec 10 16:37:48 CET 2010 - vuntz@opensuse.org
- Add evolution-mime-scheme-handler.patch to register the mailto
scheme MIME type. This is needed because of a change in how gio
works.
- Call %desktop_database_post/%desktop_database_postun in
%post/%postun.
- Use %mime_database_post/%mime_database_postun macros instead of
plain call to update-mime-database in %post/%postun.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Nov 16 09:20:46 CET 2010 - dimstar@opensuse.org Tue Nov 16 09:20:46 CET 2010 - dimstar@opensuse.org

View File

@ -74,6 +74,8 @@ Release: 1
# FIXME: check with upstream/meego if we want to enable clutter for express mode # FIXME: check with upstream/meego if we want to enable clutter for express mode
Summary: The Integrated GNOME Mail, Calendar, and Address Book Suite Summary: The Integrated GNOME Mail, Calendar, and Address Book Suite
Source0: ftp://ftp.gnome.org/pub/gnome/sources/evolution/2.25/%{name}-%{version}.tar.bz2 Source0: ftp://ftp.gnome.org/pub/gnome/sources/evolution/2.25/%{name}-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM evolution-mime-scheme-handler.patch bgo#631451 vuntz@opensuse.org -- Taken from git, register mailto-related mime type
Patch0: evolution-mime-scheme-handler.patch
# PATCH-NEEDS-REBASE calendar-sendbutton.patch -- It also needs a proper description and a bug number # PATCH-NEEDS-REBASE calendar-sendbutton.patch -- It also needs a proper description and a bug number
Patch7: calendar-sendbutton.patch Patch7: calendar-sendbutton.patch
# PATCH-FIX-OPENSUSE evolution-custom-openldap-includes.patch maw@novell.com -- look for ldap includes in %{_libdir}/evoldap/include # PATCH-FIX-OPENSUSE evolution-custom-openldap-includes.patch maw@novell.com -- look for ldap includes in %{_libdir}/evoldap/include
@ -177,6 +179,7 @@ Evolution or embed the existing ones in other applications.
%prep %prep
%setup -q %setup -q
translation-update-upstream translation-update-upstream
%patch0 -p1
# %patch7 # %patch7
%if %USE_EVOLDAP %if %USE_EVOLDAP
%patch15 -p1 %patch15 -p1
@ -243,18 +246,16 @@ find %{buildroot} -name '*.la' -type f -delete -print
%pre -f %{name}.schemas_pre %pre -f %{name}.schemas_pre
%post %post
if test -x usr/bin/update-mime-database ; then %desktop_database_post
usr/bin/update-mime-database usr/share/mime >/dev/null %mime_database_post
fi
%posttrans -f %{name}.schemas_posttrans %posttrans -f %{name}.schemas_posttrans
%preun -f %{name}.schemas_preun %preun -f %{name}.schemas_preun
%postun %postun
if test -x usr/bin/update-mime-database ; then %desktop_database_postun
usr/bin/update-mime-database usr/share/mime >/dev/null %mime_database_postun
fi
%files -f %{name}.schemas_list %files -f %{name}.schemas_list
%defattr(-,root,root) %defattr(-,root,root)