GNOME Bugzilla – Bug 350823
Clicking on email link should always start mail component
Last modified: 2013-09-13 00:51:31 UTC
Please describe the problem: Forwarding this from downstream. http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197868 Clicking on an "mailto" URL in GNOME should cause Evolution to start with its mail component activated. Steps to reproduce: 1. Start Evolution and switch to, say, the Calendar or Contacts component. 2. Close Evolution. 3. Open a "mailto" URL from some application that supports it. (e.g. Gaim, or even GNOME Terminal) Actual results: Evoluton starts with the most recently used component activated. Expected results: Evolution should start with the Mail component activated. Does this happen every time? Yes Other information: The solution we came up with downstream is to modify the GConf schema so that the mailto URL command is "evolution --component=mail %s" instead of "evolution %s". But this requires Evolution's default-mailer plug-in to have more robust detection of whether Evolution is the default mailer. The plug-in should also install the same command in GConf when the user elects to make Evolution the default mailer.
Created attachment 70683 [details] [review] Proposed patch for the default-mailer plug-in. This patch makes detection of Evolution as the default mailer more robust. Where before it was matching the entire "mailto" URL command string, now it breaks the string down into components. With this logic, Evolution is the default mailer if the basename of the first token in the command string starts with "evolution". Also, this now allows advanced users to customize the way Evolution is invoked from "mailto" URLs without confusing the default-mailer detection logic. For example, the logic will correctly detect that Evolution is the default mailer when given the following string: /home/mbarnes/test/evolution-2.8 --component=mail %s
hmm... i'm not entirely sure of this, as you always get the email composer window (which is the most important thingy here of course), but anyway - probably a nice enhancement, yes.
Let me try to clarify what I'm trying to fix, as there are actually two loosely related bugs here. Perhaps I should've filed separate bug reports. The first is an enhancement, and it's actually the one I care more about. Currently on the GNOME desktop whenever a "mailto" link is clicked, the command "evolution %s" is given to start Evolution and bring up the composer window. Now, Evolution's default-mailer plug-in tries to figure out whether Evolution is the default mailer by looking up this command in GConf. The problem I see is that the command has to be _exactly_ "evolution %s" in order for the plug-in to recognize Evolution as the default mailer. Any command-line options or path name in the string confuses the plug-in and, in turn, the user. The patch that I've proposed tries to make the default-mailer plug-in smarter by decomposing the command string in a manner similar to the way the shell would, and then trying to determine whether the program being invoked is indeed Evolution. With this patch, the plug-in correctly identifies Evolution as the default mailer for all of the following command strings: evolution %s evolution-2.8 %s /usr/bin/evolution-2.8 %s /usr/bin/evolution-2.8 --component=mail %s /home/mbarnes/test/evolution-2.8 --component=mail --debug=log %s The second bug is what the problem description covers, and the solution is trivial. But solution depends on the first bug being fixed for it to work. Hope that helps explain my intentions a little better.
Looks great. COmmitted to HEAD.
yeah, sexy patch, thanks a lot for the good work and for caring in general, matthew.