From f39e93539588135cb3e160dcb85be599c4aa8702 Mon Sep 17 00:00:00 2001 From: Martyn Russell Date: Mon, 7 Sep 2009 10:46:58 +0100 Subject: Removed tracker-miner-fs/modules/*, no longer used --- src/tracker-miner-fs/modules/evolution-imap.c | 1220 ------------------------- src/tracker-miner-fs/modules/evolution-pop.c | 565 ------------ 2 files changed, 1785 deletions(-) delete mode 100644 src/tracker-miner-fs/modules/evolution-imap.c delete mode 100644 src/tracker-miner-fs/modules/evolution-pop.c (limited to 'src/tracker-miner-fs') diff --git a/src/tracker-miner-fs/modules/evolution-imap.c b/src/tracker-miner-fs/modules/evolution-imap.c deleted file mode 100644 index 98114836f..000000000 --- a/src/tracker-miner-fs/modules/evolution-imap.c +++ /dev/null @@ -1,1220 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc@gnome.org) - * Copyright (C) 2008, Nokia - - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" - -#include - -#include - -#include -#include - -#include -#include - -#include "evolution-imap.h" -#include "evolution-common.h" - -#define RDF_PREFIX TRACKER_RDF_PREFIX -#define RDF_TYPE RDF_PREFIX "type" - -#define NMO_PREFIX TRACKER_NMO_PREFIX - - -#define MODULE_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) \ -{ \ - const GInterfaceInfo g_implement_interface_info = { \ - (GInterfaceInitFunc) iface_init, NULL, NULL \ - }; \ - g_type_module_add_interface (type_module, g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \ -} - -typedef struct EvolutionAccountContext EvolutionAccountContext; - - -enum { - SUMMARY_TYPE_INT32, - SUMMARY_TYPE_UINT32, - SUMMARY_TYPE_STRING, - SUMMARY_TYPE_TOKEN, - SUMMARY_TYPE_TIME_T -}; - -struct EvolutionAccountContext { - gchar *account; - gchar *uid; -}; - -static GHashTable *accounts = NULL; - - -static void tracker_evolution_imap_file_finalize (GObject *object); - -static void tracker_evolution_imap_file_initialize (TrackerModuleFile *file); -static gchar * tracker_evolution_imap_file_get_uri (TrackerModuleFile *file); -static gchar * tracker_evolution_imap_file_get_text (TrackerModuleFile *file); -static TrackerSparqlBuilder * - tracker_evolution_imap_file_get_metadata (TrackerModuleFile *file, gchar **mime_type); -static TrackerModuleFlags - tracker_evolution_imap_file_get_flags (TrackerModuleFile *file); - -static void tracker_evolution_imap_file_iteratable_init (TrackerModuleIteratableIface *iface); -static gboolean tracker_evolution_imap_file_iter_contents (TrackerModuleIteratable *iteratable); -static guint tracker_evolution_imap_file_get_count (TrackerModuleIteratable *iteratable); - - -G_DEFINE_DYNAMIC_TYPE_EXTENDED (TrackerEvolutionImapFile, tracker_evolution_imap_file, TRACKER_TYPE_MODULE_FILE, 0, - MODULE_IMPLEMENT_INTERFACE (TRACKER_TYPE_MODULE_ITERATABLE, - tracker_evolution_imap_file_iteratable_init)) - - -static void -tracker_evolution_imap_file_class_init (TrackerEvolutionImapFileClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - TrackerModuleFileClass *file_class = TRACKER_MODULE_FILE_CLASS (klass); - - object_class->finalize = tracker_evolution_imap_file_finalize; - - file_class->initialize = tracker_evolution_imap_file_initialize; - file_class->get_uri = tracker_evolution_imap_file_get_uri; - file_class->get_text = tracker_evolution_imap_file_get_text; - file_class->get_metadata = tracker_evolution_imap_file_get_metadata; - file_class->get_flags = tracker_evolution_imap_file_get_flags; -} - -static void -tracker_evolution_imap_file_class_finalize (TrackerEvolutionImapFileClass *klass) -{ -} - -static void -tracker_evolution_imap_file_init (TrackerEvolutionImapFile *file) -{ -} - -static void -tracker_evolution_imap_file_iteratable_init (TrackerModuleIteratableIface *iface) -{ - iface->iter_contents = tracker_evolution_imap_file_iter_contents; - iface->get_count = tracker_evolution_imap_file_get_count; -} - -static void -tracker_evolution_imap_file_finalize (GObject *object) -{ - TrackerEvolutionImapFile *file; - - file = TRACKER_EVOLUTION_IMAP_FILE (object); - - g_free (file->imap_dir); - g_free (file->cur_message_uid); - - tracker_file_close (file->summary, FALSE); - - G_OBJECT_CLASS (tracker_evolution_imap_file_parent_class)->finalize (object); -} - -static gboolean -read_summary (FILE *summary, - ...) -{ - va_list args; - gint value_type; - - if (!summary) { - return FALSE; - } - - va_start (args, summary); - - while ((value_type = va_arg (args, gint)) != -1) { - switch (value_type) { - case SUMMARY_TYPE_TIME_T: { - time_t value = 0; - time_t *dest; - int size = sizeof (time_t) - 1; - int c = EOF; - - while (size >= 0 && (c = fgetc (summary)) != EOF) { - value |= ((time_t) c) << (size * 8); - size--; - } - - dest = va_arg (args, time_t*); - - if (dest) { - *dest = value; - } - - if (c == EOF) { - va_end (args); - return FALSE; - } - - break; - } - case SUMMARY_TYPE_INT32: { - gint32 value, *dest; - - if (fread (&value, sizeof (gint32), 1, summary) != 1) { - va_end (args); - return FALSE; - } - - dest = va_arg (args, gint32*); - - if (dest) { - *dest = g_ntohl (value); - } - break; - } - case SUMMARY_TYPE_UINT32: { - guint32 *dest, value = 0; - gint c; - - while (((c = fgetc (summary)) & 0x80) == 0 && c != EOF) { - value |= c; - value <<= 7; - } - - if (c == EOF) { - va_end (args); - return FALSE; - } else { - value |= (c & 0x7f); - } - - dest = va_arg (args, guint32*); - - if (dest) { - *dest = value; - } - break; - } - case SUMMARY_TYPE_STRING: - case SUMMARY_TYPE_TOKEN: { - guint32 len; - gchar *str, **dest; - - /* read string length */ - read_summary (summary, SUMMARY_TYPE_UINT32, &len, -1); - dest = va_arg (args, gchar **); - - if (dest) { - *dest = NULL; - } - - if (value_type == SUMMARY_TYPE_TOKEN) { - if (len < 32) { - continue; - } else { - len -= 31; - } - } - - if (len <= 1) { - continue; - } - - str = g_try_malloc0 (len); - if (!str) { - va_end (args); - return FALSE; - } - - if (fread (str, len - 1, 1, summary) != 1) { - g_free (str); - va_end (args); - return FALSE; - } - - if (dest) { - *dest = str; - } else { - g_free (str); - } - - break; - } - default: - break; - } - } - - va_end (args); - - return TRUE; -} - -static gint -read_summary_header (FILE *summary) -{ - gint32 version, n_messages; - - read_summary (summary, - SUMMARY_TYPE_INT32, &version, - SUMMARY_TYPE_INT32, NULL, /* flags */ - SUMMARY_TYPE_INT32, NULL, /* nextuid */ - SUMMARY_TYPE_TIME_T, NULL, /* time */ - SUMMARY_TYPE_INT32, &n_messages, - -1); - - if ((version < 0x100 && version >= 13)) { - read_summary (summary, - SUMMARY_TYPE_INT32, NULL, /* unread count*/ - SUMMARY_TYPE_INT32, NULL, /* deleted count*/ - SUMMARY_TYPE_INT32, NULL, /* junk count */ - -1); - } - - if (version != 0x30c) { - read_summary (summary, - SUMMARY_TYPE_INT32, NULL, - SUMMARY_TYPE_INT32, NULL, - -1); - } - - return n_messages; -} - -static void -skip_content_info (FILE *summary) -{ - guint32 count, i; - - if (fgetc (summary)) { - read_summary (summary, - SUMMARY_TYPE_TOKEN, NULL, - SUMMARY_TYPE_TOKEN, NULL, - SUMMARY_TYPE_UINT32, &count, - -1); - - if (count <= 500) { - for (i = 0; i < count; i++) { - read_summary (summary, - SUMMARY_TYPE_TOKEN, NULL, - SUMMARY_TYPE_TOKEN, NULL, - -1); - } - } - - read_summary (summary, - SUMMARY_TYPE_TOKEN, NULL, - SUMMARY_TYPE_TOKEN, NULL, - SUMMARY_TYPE_TOKEN, NULL, - SUMMARY_TYPE_UINT32, NULL, - -1); - } - - read_summary (summary, - SUMMARY_TYPE_UINT32, &count, - -1); - - for (i = 0; i < count; i++) { - skip_content_info (summary); - } -} - -static void -account_start_element_handler (GMarkupParseContext *context, - const gchar *element_name, - const gchar **attr_names, - const gchar **attr_values, - gpointer user_data, - GError **error) -{ - EvolutionAccountContext *account_context; - gint i = 0; - - if (strcmp (element_name, "account") != 0) { - return; - } - - account_context = (EvolutionAccountContext *) user_data; - - while (attr_names[i]) { - if (strcmp (attr_names[i], "uid") == 0) { - account_context->uid = g_strdup (attr_values[i]); - return; - } - - i++; - } -} - -static gchar * -get_account_name_from_imap_uri (const gchar *imap_uri) -{ - const gchar *start, *at, *semic; - gchar *user_name, *at_host_name, *account_name; - - /* Assume url schema is: - * imap://foo@imap.free.fr/;etc - * or - * imap://foo;auth=DIGEST-MD5@imap.bar.com/;etc - * - * We try to get "foo@imap.free.fr". - */ - - if (!g_str_has_prefix (imap_uri, "imap://")) { - return NULL; - } - - user_name = at_host_name = account_name = NULL; - - /* check for embedded @ and then look for first colon after that */ - start = imap_uri + 7; - at = strchr (start, '@'); - semic = strchr (start, ';'); - - if ( strlen (imap_uri) < 7 || at == NULL ) { - return g_strdup ("Unknown"); - } - - if (semic < at) { - /* we have a ";auth=FOO@host" schema - Set semic to the next semicolon, which ends the hostname. */ - user_name = g_strndup (start, semic - start); - /* look for ';' at the end of the domain name */ - semic = strchr (at, ';'); - } else { - user_name = g_strndup (start, at - start); - } - - at_host_name = g_strndup (at, (semic - 1) - at); - - account_name = g_strconcat (user_name, at_host_name, NULL); - - g_free (user_name); - g_free (at_host_name); - - return account_name; -} - -static void -account_text_handler (GMarkupParseContext *context, - const gchar *text, - gsize text_len, - gpointer user_data, - GError **error) -{ - EvolutionAccountContext *account_context; - const GSList *uri_element, *source_element; - gchar *url; - - uri_element = g_markup_parse_context_get_element_stack (context); - source_element = uri_element->next; - - if (strcmp ((gchar *) uri_element->data, "url") != 0 || - !source_element || - strcmp ((gchar *) source_element->data, "source") != 0) { - return; - } - - account_context = (EvolutionAccountContext *) user_data; - - url = g_strndup (text, text_len); - account_context->account = get_account_name_from_imap_uri (url); - g_free (url); -} - -static void -ensure_imap_accounts (void) -{ - GConfClient *client; - GMarkupParser parser = { 0 }; - GMarkupParseContext *parse_context; - GSList *list, *l; - EvolutionAccountContext account_context = { 0 }; - - if (G_LIKELY (accounts)) { - return; - } - - client = gconf_client_get_default (); - - list = gconf_client_get_list (client, - "/apps/evolution/mail/accounts", - GCONF_VALUE_STRING, - NULL); - - parser.start_element = account_start_element_handler; - parser.text = account_text_handler; - parse_context = g_markup_parse_context_new (&parser, 0, &account_context, NULL); - - accounts = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, - (GDestroyNotify) g_free); - - for (l = list; l; l = l->next) { - g_markup_parse_context_parse (parse_context, (const gchar *) l->data, -1, NULL); - - if (account_context.account && - account_context.uid) { - g_hash_table_insert (accounts, - account_context.account, - account_context.uid); - } else { - g_free (account_context.account); - g_free (account_context.uid); - } - } - - g_markup_parse_context_free (parse_context); - - g_slist_foreach (list, (GFunc) g_free, NULL); - g_slist_free (list); -} - -static void -tracker_evolution_imap_file_initialize (TrackerModuleFile *file) -{ - TrackerEvolutionImapFile *self; - gchar *path; - - self = TRACKER_EVOLUTION_IMAP_FILE (file); - - self->imap_dir = g_build_filename (g_get_home_dir (), - ".evolution", - "mail", - "imap", - G_DIR_SEPARATOR_S, - NULL); - - path = g_file_get_path (tracker_module_file_get_file (file)); - self->summary = tracker_file_open (path, "r", TRUE); - g_free (path); - - if (!self->summary) { - return; - } - - self->n_messages = read_summary_header (self->summary); - self->cur_message = 1; - - if (self->n_messages > 0) { - /* save current message uid */ - read_summary (self->summary, - SUMMARY_TYPE_STRING, &self->cur_message_uid, /* message uid */ - -1); - } - - ensure_imap_accounts (); -} - - -static gchar * -get_message_path (TrackerModuleFile *file, - const gchar *uid) -{ - gchar *path, *prefix, *message_path; - - path = g_file_get_path (tracker_module_file_get_file (file)); - prefix = g_strndup (path, strlen (path) - strlen ("summary")); - g_free (path); - - message_path = g_strconcat (prefix, uid, ".", NULL); - g_free (prefix); - - return message_path; -} - -static gboolean -get_attachment_info (const gchar *mime_file, - gchar **name, - GMimePartEncodingType *encoding) -{ - GMimeContentType *mime; - gchar *tmp, *mime_content; - const gchar *pos_content_type, *pos_encoding, *pos_end_encoding; - - if (name) { - *name = NULL; - } - - if (encoding) { - *encoding = GMIME_PART_ENCODING_DEFAULT; - } - - if (!g_file_get_contents (mime_file, &tmp, NULL, NULL)) { - return FALSE; - } - - /* all text content in lower case for comparisons */ - mime_content = g_ascii_strdown (tmp, -1); - g_free (tmp); - - pos_content_type = strstr (mime_content, "content-type:"); - - if (pos_content_type) { - pos_encoding = strstr (pos_content_type, "content-transfer-encoding:"); - } - - if (!pos_content_type || !pos_encoding) { - g_free (mime_content); - return FALSE; - } - - pos_content_type += strlen ("content-type:"); - pos_encoding += strlen ("content-transfer-encoding:"); - - /* ignore spaces, tab or line returns */ - while (*pos_content_type != '\0' && (*pos_content_type == ' ' || *pos_content_type == '\t' || *pos_content_type == '\n')) { - pos_content_type++; - } - - while (*pos_encoding != '\0' && *pos_encoding == ' ') { - pos_encoding++; - } - - if (*pos_content_type == '\0' || - *pos_encoding == '\0') { - g_free (mime_content); - return FALSE; - } - - mime = g_mime_content_type_new_from_string (pos_content_type); - - if (mime) { - if (name) { - *name = g_strdup (g_mime_content_type_get_parameter (mime, "name")); - } - - g_mime_content_type_destroy (mime); - } - - if (name && !*name) { - g_free (mime_content); - return FALSE; - } - - /* Find end of encoding */ - pos_end_encoding = pos_encoding; - - while (*pos_end_encoding != '\0' && - *pos_end_encoding != ' ' && - *pos_end_encoding != '\n' && - *pos_end_encoding != '\t') { - pos_end_encoding++; - } - - if (encoding && pos_encoding != pos_end_encoding) { - gchar *encoding_str = g_strndup (pos_encoding, pos_end_encoding - pos_encoding); - - if (strcmp (encoding_str, "7bit") == 0) { - *encoding = GMIME_PART_ENCODING_7BIT; - } else if (strcmp (encoding_str, "8bit") == 0) { - *encoding = GMIME_PART_ENCODING_7BIT; - } else if (strcmp (encoding_str, "binary") == 0) { - *encoding = GMIME_PART_ENCODING_BINARY; - } else if (strcmp (encoding_str, "base64") == 0) { - *encoding = GMIME_PART_ENCODING_BASE64; - } else if (strcmp (encoding_str, "quoted-printable") == 0) { - *encoding = GMIME_PART_ENCODING_QUOTEDPRINTABLE; - } else if (strcmp (encoding_str, "x-uuencode") == 0) { - *encoding = GMIME_PART_ENCODING_UUENCODE; - } - - g_free (encoding_str); - } - - g_free (mime_content); - - return TRUE; -} - -static gchar * -get_message_uri (TrackerModuleFile *file, - const gchar *message_uid) -{ - TrackerEvolutionImapFile *self; - gchar *path, *uri, *dir, *subdirs; - GList *keys, *k; - - self = TRACKER_EVOLUTION_IMAP_FILE (file); - - path = g_file_get_path (tracker_module_file_get_file (file)); - keys = g_hash_table_get_keys (accounts); - uri = NULL; - - for (k = keys; k; k = k->next) { - if (!strstr (path, k->data)) { - continue; - } - - dir = g_build_filename (self->imap_dir, k->data, NULL); - - /* now remove all relevant info to create the email:// basename */ - subdirs = path; - subdirs = tracker_string_remove (subdirs, dir); - subdirs = tracker_string_remove (subdirs, "/folders/"); - subdirs = tracker_string_remove (subdirs, "/subfolders"); - subdirs = tracker_string_remove (subdirs, "/summary"); - - uri = g_strdup_printf ("email://%s/%s;uid=%s", - (gchar *) g_hash_table_lookup (accounts, k->data), - subdirs, - message_uid); - g_free (subdirs); - g_free (dir); - - break; - } - - g_list_free (keys); - - return uri; -} - -static gchar * -tracker_evolution_imap_file_get_uri (TrackerModuleFile *file) -{ - TrackerEvolutionImapFile *self; - gchar *message_uri, *part_filename; - - self = TRACKER_EVOLUTION_IMAP_FILE (file); - - if (!self->cur_message_uid) { - return NULL; - } - - message_uri = get_message_uri (file, self->cur_message_uid); - - if (!message_uri) { - return NULL; - } - - if (self->current_mime_part && - get_attachment_info (self->current_mime_part->data, &part_filename, NULL)) { - gchar *attachment_uri; - - attachment_uri = g_strdup_printf ("%s/%s", message_uri, part_filename); - g_free (message_uri); - g_free (part_filename); - - return attachment_uri; - } - - return message_uri; -} - -static void -extract_message_text (GMimeObject *object, - gpointer user_data) -{ - GString *body = (GString *) user_data; - GMimePartEncodingType part_encoding; - GMimePart *part; - const gchar *content, *disposition, *filename; - gchar *encoding, *part_body; - gsize len; - - if (GMIME_IS_MESSAGE_PART (object)) { - GMimeMessage *message; - - message = g_mime_message_part_get_message (GMIME_MESSAGE_PART (object)); - - if (message) { - g_mime_message_foreach_part (message, extract_message_text, user_data); - g_object_unref (message); - } - - return; - } else if (GMIME_IS_MULTIPART (object)) { - g_mime_multipart_foreach (GMIME_MULTIPART (object), extract_message_text, user_data); - return; - } - - part = GMIME_PART (object); - filename = g_mime_part_get_filename (part); - disposition = g_mime_part_get_content_disposition (part); - part_encoding = g_mime_part_get_encoding (part); - - if (part_encoding == GMIME_PART_ENCODING_BINARY || - part_encoding == GMIME_PART_ENCODING_BASE64 || - part_encoding == GMIME_PART_ENCODING_UUENCODE) { - return; - } - - if (disposition && - strcmp (disposition, GMIME_DISPOSITION_ATTACHMENT) == 0) { - return; - } - - if (filename && - (strcmp (filename, "signature.asc") == 0 || - strcmp (filename, "signature.pgp") == 0)) { - return; - } - - content = g_mime_part_get_content (GMIME_PART (object), &len); - - if (!content) { - return; - } - - if (g_utf8_validate (content, len, NULL)) { - g_string_append_len (body, content, (gssize) len); - return; - } - - encoding = evolution_common_get_object_encoding (object); - - if (encoding) { - part_body = g_convert (content, (gssize) len, "utf8", encoding, NULL, NULL, NULL); - g_string_append (body, part_body); - g_free (part_body); - g_free (encoding); - } -} - -static gchar * -tracker_evolution_imap_file_get_text (TrackerModuleFile *file) -{ - TrackerEvolutionImapFile *self; - gchar *message_path; - GMimeStream *stream; - GMimeParser *parser; - GMimeMessage *message; - GString *body = NULL; - - self = TRACKER_EVOLUTION_IMAP_FILE (file); - - if (self->current_mime_part) { - /* FIXME: Extract text from attachments */ - return NULL; - } - - message_path = get_message_path (file, self->cur_message_uid); - -#if defined(__linux__) - stream = evolution_common_get_stream (message_path, O_RDONLY | O_NOATIME, 0); -#else - stream = evolution_common_get_stream (message_path, O_RDONLY, 0); -#endif - - g_free (message_path); - - if (!stream) { - return NULL; - } - - parser = g_mime_parser_new_with_stream (stream); - g_mime_parser_set_scan_from (parser, FALSE); - message = g_mime_parser_construct_message (parser); - - if (message) { - body = g_string_new (NULL); - g_mime_message_foreach_part (message, extract_message_text, body); - g_object_unref (message); - } - - g_object_unref (stream); - g_object_unref (parser); - - return (body) ? g_string_free (body, FALSE) : NULL; -} - -static GList * -get_recipient_list (const gchar *str) -{ - GList *list = NULL; - gchar **arr; - gint i; - - if (!str) { - return NULL; - } - - arr = g_strsplit (str, ",", -1); - - for (i = 0; arr[i]; i++) { - g_strstrip (arr[i]); - list = g_list_prepend (list, g_strdup (arr[i])); - } - - g_strfreev (arr); - - return g_list_reverse (list); -} - -static TrackerSparqlBuilder * -get_message_metadata (TrackerModuleFile *file) -{ - TrackerEvolutionImapFile *self; - TrackerSparqlBuilder *sparql = NULL; - gchar *subject, *from, *to, *cc, *uri; - gint32 i, count, flags; - time_t t; - GList *list, *l; - gboolean deleted; - - self = TRACKER_EVOLUTION_IMAP_FILE (file); - - if (!read_summary (self->summary, - SUMMARY_TYPE_UINT32, &flags, /* flags */ - -1)) { - return NULL; - } - - deleted = ((flags & EVOLUTION_MESSAGE_JUNK) != 0 || - (flags & EVOLUTION_MESSAGE_DELETED) != 0); - - subject = NULL; - from = NULL; - to = NULL; - cc = NULL; - - if (!read_summary (self->summary, - SUMMARY_TYPE_UINT32, NULL, /* size */ - SUMMARY_TYPE_TIME_T, NULL, /* date sent */ - SUMMARY_TYPE_TIME_T, &t, /* date received */ - SUMMARY_TYPE_STRING, &subject, /* subject */ - SUMMARY_TYPE_STRING, &from, /* from */ - SUMMARY_TYPE_STRING, &to, /* to */ - SUMMARY_TYPE_STRING, &cc, /* cc */ - SUMMARY_TYPE_STRING, NULL, /* mlist */ - -1)) { - g_free (subject); - g_free (from); - g_free (to); - g_free (cc); - return NULL; - } - - if (!deleted && subject && from) { - uri = tracker_module_file_get_uri (file); - - sparql = tracker_sparql_builder_new_update (); - tracker_sparql_builder_insert_open (sparql); - - tracker_sparql_builder_subject_iri (sparql, uri); - tracker_sparql_builder_predicate (sparql, "a"); - tracker_sparql_builder_object (sparql, "nmo:Email"); - - - tracker_sparql_builder_subject_iri (sparql, uri); - tracker_sparql_builder_predicate (sparql, "rdf:type"); - tracker_sparql_builder_object (sparql, "nmo:MailboxDataObject"); - - /* Apparently this gets added by the file-module ATM - tracker_sparql_builder_predicate (sparql, "tracker:available"); - tracker_sparql_builder_object_boolean (sparql, TRUE); */ - - /* The URI of the InformationElement should be a UUID URN */ - tracker_sparql_builder_subject_iri (sparql, uri); - tracker_sparql_builder_predicate (sparql, "nie:isStoredAs"); - tracker_sparql_builder_object_iri (sparql, uri); - - tracker_sparql_builder_predicate (sparql, "nmo:sentDate"); - tracker_sparql_builder_object_date (sparql, &t); - - if (g_utf8_validate (from, -1, NULL)) { - tracker_sparql_builder_predicate (sparql, "nmo:sender"); - tracker_sparql_builder_object_string (sparql, from); - } - - if (g_utf8_validate (subject, -1, NULL)) { - tracker_sparql_builder_predicate (sparql, "nmo:messageSubject"); - tracker_sparql_builder_object_string (sparql, subject); - } - - list = get_recipient_list (to); - - for (l = list; l; l = l->next) { - if (g_utf8_validate (l->data, -1, NULL)) { - tracker_sparql_builder_predicate (sparql, "nmo:to"); - tracker_sparql_builder_object_string (sparql, l->data); - } - g_free (l->data); - } - - g_list_free (list); - - list = get_recipient_list (cc); - - for (l = list; l; l = l->next) { - if (g_utf8_validate (l->data, -1, NULL)) { - tracker_sparql_builder_predicate (sparql, "nmo:cc"); - tracker_sparql_builder_object_string (sparql, l->data); - } - g_free (l->data); - } - - g_list_free (list); - - g_free (uri); - } - - g_free (subject); - g_free (from); - g_free (to); - g_free (cc); - - if (!read_summary (self->summary, - SUMMARY_TYPE_INT32, NULL, - SUMMARY_TYPE_INT32, NULL, - SUMMARY_TYPE_UINT32, &count, - -1)) { - goto corruption; - } - - /* references */ - for (i = 0; i < count; i++) { - if (read_summary (self->summary, - SUMMARY_TYPE_INT32, NULL, - SUMMARY_TYPE_INT32, NULL, - -1)) { - continue; - } - - goto corruption; - } - - if (!read_summary (self->summary, SUMMARY_TYPE_UINT32, &count, -1)) { - goto corruption; - } - - /* user flags */ - for (i = 0; i < count; i++) { - if (read_summary (self->summary, SUMMARY_TYPE_STRING, NULL, -1)) { - continue; - } - - goto corruption; - } - - if (!read_summary (self->summary, SUMMARY_TYPE_UINT32, &count, -1)) { - goto corruption; - } - - /* user tags */ - for (i = 0; i < count; i++) { - if (read_summary (self->summary, - SUMMARY_TYPE_STRING, NULL, - SUMMARY_TYPE_STRING, NULL, - -1)) { - continue; - } - - goto corruption; - } - - /* server flags */ - if (!read_summary (self->summary, - SUMMARY_TYPE_UINT32, NULL, - -1)) { - goto corruption; - } - - skip_content_info (self->summary); - - return sparql; - -corruption: - /* assume corruption */ - if (sparql) { - g_object_unref (sparql); - } - - return NULL; -} - -static TrackerSparqlBuilder * -get_attachment_metadata (TrackerModuleFile *file, - const gchar *mime_file) -{ - TrackerSparqlBuilder *sparql; - GMimeStream *stream; - GMimeDataWrapper *wrapper; - GMimePartEncodingType encoding; - gchar *path, *name, *tmp, *uri; - - if (!get_attachment_info (mime_file, &name, &encoding)) { - return NULL; - } - - path = g_strdup (mime_file); - path = tracker_string_remove (path, ".MIME"); - -#if defined(__linux__) - stream = evolution_common_get_stream (path, O_RDONLY | O_NOATIME, 0); -#else - stream = evolution_common_get_stream (path, O_RDONLY, 0); -#endif - - if (!stream) { - g_free (name); - g_free (path); - return NULL; - } - - wrapper = g_mime_data_wrapper_new_with_stream (stream, encoding); - - tmp = tracker_module_file_get_uri (file); - - sparql = tracker_sparql_builder_new_update (); - tracker_sparql_builder_insert_open (sparql); - - /* TODO: we should add 1.1, 1.2, 1.3 as mime-spec per attachment to the - * URI. Else we don't have a valid URI. Also note that Evolution just - * doesn't support this anyway. (So adding it to the URI and trying to - * index Evolution's attachments is a bit pointless. We can't start/make - * Evolution opening the specific attachment anyway */ - - uri = g_strdup_printf ("%s#%s", tmp, mime_file); - tracker_sparql_builder_subject_iri (sparql, uri); - tracker_sparql_builder_predicate (sparql, "a"); - tracker_sparql_builder_object (sparql, "nmo:Attachment"); - - evolution_common_get_wrapper_metadata (wrapper, sparql, uri); - - /* Apparently this gets added by the file-module ATM - tracker_sparql_builder_subject_iri (sparql, uri); - tracker_sparql_builder_predicate (sparql, "tracker:available"); - tracker_sparql_builder_object_boolean (sparql, TRUE); */ - - g_free (uri); - g_free (tmp); - - g_object_unref (wrapper); - g_object_unref (stream); - g_free (name); - g_free (path); - - return sparql; -} - -static TrackerSparqlBuilder * -tracker_evolution_imap_file_get_metadata (TrackerModuleFile *file, gchar **mime_type) -{ - TrackerEvolutionImapFile *self; - - self = TRACKER_EVOLUTION_IMAP_FILE (file); - - if (self->cur_message > self->n_messages) { - return NULL; - } - - if (self->current_mime_part) { - return get_attachment_metadata (file, self->current_mime_part->data); - } else { - return get_message_metadata (file); - } -} - -static TrackerModuleFlags -tracker_evolution_imap_file_get_flags (TrackerModuleFile *file) -{ - return TRACKER_FILE_CONTENTS_STATIC; -} - -static GList * -extract_mime_parts (TrackerEvolutionImapFile *self) -{ - gboolean has_attachment = TRUE; - gint n_attachment = 0; - gchar *message_path; - GList *mime_parts = NULL; - - message_path = get_message_path (TRACKER_MODULE_FILE (self), - self->cur_message_uid); - - while (has_attachment) { - gchar *mime_file; - - n_attachment++; - mime_file = g_strdup_printf ("%s%d.MIME", message_path, n_attachment); - - if (g_file_test (mime_file, G_FILE_TEST_EXISTS)) { - mime_parts = g_list_prepend (mime_parts, mime_file); - } else { - g_free (mime_file); - has_attachment = FALSE; - } - } - - g_free (message_path); - - return g_list_reverse (mime_parts); -} - -static gboolean -tracker_evolution_imap_file_iter_contents (TrackerModuleIteratable *iteratable) -{ - TrackerEvolutionImapFile *self; - - self = TRACKER_EVOLUTION_IMAP_FILE (iteratable); - - /* Iterate through mime parts, if any */ - if (!self->mime_parts) { - self->mime_parts = extract_mime_parts (self); - self->current_mime_part = self->mime_parts; - } else { - self->current_mime_part = self->current_mime_part->next; - } - - if (self->current_mime_part) { - return TRUE; - } - - g_list_foreach (self->mime_parts, (GFunc) g_free, NULL); - g_list_free (self->mime_parts); - self->mime_parts = NULL; - - g_free (self->cur_message_uid); - self->cur_message_uid = NULL; - - /* save current message uid */ - read_summary (self->summary, - SUMMARY_TYPE_STRING, &self->cur_message_uid, /* message uid */ - -1); - - self->cur_message++; - - return (self->cur_message < self->n_messages); -} - -static guint -tracker_evolution_imap_file_get_count (TrackerModuleIteratable *iteratable) -{ - TrackerEvolutionImapFile *self; - - self = TRACKER_EVOLUTION_IMAP_FILE (iteratable); - - return self->n_messages; -} - -void -tracker_evolution_imap_file_register (GTypeModule *module) -{ - tracker_evolution_imap_file_register_type (module); -} - -TrackerModuleFile * -tracker_evolution_imap_file_new (GFile *file) -{ - return g_object_new (TRACKER_TYPE_EVOLUTION_IMAP_FILE, - "file", file, - NULL); -} diff --git a/src/tracker-miner-fs/modules/evolution-pop.c b/src/tracker-miner-fs/modules/evolution-pop.c deleted file mode 100644 index f9ad1b93f..000000000 --- a/src/tracker-miner-fs/modules/evolution-pop.c +++ /dev/null @@ -1,565 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc@gnome.org) - * Copyright (C) 2008, Nokia - - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" - -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include "evolution-pop.h" -#include "evolution-common.h" - -#define NMO_PREFIX TRACKER_NMO_PREFIX -#define RDF_PREFIX TRACKER_RDF_PREFIX -#define RDF_TYPE RDF_PREFIX "type" - -#define MODULE_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) \ -{ \ - const GInterfaceInfo g_implement_interface_info = { \ - (GInterfaceInitFunc) iface_init, NULL, NULL \ - }; \ - g_type_module_add_interface (type_module, g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \ -} - -static void tracker_evolution_pop_file_finalize (GObject *object); - -static void tracker_evolution_pop_file_initialize (TrackerModuleFile *file); -static gchar * tracker_evolution_pop_file_get_uri (TrackerModuleFile *file); -static gchar * tracker_evolution_pop_file_get_text (TrackerModuleFile *file); -static TrackerSparqlBuilder * - tracker_evolution_pop_file_get_metadata (TrackerModuleFile *file, gchar **mime_type); -static TrackerModuleFlags - tracker_evolution_pop_file_get_flags (TrackerModuleFile *file); - -static void tracker_evolution_pop_file_iteratable_init (TrackerModuleIteratableIface *iface); -static gboolean tracker_evolution_pop_file_iter_contents (TrackerModuleIteratable *iteratable); - - -G_DEFINE_DYNAMIC_TYPE_EXTENDED (TrackerEvolutionPopFile, tracker_evolution_pop_file, TRACKER_TYPE_MODULE_FILE, 0, - MODULE_IMPLEMENT_INTERFACE (TRACKER_TYPE_MODULE_ITERATABLE, - tracker_evolution_pop_file_iteratable_init)) - - -static void -tracker_evolution_pop_file_class_init (TrackerEvolutionPopFileClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - TrackerModuleFileClass *file_class = TRACKER_MODULE_FILE_CLASS (klass); - - object_class->finalize = tracker_evolution_pop_file_finalize; - - file_class->initialize = tracker_evolution_pop_file_initialize; - file_class->get_uri = tracker_evolution_pop_file_get_uri; - file_class->get_text = tracker_evolution_pop_file_get_text; - file_class->get_metadata = tracker_evolution_pop_file_get_metadata; - file_class->get_flags = tracker_evolution_pop_file_get_flags; -} - -static void -tracker_evolution_pop_file_class_finalize (TrackerEvolutionPopFileClass *klass) -{ -} - -static void -tracker_evolution_pop_file_init (TrackerEvolutionPopFile *file) -{ -} - -static void -tracker_evolution_pop_file_iteratable_init (TrackerModuleIteratableIface *iface) -{ - iface->iter_contents = tracker_evolution_pop_file_iter_contents; -} - -static void -tracker_evolution_pop_file_finalize (GObject *object) -{ - TrackerEvolutionPopFile *file; - - file = TRACKER_EVOLUTION_POP_FILE (object); - - if (file->mime_parts) { - g_list_foreach (file->mime_parts, (GFunc) g_object_unref, NULL); - g_list_free (file->mime_parts); - } - - if (file->message) { - g_object_unref (file->message); - } - - if (file->parser) { - g_object_unref (file->parser); - } - - if (file->stream) { - g_mime_stream_close (file->stream); - g_object_unref (file->stream); - } - - g_free (file->local_folder); - - G_OBJECT_CLASS (tracker_evolution_pop_file_parent_class)->finalize (object); -} - -static void -tracker_evolution_pop_file_initialize (TrackerModuleFile *file) -{ - TrackerEvolutionPopFile *self; - gchar *path; - - self = TRACKER_EVOLUTION_POP_FILE (file); - path = g_file_get_path (tracker_module_file_get_file (file)); - - self->local_folder = g_build_filename (g_get_home_dir (), - ".evolution", "mail", "local", G_DIR_SEPARATOR_S, - NULL); - -#if defined(__linux__) - self->stream = evolution_common_get_stream (path, O_RDONLY | O_NOATIME, 0); -#else - self->stream = evolution_common_get_stream (path, O_RDONLY, 0); -#endif - - if (self->stream) { - self->parser = g_mime_parser_new_with_stream (self->stream); - g_mime_parser_set_scan_from (self->parser, TRUE); - - /* Initialize to the first message */ - self->message = g_mime_parser_construct_message (self->parser); - } - - g_free (path); -} - - -static gint -get_message_id (GMimeMessage *message) -{ - const gchar *header, *pos; - gchar *number; - gint id; - - header = g_mime_message_get_header (message, "X-Evolution"); - - if (!header) { - return -1; - } - - pos = strchr (header, '-'); - - number = g_strndup (header, pos - header); - id = strtoul (number, NULL, 16); - - g_free (number); - - return id; -} - -static gchar * -get_message_uri (TrackerModuleFile *file, - GMimeMessage *message) -{ - TrackerEvolutionPopFile *self; - gchar *path, *uri; - gint message_id; - - self = TRACKER_EVOLUTION_POP_FILE (file); - message_id = get_message_id (message); - - if (message_id < 0) { - return NULL; - } - - path = g_file_get_path (tracker_module_file_get_file (file)); - path = tracker_string_remove (path, self->local_folder); - path = tracker_string_remove (path, ".sbd"); - - uri = g_strdup_printf ("email://local@local/%s;uid=%d", path, message_id); - - g_free (path); - - return uri; -} - -static gchar * -tracker_evolution_pop_file_get_uri (TrackerModuleFile *file) -{ - TrackerEvolutionPopFile *self; - gchar *message_uri; - - self = TRACKER_EVOLUTION_POP_FILE (file); - - if (!self->message) { - return NULL; - } - - message_uri = get_message_uri (file, self->message); - - if (!message_uri) { - return NULL; - } - - if (self->current_mime_part) { - gchar *attachment_uri; - const gchar *part_filename; - - part_filename = g_mime_part_get_filename (self->current_mime_part->data); - attachment_uri = g_strdup_printf ("%s/%s", message_uri, part_filename); - g_free (message_uri); - - return attachment_uri; - } - - return message_uri; -} - -static gchar * -tracker_evolution_pop_file_get_text (TrackerModuleFile *file) -{ - TrackerEvolutionPopFile *self; - gchar *text, *encoding, *utf8_text = NULL; - gboolean is_html; - - self = TRACKER_EVOLUTION_POP_FILE (file); - - if (self->current_mime_part) { - /* FIXME: Extract text from attachments */ - return NULL; - } - - text = g_mime_message_get_body (self->message, TRUE, &is_html); - - if (!text) { - return NULL; - } - - encoding = evolution_common_get_object_encoding (GMIME_OBJECT (self->message)); - - if (encoding) { - utf8_text = g_convert (text, -1, "utf8", encoding, NULL, NULL, NULL); - - g_free (encoding); - g_free (text); - } - - return utf8_text; -} - -static guint -get_message_flags (GMimeMessage *message) -{ - const gchar *header, *pos; - - header = g_mime_message_get_header (message, "X-Evolution"); - - if (!header) { - return 0; - } - - pos = strchr (header, '-'); - - return (guint) strtoul (pos + 1, NULL, 16); -} - -static GList * -get_message_recipients (GMimeMessage *message, - const gchar *type) -{ - GList *list = NULL; - const InternetAddressList *addresses; - - addresses = g_mime_message_get_recipients (message, type); - - while (addresses) { - InternetAddress *address; - gchar *str; - - address = addresses->address; - - if (address->name && address->value.addr) { - str = g_strdup_printf ("%s %s", address->name, address->value.addr); - } else if (address->value.addr) { - str = g_strdup (address->value.addr); - } else if (address->name) { - str = g_strdup (address->name); - } else { - str = NULL; - } - - if (str) { - list = g_list_prepend (list, str); - } - - addresses = addresses->next; - } - - return g_list_reverse (list); -} - -static TrackerSparqlBuilder * -get_message_metadata (TrackerModuleFile *file, GMimeMessage *message) -{ - TrackerSparqlBuilder *sparql; - time_t t; - GList *list, *l; - gchar *uri; - - uri = tracker_module_file_get_uri (file); - - sparql = tracker_sparql_builder_new_update (); - tracker_sparql_builder_insert_open (sparql); - - tracker_sparql_builder_subject_iri (sparql, uri); - tracker_sparql_builder_predicate (sparql, "a"); - tracker_sparql_builder_object (sparql, "nmo:Email"); - - tracker_sparql_builder_subject_iri (sparql, uri); - tracker_sparql_builder_predicate (sparql, "rdf:type"); - tracker_sparql_builder_object (sparql, "nmo:MailboxDataObject"); - - /* Apparently this gets added by the file-module ATM - tracker_sparql_builder_predicate (sparql, "tracker:available"); - tracker_sparql_builder_object_boolean (sparql, TRUE); */ - - /* The URI of the InformationElement should be a UUID URN */ - tracker_sparql_builder_subject_iri (sparql, uri); - tracker_sparql_builder_predicate (sparql, "nie:isStoredAs"); - tracker_sparql_builder_object_iri (sparql, uri); - - g_mime_message_get_date (message, &t, NULL); - tracker_sparql_builder_predicate (sparql, "nmo:sentDate"); - tracker_sparql_builder_object_date (sparql, &t); - - tracker_sparql_builder_predicate (sparql, "nmo:sender"); - tracker_sparql_builder_object_string (sparql, g_mime_message_get_sender (message)); - - tracker_sparql_builder_predicate (sparql, "nmo:messageSubject"); - tracker_sparql_builder_object_string (sparql, g_mime_message_get_subject (message)); - - list = get_message_recipients (message, GMIME_RECIPIENT_TYPE_TO); - - for (l = list; l; l = l->next) { - tracker_sparql_builder_predicate (sparql, "nmo:to"); - tracker_sparql_builder_object_string (sparql, l->data); - g_free (l->data); - } - - g_list_free (list); - - list = get_message_recipients (message, GMIME_RECIPIENT_TYPE_CC); - - for (l = list; l; l = l->next) { - tracker_sparql_builder_predicate (sparql, "nmo:cc"); - tracker_sparql_builder_object_string (sparql, l->data); - g_free (l->data); - } - - g_list_free (list); - - g_free (uri); - - return sparql; -} - -static TrackerSparqlBuilder * -get_attachment_metadata (TrackerModuleFile *file, GMimePart *part) -{ - TrackerSparqlBuilder *sparql; - GMimeDataWrapper *content; - gchar *tmp, *uri; - - content = g_mime_part_get_content_object (part); - - if (!content) { - return NULL; - } - - sparql = tracker_sparql_builder_new_update (); - tracker_sparql_builder_insert_open (sparql); - - tmp = tracker_module_file_get_uri (file); - - /* TODO: we should add 1.1, 1.2, 1.3 as mime-spec per attachment to the - * URI. Else we don't have a valid URI. Also note that Evolution just - * doesn't support this anyway. (So adding it to the URI and trying to - * index Evolution's attachments is a bit pointless. We can't start/make - * Evolution opening the specific attachment anyway */ - - uri = g_strdup_printf ("%s#%s", tmp, g_mime_part_get_content_id (part)); - tracker_sparql_builder_subject_iri (sparql, uri); - tracker_sparql_builder_predicate (sparql, "a"); - tracker_sparql_builder_object (sparql, "nmo:Attachment"); - - evolution_common_get_wrapper_metadata (content, sparql, uri); - - /* Apparently this gets added by the file-module ATM - tracker_sparql_builder_subject_iri (sparql, uri); - tracker_sparql_builder_predicate (sparql, "tracker:available"); - tracker_sparql_builder_object_boolean (sparql, TRUE); */ - - g_free (uri); - g_free (tmp); - - g_object_unref (content); - - return sparql; -} - -static TrackerSparqlBuilder * -tracker_evolution_pop_file_get_metadata (TrackerModuleFile *file, gchar **mime_type) -{ - TrackerEvolutionPopFile *self; - TrackerSparqlBuilder *sparql; - guint flags; - - self = TRACKER_EVOLUTION_POP_FILE (file); - - if (!self->message) { - return NULL; - } - - flags = get_message_flags (self->message); - - if (flags & EVOLUTION_MESSAGE_JUNK || - flags & EVOLUTION_MESSAGE_DELETED) { - return NULL; - } - - - if (self->current_mime_part) { - sparql = get_attachment_metadata (file, self->current_mime_part->data); - } else { - sparql = get_message_metadata (file, self->message); - } - - return sparql; -} - -static TrackerModuleFlags -tracker_evolution_pop_file_get_flags (TrackerModuleFile *file) -{ - return TRACKER_FILE_CONTENTS_STATIC; -} - -static void -extract_mime_parts (GMimeObject *object, - gpointer user_data) -{ - GList **list = (GList **) user_data; - const gchar *disposition, *filename; - GMimePart *part; - - if (GMIME_IS_MESSAGE_PART (object)) { - GMimeMessage *message; - - message = g_mime_message_part_get_message (GMIME_MESSAGE_PART (object)); - - if (message) { - g_mime_message_foreach_part (message, extract_mime_parts, user_data); - g_object_unref (message); - } - - return; - } else if (GMIME_IS_MULTIPART (object)) { - g_mime_multipart_foreach (GMIME_MULTIPART (object), extract_mime_parts, user_data); - return; - } - - part = GMIME_PART (object); - disposition = g_mime_part_get_content_disposition (part); - - if (!disposition || - (strcmp (disposition, GMIME_DISPOSITION_ATTACHMENT) != 0 && - strcmp (disposition, GMIME_DISPOSITION_INLINE) != 0)) { - return; - } - - filename = g_mime_part_get_filename (GMIME_PART (object)); - - if (!filename || - strcmp (filename, "signature.asc") == 0 || - strcmp (filename, "signature.pgp") == 0) { - return; - } - - *list = g_list_prepend (*list, g_object_ref (object)); -} - -static gboolean -tracker_evolution_pop_file_iter_contents (TrackerModuleIteratable *iteratable) -{ - TrackerEvolutionPopFile *self; - - self = TRACKER_EVOLUTION_POP_FILE (iteratable); - - if (!self->parser) { - return FALSE; - } - - if (self->message) { - /* Iterate through mime parts, if any */ - if (!self->mime_parts) { - g_mime_message_foreach_part (self->message, - extract_mime_parts, - &self->mime_parts); - self->current_mime_part = self->mime_parts; - } else { - self->current_mime_part = self->current_mime_part->next; - } - - if (self->current_mime_part) { - return TRUE; - } - - /* all possible mime parts have been already iterated, move on */ - g_object_unref (self->message); - - g_list_foreach (self->mime_parts, (GFunc) g_object_unref, NULL); - g_list_free (self->mime_parts); - self->mime_parts = NULL; - } - - self->message = g_mime_parser_construct_message (self->parser); - - return (self->message != NULL); -} - -void -tracker_evolution_pop_file_register (GTypeModule *module) -{ - tracker_evolution_pop_file_register_type (module); -} - -TrackerModuleFile * -tracker_evolution_pop_file_new (GFile *file) -{ - return g_object_new (TRACKER_TYPE_EVOLUTION_POP_FILE, - "file", file, - NULL); -} -- cgit v1.2.1