aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-format.c')
-rw-r--r--mail/em-format.c52
1 files changed, 16 insertions, 36 deletions
diff --git a/mail/em-format.c b/mail/em-format.c
index e331a03493..0ad9057b81 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -31,9 +31,8 @@
#include <libgnomevfs/gnome-vfs-mime.h>
#include <libgnomevfs/gnome-vfs-mime-utils.h>
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
-#include <libgnome/gnome-i18n.h>
-#include <libedataserver/e-msgport.h>
+#include <e-util/e-msgport.h>
#include <camel/camel-url.h>
#include <camel/camel-stream.h>
#include <camel/camel-stream-mem.h>
@@ -202,10 +201,8 @@ em_format_get_type(void)
* @emfc: EMFormatClass
* @info: Callback information.
*
- * Add a mime type handler to this class. This is only used by
- * implementing classes. The @info.old pointer will automatically be
- * setup to point to the old hanlder if one was already set. This can
- * be used for overrides a fallback.
+ * Add a mime type handler to this class. This is only used by implementing
+ * classes.
*
* When a mime type described by @info is encountered, the callback will
* be invoked. Note that @info may be extended by sub-classes if
@@ -216,39 +213,26 @@ em_format_get_type(void)
void
em_format_class_add_handler(EMFormatClass *emfc, EMFormatHandler *info)
{
- d(printf("adding format handler to '%s' '%s'\n", g_type_name_from_class((GTypeClass *)emfc), info->mime_type));
- info->old = g_hash_table_lookup(emfc->type_handlers, info->mime_type);
g_hash_table_insert(emfc->type_handlers, info->mime_type, info);
+ /* FIXME: do we care? This is really gui stuff */
+ /*
+ if (info->applications == NULL)
+ info->applications = gnome_vfs_mime_get_short_list_applications(info->mime_type);*/
}
+
/**
* em_format_class_remove_handler:
- * @emfc:
- * @info:
- *
- * Remove a handler. @info must be a value which was previously
- * added.
+ * @emfc: EMFormatClass
+ * @mime_type: mime-type of handler to remove
+ *
+ * Remove a mime type handler from this class. This is only used by
+ * implementing classes.
**/
void
-em_format_class_remove_handler(EMFormatClass *emfc, EMFormatHandler *info)
+em_format_class_remove_handler (EMFormatClass *emfc, const char *mime_type)
{
- EMFormatHandler *current;
-
- /* TODO: thread issues? */
-
- current = g_hash_table_lookup(emfc->type_handlers, info->mime_type);
- if (current == info) {
- current = info->old;
- if (current)
- g_hash_table_insert(emfc->type_handlers, current->mime_type, current);
- else
- g_hash_table_remove(emfc->type_handlers, info->mime_type);
- } else {
- while (current && current->old != info)
- current = current->old;
- g_return_if_fail(current != NULL);
- current->old = info->old;
- }
+ g_hash_table_remove (emfc->type_handlers, mime_type);
}
/**
@@ -328,8 +312,6 @@ em_format_add_puri(EMFormat *emf, size_t size, const char *cid, CamelMimePart *p
EMFormatPURI *puri;
const char *tmp;
- d(printf("adding puri for part: %s\n", emf->part_id->str));
-
g_assert(size >= sizeof(*puri));
puri = g_malloc0(size);
@@ -485,8 +467,6 @@ emf_clear_puri_node(struct _EMFormatPURITree *node)
pw = (EMFormatPURI *)node->uri_list.head;
pn = pw->next;
while (pn) {
- if (pw->free)
- pw->free(pw);
g_free(pw->uri);
g_free(pw->cid);
g_free(pw->part_id);
@@ -1381,7 +1361,7 @@ emf_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, c
g_string_printf(emf->part_id, "%s", puri->part_id);
em_format_part(emf, stream, puri->part);
} else
- d(printf("unreferenced uri generated by format code: %s\n", puri->uri?puri->uri:puri->cid));
+ printf("unreferenced uri generated by format code: %s\n", puri->uri?puri->uri:puri->cid);
}
puri = purin;
purin = purin->next;