[evolution-data-server/wip/camel-more-gobject: 58/62] Remove unused CamelMessageInfo::bodystructure related stuff



commit 9f033a7ef1f1fb93183b82f1070fc45624abd7c2
Author: Milan Crha <mcrha redhat com>
Date:   Tue Sep 13 14:29:59 2016 +0200

    Remove unused CamelMessageInfo::bodystructure related stuff

 camel/camel-db.c                            |   31 ---------------------------
 camel/camel-db.h                            |    3 --
 camel/camel-folder-summary.c                |   15 +++---------
 camel/camel-folder-summary.h                |    6 +---
 camel/providers/imapx/camel-imapx-server.c  |    2 +-
 camel/providers/local/camel-local-summary.c |    2 +-
 6 files changed, 8 insertions(+), 51 deletions(-)
---
diff --git a/camel/camel-db.c b/camel/camel-db.c
index 3eaf024..5fd2c3a 100644
--- a/camel/camel-db.c
+++ b/camel/camel-db.c
@@ -1500,14 +1500,6 @@ camel_db_create_message_info_table (CamelDB *cdb,
        ret = camel_db_add_to_transaction (cdb, table_creation_query, error);
        sqlite3_free (table_creation_query);
 
-       table_creation_query = sqlite3_mprintf (
-               "CREATE TABLE IF NOT EXISTS '%q_bodystructure' ( "
-                       "uid TEXT PRIMARY KEY , "
-                       "bodystructure TEXT )",
-                       folder_name);
-       ret = camel_db_add_to_transaction (cdb, table_creation_query, error);
-       sqlite3_free (table_creation_query);
-
        /* FIXME: sqlize folder_name before you create the index */
        safe_index = g_strdup_printf ("SINDEX-%s", folder_name);
        table_creation_query = sqlite3_mprintf ("DROP INDEX IF EXISTS %Q", safe_index);
@@ -1884,15 +1876,6 @@ write_mir (CamelDB *cdb,
 
        sqlite3_free (ins_query);
 
-       if (ret == 0) {
-               ins_query = sqlite3_mprintf (
-                       "INSERT OR REPLACE INTO "
-                       "'%q_bodystructure' VALUES (%Q, %Q )",
-                       folder_name, record->uid, record->bodystructure);
-               ret = camel_db_add_to_transaction (cdb, ins_query, error);
-               sqlite3_free (ins_query);
-       }
-
        return ret;
 }
 
@@ -2132,10 +2115,6 @@ camel_db_delete_uid (CamelDB *cdb,
 
        camel_db_begin_transaction (cdb, error);
 
-       tab = sqlite3_mprintf ("DELETE FROM '%q_bodystructure' WHERE uid = %Q", folder, uid);
-       ret = camel_db_add_to_transaction (cdb, tab, error);
-       sqlite3_free (tab);
-
        tab = sqlite3_mprintf ("DELETE FROM %Q WHERE uid = %Q", folder, uid);
        ret = camel_db_add_to_transaction (cdb, tab, error);
        sqlite3_free (tab);
@@ -2232,23 +2211,19 @@ camel_db_clear_folder_summary (CamelDB *cdb,
        gint ret;
        gchar *folders_del;
        gchar *msginfo_del;
-       gchar *bstruct_del;
 
        folders_del = sqlite3_mprintf ("DELETE FROM folders WHERE folder_name = %Q", folder);
        msginfo_del = sqlite3_mprintf ("DELETE FROM %Q ", folder);
-       bstruct_del = sqlite3_mprintf ("DELETE FROM '%q_bodystructure' ", folder);
 
        camel_db_begin_transaction (cdb, error);
 
        camel_db_add_to_transaction (cdb, msginfo_del, error);
        camel_db_add_to_transaction (cdb, folders_del, error);
-       camel_db_add_to_transaction (cdb, bstruct_del, error);
 
        ret = camel_db_end_transaction (cdb, error);
 
        sqlite3_free (folders_del);
        sqlite3_free (msginfo_del);
-       sqlite3_free (bstruct_del);
 
        return ret;
 }
@@ -2276,10 +2251,6 @@ camel_db_delete_folder (CamelDB *cdb,
        ret = camel_db_add_to_transaction (cdb, del, error);
        sqlite3_free (del);
 
-       del = sqlite3_mprintf ("DROP TABLE '%q_bodystructure' ", folder);
-       ret = camel_db_add_to_transaction (cdb, del, error);
-       sqlite3_free (del);
-
        ret = camel_db_end_transaction (cdb, error);
 
        CAMEL_DB_RELEASE_SQLITE_MEMORY;
@@ -2347,7 +2318,6 @@ camel_db_camel_mir_free (CamelMIRecord *record)
                g_free (record->usertags);
                g_free (record->cinfo);
                g_free (record->bdata);
-               g_free (record->bodystructure);
 
                g_free (record);
        }
@@ -2514,7 +2484,6 @@ static struct _known_column_names {
 } known_column_names[] = {
        { "attachment",                 CAMEL_DB_COLUMN_ATTACHMENT },
        { "bdata",                      CAMEL_DB_COLUMN_BDATA },
-       { "bodystructure",              CAMEL_DB_COLUMN_BODYSTRUCTURE },
        { "cinfo",                      CAMEL_DB_COLUMN_CINFO },
        { "deleted",                    CAMEL_DB_COLUMN_DELETED },
        { "deleted_count",              CAMEL_DB_COLUMN_DELETED_COUNT },
diff --git a/camel/camel-db.h b/camel/camel-db.h
index 6535502..b5dc9b0 100644
--- a/camel/camel-db.h
+++ b/camel/camel-db.h
@@ -161,7 +161,6 @@ struct _CamelDB {
  *     content info string - composite string
  * @bdata:
  *     provider specific data
- * @bodystructure:
  *
  * The extensive DB format, supporting basic searching and sorting.
  *
@@ -194,7 +193,6 @@ typedef struct _CamelMIRecord {
        gchar *usertags;
        gchar *cinfo;
        gchar *bdata;
-       gchar *bodystructure;
 } CamelMIRecord;
 
 /**
@@ -228,7 +226,6 @@ typedef enum {
        CAMEL_DB_COLUMN_UNKNOWN = -1,
        CAMEL_DB_COLUMN_ATTACHMENT,
        CAMEL_DB_COLUMN_BDATA,
-       CAMEL_DB_COLUMN_BODYSTRUCTURE,
        CAMEL_DB_COLUMN_CINFO,
        CAMEL_DB_COLUMN_DELETED,
        CAMEL_DB_COLUMN_DELETED_COUNT,
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 81dc2b6..03fcae6 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -122,7 +122,7 @@ static gint my_list_size (struct _node **list);
 
 static CamelMessageInfo * message_info_new_from_header (CamelFolderSummary *, struct _camel_header_raw *);
 static CamelMessageInfo * message_info_new_from_parser (CamelFolderSummary *, CamelMimeParser *);
-static CamelMessageInfo * message_info_new_from_message (CamelFolderSummary *summary, CamelMimeMessage *msg, 
const gchar *bodystructure);
+static CamelMessageInfo * message_info_new_from_message (CamelFolderSummary *summary, CamelMimeMessage *msg);
 
 static CamelMessageContentInfo * content_info_new_from_header (CamelFolderSummary *, struct 
_camel_header_raw *);
 static CamelMessageContentInfo * content_info_new_from_parser (CamelFolderSummary *, CamelMimeParser *);
@@ -2000,10 +2000,6 @@ mir_from_cols (CamelMIRecord *mir,
                        case CAMEL_DB_COLUMN_BDATA:
                                mir->bdata = g_strdup (cols[i]);
                                break;
-                       case CAMEL_DB_COLUMN_BODYSTRUCTURE:
-                               /* Evolution itself doesn't yet use this, ignoring */
-                               /* mir->bodystructure = g_strdup (cols[i]); */
-                               break;
                        default:
                                g_warn_if_reached ();
                                break;
@@ -2620,7 +2616,6 @@ camel_folder_summary_info_new_from_parser (CamelFolderSummary *summary,
  * camel_folder_summary_info_new_from_message:
  * @summary: a #CamelFolderSummary object
  * @message: a #CamelMimeMessage object
- * @bodystructure: a bodystructure or NULL
  *
  * Create a summary item from a message.
  *
@@ -2629,14 +2624,13 @@ camel_folder_summary_info_new_from_parser (CamelFolderSummary *summary,
  **/
 CamelMessageInfo *
 camel_folder_summary_info_new_from_message (CamelFolderSummary *summary,
-                                            CamelMimeMessage *msg,
-                                            const gchar *bodystructure)
+                                            CamelMimeMessage *msg)
 {
        CamelMessageInfo *info;
        CamelFolderSummaryPrivate *p = summary->priv;
        CamelIndexName *name = NULL;
 
-       info = CAMEL_FOLDER_SUMMARY_GET_CLASS (summary)->message_info_new_from_message (summary, msg, 
bodystructure);
+       info = CAMEL_FOLDER_SUMMARY_GET_CLASS (summary)->message_info_new_from_message (summary, msg);
 
        /* assign a unique uid, this is slightly 'wrong' as we do not really
         * know if we are going to store this in the summary, but we need it set for indexing */
@@ -2994,8 +2988,7 @@ content_info_new_from_parser (CamelFolderSummary *summary,
 
 static CamelMessageInfo *
 message_info_new_from_message (CamelFolderSummary *summary,
-                               CamelMimeMessage *msg,
-                               const gchar *bodystructure)
+                               CamelMimeMessage *msg)
 {
        return CAMEL_FOLDER_SUMMARY_GET_CLASS (summary)->message_info_new_from_header (summary, 
((CamelMimePart *) msg)->headers);
 }
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index f3a9844..62fcd9a 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -144,8 +144,7 @@ struct _CamelFolderSummaryClass {
        CamelMessageInfo *
                        (*message_info_new_from_message)
                                        (CamelFolderSummary *summary,
-                                        CamelMimeMessage *message,
-                                        const gchar *bodystructure);
+                                        CamelMimeMessage *message);
 
        /* save/load individual content info's */
        CamelMessageContentInfo *
@@ -242,8 +241,7 @@ CamelMessageInfo *
 CamelMessageInfo *
                camel_folder_summary_info_new_from_message
                                                (CamelFolderSummary *summary,
-                                                CamelMimeMessage *message,
-                                                const gchar *bodystructure);
+                                                CamelMimeMessage *message);
 
 CamelMessageContentInfo *
                camel_folder_summary_content_info_new
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index d3d0f71..2c49989 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -4575,7 +4575,7 @@ camel_imapx_server_append_message_sync (CamelIMAPXServer *is,
 
        date_time = camel_mime_message_get_date (message, NULL);
        path = camel_data_cache_get_filename (message_cache, "new", uid);
-       info = camel_folder_summary_info_new_from_message (summary, message, NULL);
+       info = camel_folder_summary_info_new_from_message (summary, message);
 
        camel_message_info_set_abort_notifications (info, TRUE);
        camel_message_info_set_uid (info, uid);
diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c
index 079daf4..f80f181 100644
--- a/camel/providers/local/camel-local-summary.c
+++ b/camel/providers/local/camel-local-summary.c
@@ -520,7 +520,7 @@ local_summary_add (CamelLocalSummary *cls,
 
        summary = CAMEL_FOLDER_SUMMARY (cls);
 
-       mi = camel_folder_summary_info_new_from_message (summary, msg, NULL);
+       mi = camel_folder_summary_info_new_from_message (summary, msg);
        camel_message_info_set_abort_notifications (mi, TRUE);
 
        if (info) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]