Commit Graph

183 Commits

Author SHA1 Message Date
9468fc2f6b Be more strict in inline PGP mime filter/part parser 2013-01-10 20:31:01 +01:00
b1ed35f70d Coding style and whitespace cleanup. 2013-01-10 11:20:32 -05:00
bed06d9ec3 Move the contact map widgets to addressbook/gui/widgets.
Move the supporting widgets for the contact maps feature alongside
EABContactDisplay.  Removing them from libeutil helps isolate our usage
of libchamplain so it's not imposed on the entire application, and even
3rd party software.  That libchamplain is an optional dependency only
further complicates the matter.

Ideally I'd like to somehow isolate this feature in an extension module,
but we currently lack sufficient hooks for such an extension.  So this
arrangement will have to suffice for now.
2012-12-12 14:33:47 -05:00
d09d8de870 Consolidate base utility libraries into libeutil.
Evolution consists of entirely too many small utility libraries, which
increases linking and loading time, places a burden on higher layers of
the application (e.g. modules) which has to remember to link to all the
small in-tree utility libraries, and makes it difficult to generate API
documentation for these utility libraries in one Gtk-Doc module.

Merge the following utility libraries under the umbrella of libeutil,
and enforce a single-include policy on libeutil so we can reorganize
the files as desired without disrupting its pseudo-public API.

   libemail-utils/libemail-utils.la
   libevolution-utils/libevolution-utils.la
   filter/libfilter.la
   widgets/e-timezone-dialog/libetimezonedialog.la
   widgets/menus/libmenus.la
   widgets/misc/libemiscwidgets.la
   widgets/table/libetable.la
   widgets/text/libetext.la

This also merges libedataserverui from the Evolution-Data-Server module,
since Evolution is its only consumer nowadays, and I'd like to make some
improvements to those APIs without concern for backward-compatibility.

And finally, start a Gtk-Doc module for libeutil.  It's going to be a
project just getting all the symbols _listed_ much less _documented_.
But the skeletal structure is in place and I'm off to a good start.
2012-12-12 14:33:43 -05:00
8a1eb1f24e Use the same certificate-viewer as the trust-prompt from eds
This way it'll be possible to copy whole files if change in one
of them will be done. A real code reuse, rather than copy, would be
ideal, but the trust-prompt is just a module for evolution-user-prompter.
2012-12-11 19:48:07 +01:00
bf30024dd7 Teach EMailExtensionRegistry to find extensions.
Now we have the following extension points in the GType hierarchy:

   E_TYPE_MAIL_FORMATTER_EXTENSION
   E_TYPE_MAIL_FORMATTER_PRINT_EXTENSION
   E_TYPE_MAIL_FORMATTER_QUOTE_EXTENSION
   E_TYPE_MAIL_PARSER_EXTENSION

A registry just needs to be given one of these extension points, and it
can use g_type_children() to find and load all registered extensions.

This eliminates e-mail-format-extensions.[ch] as well as the dynamic
loaders I added a few commits back.  Dynamically loaded extensions are
now easier to register, at the cost of internal extensions being a tad
more cumbersome to register.  Fair tradeoff, imo.

This also makes e_mail_extension_registry_add_extension() a private
function used only by e_mail_formatter_extension_registry_load() and
e_mail_parser_extension_registry_load().
2012-12-07 17:40:28 -05:00
7c656866a2 EMailExtensionRegistry cleanups. 2012-12-07 17:40:25 -05:00
cbb7786a8f Add EMailFormatterQuoteExtension.
This is an abstract base type for formatter extensions which are
intended only for use by EMailFormatterQuote.
2012-12-07 15:22:13 -05:00
076006fae2 Add EMailFormatterPrintExtension.
This is an abstract base type for formatter extensions which are
intended only for use by EMailFormatterPrint.
2012-12-07 15:14:31 -05:00
a5b217e49e e_mail_parser_base_init(): Register internal extension types. 2012-12-07 15:07:14 -05:00
e1a4e302ae e_mail_formatter_quote_base_init(): Register internal extension types. 2012-12-07 15:02:23 -05:00
fef414503a e_mail_formatter_print_base_init(): Register internal extension types. 2012-12-07 14:58:09 -05:00
e6305c503a e_mail_formatter_base_init(): Register internal extension types. 2012-12-07 14:55:20 -05:00
42d4cff57b EMailFormatterContext: Clearify the flags type.
We define the header flags as an enum type, so use the enum type.
2012-12-07 14:01:05 -05:00
49adb381a6 EMailFormatterHeader: Clarify the flags type.
We define the header flags as an enum type, so use the enum type.
2012-12-07 14:01:05 -05:00
aad321aa73 Remove unused EMP_EXTENSION_GET_PARSER macro. 2012-12-07 14:01:05 -05:00
c10235e6dd EMailParserExtension: Convert get_flags() to an enum field.
Of the parser extensions that override get_flags(), they all return a
fixed set of flags.  So we don't need an instance of the extension to
obtain its flags.  Just make it an EMailParserExtensionFlags field in
the class structure.
2012-12-07 14:01:05 -05:00
cab6eac8f1 Convert EMailParserExtension to an abstract class.
With the previous changes, all parser extensions derive from
GObjectClass and implement the EMailParserExtensionInterface.

Simplify things further by making EMailParserExtension an abstract base
class so parser extensions are now just direct subclasses and need not
bother with implementing GObject interfaces.
2012-12-07 14:01:05 -05:00
3ae26f0ab6 Remove unused EMF_EXTENSION_GET_FORMATTER macro. 2012-12-07 14:01:05 -05:00
d9699159f0 EMailFormatterExtension: Convert get_description() to a string field.
Of the formatter extensions that provide a description, they all use a
static string.  So we don't need an instance of the extension to obtain
its description.  Just make it a string field in the class structure.
2012-12-07 14:01:05 -05:00
7885426c2b EMailFormatterExtension: Convert get_display_name() to a string field.
Of the formatter extensions that provide a display name, they all use a
static string.  So we don't need an instance of the extension to obtain
its display name.  Just make it a string field in the class structure.
2012-12-07 14:01:05 -05:00
00b211b0f5 Convert EMailFormatterExtension to an abstract class.
With the previous changes, all formatter extensions derive from
GObjectClass and implement the EMailFormatterExtensionInterface.

Simplify things further by making EMailFormatterExtension an abstract
base class so formatter extensions are now just direct subclasses and
need not bother with implementing GObject interfaces.
2012-12-07 14:01:05 -05:00
54455ca1ad Remove EMailExtension.
EMailExtension is now too trivial to keep as a standalone interface.
Add a 'mime_types' string array to the EMailFormatterExtension and
EMailFormatterParser interface structs.

Alter e_mail_extension_registry_add_extension() to take a 'mime_types'
string array and the GType of an extension to instantiate, rather than
the extension instance directly.

e_mail_extension_registry_remove_extension() is no longer needed.
2012-12-07 14:01:05 -05:00
9d34f72ec1 EMailExtension: Replace mime_types() method with a string array.
In all implementations for EMailExtension, the MIME type list is a
static string array -- with the single exception of the text-highlight
module, where the MIME type list is dynamically assembled once.

Replace the mime_types() method with a "mime_types" string array in the
EMailExtensionInterface struct.  Then the list of MIME types supported
by the class implementing the EMailExtensionInterface can be obtained
without requiring an instance of the class.
2012-12-07 14:01:04 -05:00
3924dc759d EMailParserExtension: Collect EMailParts in a GQueue.
Collect EMailParts in a GQueue provided to the EMailParserExtension,
and change the return type of parse() to gboolean to indicate whether
the given CamelMimePart was handled (even if no parts were added to
the output GQueue).

This avoids the awkward corner case of a parser extension returning a
linked list node with a NULL data member to indicate the CamelMimePart
was handled but no EMailParts produced, and then having to watch out
for that NULL data member corner case throughout the application.

Also, remove the GCancellable parameter from e_mail_parser_error() and
e_mail_parser_wrap_as_attachment() since neither function blocks.
2012-12-07 14:01:04 -05:00
4611bcd7b8 EMailParserExtension cleanups. 2012-12-07 14:01:04 -05:00
91822b42dc Make EMailPartList thread-safe.
Exposing data members in the public struct is unwise, especially when
EMailPartList is used from multiple threads.  Instead keep the members
private and provide a set of thread-safe functions to manipulate them.
2012-12-07 14:01:04 -05:00
2f0d83cf74 EMailFormatterContext: Keep a reference to EMailPartList.
Replace the individual components of an EMailPartList with a reference
on the EMailPartList itself in EMailFormatContext.  Easier to manage.
2012-12-07 14:01:04 -05:00
13f4544daf EMailFormatter: Simplify context allocation.
Replace the create_context() and free_context() class methods with a
"context_size" class member defaulting to sizeof(EMailFormatterContext).

EMailFormatter will use "context_size" to allocate a zero-filled slab of
heap memory.  Since EMailFormatterQuote is currently the only thing that
overrides the "context_size" (to append a "qf_flags" member), let's keep
this simple.
2012-12-07 14:01:04 -05:00
aebf88cc8e EMailFormatter: Class method rearrangement. 2012-12-07 14:01:04 -05:00
56975aec6a Further EMailParser cleanups. 2012-12-04 13:10:53 -05:00
0862979d13 mail_parser_run(): Eliminate a dead code branch.
There's no need to check whether the 'parsers' GQueue is NULL since we
assert that it's non-NULL just a few lines above.
2012-12-04 12:01:43 -05:00
ab3f65a15e Address couple issues found by a Coverity scan 2012-11-30 15:30:45 +01:00
e2c15bd1d5 Bug #686212 - Cannot print html mails with defined <style> 2012-11-26 13:56:46 +01:00
abdefcaa26 Bug #687670 - Signing with both pgp and S/MIME shows only one signature 2012-11-21 17:57:07 +01:00
2c4ae5e768 Coding style and whitespace cleanup. 2012-11-10 15:54:43 -05:00
704b78d23b Replace deprecated GLib symbols (as of GLib 2.34.x) 2012-11-06 16:21:37 +01:00
b3ec9c8c2f Encode also message_uid in e_mail_part_build_uri()
This reverts commit 7050a12868, which broke opening of IMAP message.
It's also the correct solution for the initial issue, because
the message_uid can contain letters which should be encoded in the URI.
2012-10-18 18:00:09 +02:00
5437fa7c35 Bug #684447 - Check for highlight during configure.
If the highlight program cannot be found width AC_PATH_PROGS,
configure will abort with an error message.

You can either
a) install highlight
b) specify the patch with HIGHLIGHT=/path/to/highlight
c) pass --disable-text-highlight to configure to exclude the module

This also makes text-highlight module to fallback to text/plain
formatter when highlight program would crash or fail to ensure
the content is delivered to user.
2012-10-08 23:27:29 +02:00
5ce8bf667d [text/plain parser] Use original part when nothing found inline
This way the view corresponds to the original part properties,
not those stripped by the inline filter. Also initialize
EMailInlineFilter::filename on creation of the structure, thus
the value is actually used on the subparts, if needed.
2012-09-13 08:41:27 +02:00
409b4a5b79 Bug #680537 - Reply to individual message in digest generates empty body 2012-09-12 19:04:36 +02:00
251e8b00da Bug #678291 - Identifies application/mbox as text/plain attachment 2012-09-12 11:39:14 +02:00
cf218fc8f5 BR is not a "pair" HTML element 2012-09-11 17:41:37 +02:00
4a07071e2f Bug #683665 - Crash on displaying message with broken Content-Type attachment 2012-09-11 16:31:35 +02:00
d655d5889c Bug #683663 - Attachment bar missing when showing 'All Message Headers' 2012-09-11 16:19:00 +02:00
f836b409df Don't re-parse attachment parts as attachments 2012-09-11 13:47:17 +02:00
a5bbf35da5 Fix all 'may be used uninitialized' compiler warnings 2012-08-20 13:06:23 +02:00
c85109fc32 Coding style and whitespace cleanup. 2012-08-19 14:17:55 -04:00
43917f0a6d Remove some unused code from EMailReader
This is leftover from the WebKit port and it didn't work
properly. Most of the code was removed, some was moved
to a better place.
2012-08-09 16:16:38 +02:00
8f145c216f Fix condition when to collapse addresses in To/Cc/Bcc headers 2012-08-07 09:29:21 +02:00