[evolution-patches] cleanups for evolution/mail
- From: Kjartan Maraas <kmaraas broadpark no>
- To: evolution-patches <evolution-patches gnome org>
- Subject: [evolution-patches] cleanups for evolution/mail
- Date: Sat, 10 Dec 2005 20:13:10 +0100
- change 1-bit bitfields to guint
- remove unused/unreachable code
- fix some name clashes for variables
- remove unused functions
- fix some wrong format specifiers
Cheers
Kjartan
? .em-subscribe-editor.c.swp
? .message-list.c.swp
? Evolution-Mail-common.c
? Evolution-Mail-skels.c
? Evolution-Mail-stubs.c
? Evolution-Mail.h
? evolution-mail-2.6.schemas
? mail.error
? default/zh_CN/Makefile
? default/zh_CN/Makefile.in
Index: em-account-editor.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-account-editor.h,v
retrieving revision 1.3
diff -u -p -r1.3 em-account-editor.h
--- em-account-editor.h 1 Mar 2005 06:17:19 -0000 1.3
+++ em-account-editor.h 10 Dec 2005 19:12:01 -0000
@@ -55,7 +55,7 @@ struct _EMAccountEditor {
struct _EAccount *account; /* working account, must instant apply to this */
struct _EAccount *original; /* original account, not changed unless commit is invoked */
- int do_signature:1; /* allow editing signature */
+ guint do_signature:1; /* allow editing signature */
};
struct _EMAccountEditorClass {
Index: em-composer-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-composer-utils.c,v
retrieving revision 1.46
diff -u -p -r1.46 em-composer-utils.c
--- em-composer-utils.c 23 Nov 2005 06:46:51 -0000 1.46
+++ em-composer-utils.c 10 Dec 2005 19:12:10 -0000
@@ -1040,13 +1040,10 @@ void
em_utils_redirect_message (CamelMimeMessage *message)
{
EMsgComposer *composer;
- CamelDataWrapper *wrapper;
g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message));
composer = redirect_get_composer (message);
-
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (message));
gtk_widget_show (GTK_WIDGET (composer));
e_msg_composer_unset_changed (composer);
Index: em-folder-tree.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree.c,v
retrieving revision 1.157
diff -u -p -r1.157 em-folder-tree.c
--- em-folder-tree.c 22 Oct 2005 08:18:50 -0000 1.157
+++ em-folder-tree.c 10 Dec 2005 19:12:14 -0000
@@ -91,8 +91,8 @@ struct _EMFolderTreePrivate {
gboolean (*excluded_func)(EMFolderTree *emft, GtkTreeModel *model, GtkTreeIter *iter, void *data);
void *excluded_data;
- int do_multiselect:1; /* multiple select mode */
- int cursor_set:1; /* set to TRUE means we or something
+ guint do_multiselect:1; /* multiple select mode */
+ guint cursor_set:1; /* set to TRUE means we or something
* else has set the cursor, otherwise
* we need to set it when we set the
* selection */
@@ -1155,15 +1155,15 @@ emft_drop_target(EMFolderTree *emft, Gdk
/* Check for special sources, and vfolder stuff */
if (src_uri) {
CamelURL *url;
- char *path;
+ char *url_path;
/* FIXME: this is a total hack, but i think all we can do at present */
/* Check for dragging from special folders which can't be moved/copied */
url = camel_url_new(src_uri, NULL);
- path = url->fragment?url->fragment:url->path;
- if (path && path[0]) {
+ url_path = url->fragment?url->fragment:url->path;
+ if (url_path && url_path[0]) {
/* don't allow moving any of the the local special folders */
- if (sstore == local && is_special_local_folder (path)) {
+ if (sstore == local && is_special_local_folder (url_path)) {
GdkAtom xfolder;
camel_url_free (url);
@@ -1184,16 +1184,16 @@ emft_drop_target(EMFolderTree *emft, Gdk
}
/* don't allow copying/moving of the UNMATCHED vfolder */
- if (!strcmp (url->protocol, "vfolder") && !strcmp (path, CAMEL_UNMATCHED_NAME)) {
+ if (!strcmp (url->protocol, "vfolder") && !strcmp (url_path, CAMEL_UNMATCHED_NAME)) {
camel_url_free (url);
goto done;
}
/* don't allow copying/moving of any vTrash/vJunk folder nor maildir 'inbox' */
- if (strcmp(path, CAMEL_VTRASH_NAME) == 0
- || strcmp(path, CAMEL_VJUNK_NAME) == 0
+ if (strcmp(url_path, CAMEL_VTRASH_NAME) == 0
+ || strcmp(url_path, CAMEL_VJUNK_NAME) == 0
/* Dont allow drag from maildir 'inbox' */
- || strcmp(path, ".") == 0) {
+ || strcmp(url_path, ".") == 0) {
camel_url_free(url);
goto done;
}
Index: em-folder-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-utils.c,v
retrieving revision 1.6
diff -u -p -r1.6 em-folder-utils.c
--- em-folder-utils.c 10 Aug 2005 02:04:31 -0000 1.6
+++ em-folder-utils.c 10 Dec 2005 19:12:14 -0000
@@ -513,14 +513,14 @@ em_folder_utils_rename_folder (CamelFold
} else {
CamelFolderInfo *fi;
CamelException ex;
- char *path, *p;
+ char *path, *tmp;
if (base_len > 0) {
path = g_malloc (base_len + strlen (new_name) + 2);
memcpy (path, folder->full_name, base_len);
- p = path + base_len;
- *p++ = '/';
- strcpy (p, new_name);
+ tmp = path + base_len;
+ *tmp++ = '/';
+ strcpy (tmp, new_name);
} else {
path = g_strdup (new_name);
}
Index: em-folder-view.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-view.c,v
retrieving revision 1.135
diff -u -p -r1.135 em-folder-view.c
--- em-folder-view.c 28 Nov 2005 16:37:58 -0000 1.135
+++ em-folder-view.c 10 Dec 2005 19:12:17 -0000
@@ -136,8 +136,8 @@ struct _EMFolderViewPrivate {
guint seen_id;
guint setting_notify_id;
guint selected_id;
- int nomarkseen:1;
- int destroyed:1;
+ guint nomarkseen:1;
+ guint destroyed:1;
GtkWidget *invisible;
char *selection_uri;
Index: em-folder-view.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-view.h,v
retrieving revision 1.18
diff -u -p -r1.18 em-folder-view.h
--- em-folder-view.h 21 Oct 2005 07:54:56 -0000 1.18
+++ em-folder-view.h 10 Dec 2005 19:12:19 -0000
@@ -90,18 +90,18 @@ struct _EMFolderView {
TODO: should this be on class? */
int mark_seen_timeout; /* local copy of gconf stuff */
- int mark_seen:1;
- int preview_active:1; /* is preview being used */
- int statusbar_active:1; /* should we manage the statusbar messages ourselves? */
- int hide_deleted:1;
- int list_active:1; /* we actually showing the list? */
+ guint mark_seen:1;
+ guint preview_active:1; /* is preview being used */
+ guint statusbar_active:1; /* should we manage the statusbar messages ourselves? */
+ guint hide_deleted:1;
+ guint list_active:1; /* we actually showing the list? */
};
struct _EMFolderViewClass {
GtkVBoxClass parent_class;
/* behaviour definition */
- int update_message_style:1;
+ guint update_message_style:1;
/* if used as a control, used to activate/deactivate custom menu's */
void (*activate)(EMFolderView *, struct _BonoboUIComponent *uic, int state);
Index: em-format-html-print.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-format-html-print.h,v
retrieving revision 1.6
diff -u -p -r1.6 em-format-html-print.h
--- em-format-html-print.h 19 May 2005 06:46:23 -0000 1.6
+++ em-format-html-print.h 10 Dec 2005 19:12:19 -0000
@@ -22,7 +22,7 @@ struct _EMFormatHTMLPrint {
struct _GnomePrintConfig *config;
struct _EMFormatHTML *source; /* used for print_message */
- int preview:1;
+ guint preview:1;
};
struct _EMFormatHTMLPrintClass {
Index: em-format-html.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-format-html.c,v
retrieving revision 1.83
diff -u -p -r1.83 em-format-html.c
--- em-format-html.c 26 Aug 2005 01:52:55 -0000 1.83
+++ em-format-html.c 10 Dec 2005 19:12:21 -0000
@@ -815,6 +815,7 @@ static void
efh_text_html(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info)
{
const char *location;
+ /* This is set but never used for anything */
EMFormatPURI *puri;
char *cid = NULL;
@@ -1019,6 +1020,7 @@ efh_multipart_related(EMFormat *emf, Cam
CamelContentType *content_type;
const char *start;
int i, nparts, partidlen, displayid = 0;
+ /* puri is set but never used */
EMFormatPURI *puri;
struct _EMFormatHTMLJob *job;
Index: em-format.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-format.c,v
retrieving revision 1.50
diff -u -p -r1.50 em-format.c
--- em-format.c 19 Aug 2005 05:38:22 -0000 1.50
+++ em-format.c 10 Dec 2005 19:12:22 -0000
@@ -1219,7 +1219,8 @@ emf_multipart_alternative(EMFormat *emf,
/* as per rfc, find the last part we know how to display */
nparts = camel_multipart_get_number(mp);
for (i = 0; i < nparts; i++) {
- CamelMimePart *part = camel_multipart_get_part(mp, i);
+ /* is it correct to use the passed in *part here? */
+ part = camel_multipart_get_part(mp, i);
CamelContentType *type = camel_mime_part_get_content_type (part);
char *mime_type = camel_content_type_simple (type);
Index: em-inline-filter.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-inline-filter.c,v
retrieving revision 1.9
diff -u -p -r1.9 em-inline-filter.c
--- em-inline-filter.c 1 Jul 2005 03:29:23 -0000 1.9
+++ em-inline-filter.c 10 Dec 2005 19:12:22 -0000
@@ -104,7 +104,8 @@ enum {
EMIF_PGPSIGNED,
EMIF_PGPENCRYPTED,
};
-const struct {
+
+static const struct {
const char *name;
CamelTransferEncoding type;
int plain:1;
@@ -249,7 +250,7 @@ emif_scan(CamelMimeFilter *f, char *in,
data_start = inptr;
emif->state = EMIF_PLAIN;
} else {
- int len, linelen;
+ int linelen;
/* check the length byte matches the data, if not, output what we have and re-scan this line */
len = ((start[0] - ' ') & 077);
Index: em-mailer-prefs.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-mailer-prefs.h,v
retrieving revision 1.12
diff -u -p -r1.12 em-mailer-prefs.h
--- em-mailer-prefs.h 3 May 2004 10:30:59 -0000 1.12
+++ em-mailer-prefs.h 10 Dec 2005 19:12:22 -0000
@@ -57,8 +57,8 @@ typedef struct _EMMailerPrefsHeader EMMa
struct _EMMailerPrefsHeader {
char *name;
- int enabled:1;
- int is_default:1;
+ guint enabled:1;
+ guint is_default:1;
};
struct _EMMailerPrefs {
Index: em-migrate.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-migrate.c,v
retrieving revision 1.50
diff -u -p -r1.50 em-migrate.c
--- em-migrate.c 17 Jun 2005 15:20:29 -0000 1.50
+++ em-migrate.c 10 Dec 2005 19:12:24 -0000
@@ -1034,7 +1034,7 @@ static e_gconf_map_list_t gconf_remap_li
{ 0 },
};
-struct {
+static struct {
char *label;
char *colour;
} label_default[5] = {
@@ -1617,7 +1617,7 @@ em_migrate_folder(EMMigrateSession *sess
size_t slen, dlen;
FILE *fp;
char *p;
- int i, mode;
+ int mode;
g_string_printf (src, "%s/%s", uri + 5, name);
mbox_build_filename (dest, ((CamelService *)session->store)->url->path, full_name);
Index: em-subscribe-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-subscribe-editor.c,v
retrieving revision 1.19
diff -u -p -r1.19 em-subscribe-editor.c
--- em-subscribe-editor.c 2 Aug 2005 03:10:09 -0000 1.19
+++ em-subscribe-editor.c 10 Dec 2005 19:12:24 -0000
@@ -113,7 +113,7 @@ struct _EMSubscribe {
/* working variables at runtime */
int selected_count;
int selected_subscribed_count;
- gboolean subscribed_state:1; /* for setting the selection*/
+ guint subscribed_state:1; /* for setting the selection*/
};
typedef struct _EMSubscribeNode EMSubscribeNode;
Index: em-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-utils.c,v
retrieving revision 1.68
diff -u -p -r1.68 em-utils.c
--- em-utils.c 18 Oct 2005 08:31:39 -0000 1.68
+++ em-utils.c 10 Dec 2005 19:12:25 -0000
@@ -118,44 +118,6 @@ em_utils_prompt_user(GtkWindow *parent,
return button == GTK_RESPONSE_YES;
}
-
-char *
-em_utils_temp_save_attachments (GSList *attachments)
-{
- char *path = NULL;
- GSList *selected;
-
- path = e_mkdtemp("evolution-attachments-XXXXXX");
-
- for ( selected = attachments; selected != NULL; selected = selected->next) {
- const char *file_name;
- char *safe_name = NULL;
- char *file_path;
- CamelMimePart *part = (CamelMimePart *)((EAttachment *)selected->data)->body;
-
- file_name = camel_mime_part_get_filename(part);
- if (file_name == NULL) {
- file_name = _("attachment");
- } else {
- safe_name = g_strdup(file_name);
- e_filename_make_safe(safe_name);
- file_name = safe_name;
- }
-
- file_path = g_build_filename (path, file_name, NULL);
-
- if (!g_file_test(file_path, (G_FILE_TEST_EXISTS)))
- mail_save_part(part, file_path, NULL, NULL);
- else
- g_warning ("Could not save %s. File already exists", file_path);
-
- g_free (file_path);
- g_free (safe_name);
- }
-
- return path;
-}
-
/**
* em_utils_uids_copy:
* @uids: array of uids
Index: em-vfolder-rule.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-vfolder-rule.c,v
retrieving revision 1.8
diff -u -p -r1.8 em-vfolder-rule.c
--- em-vfolder-rule.c 28 Sep 2005 07:49:08 -0000 1.8
+++ em-vfolder-rule.c 10 Dec 2005 19:12:25 -0000
@@ -54,7 +54,7 @@ static void em_vfolder_rule_init(EMVFold
static void em_vfolder_rule_finalise(GObject *obj);
/* DO NOT internationalise these strings */
-const char *with_names[] = {
+static const char *with_names[] = {
"specific",
"local",
"remote_active",
Index: mail-autofilter.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-autofilter.c,v
retrieving revision 1.56
diff -u -p -r1.56 mail-autofilter.c
--- mail-autofilter.c 16 May 2005 07:53:53 -0000 1.56
+++ mail-autofilter.c 10 Dec 2005 19:12:25 -0000
@@ -270,14 +270,14 @@ rule_from_message (FilterRule *rule, Rul
if (flags & AUTO_FROM) {
const CamelInternetAddress *from;
int i;
- const char *name, *addr;
+ const char *name, *address;
char *namestr;
from = camel_mime_message_get_from (msg);
- for (i = 0; from && camel_internet_address_get (from, i, &name, &addr); i++) {
- rule_add_sender(context, rule, addr);
+ for (i = 0; from && camel_internet_address_get (from, i, &name, &address); i++) {
+ rule_add_sender(context, rule, address);
if (name == NULL || name[0] == '\0')
- name = addr;
+ name = address;
namestr = g_strdup_printf(_("Mail from %s"), name);
filter_rule_set_name (rule, namestr);
g_free (namestr);
Index: mail-component.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.c,v
retrieving revision 1.125
diff -u -p -r1.125 mail-component.c
--- mail-component.c 22 Aug 2005 02:54:51 -0000 1.125
+++ mail-component.c 10 Dec 2005 19:12:25 -0000
@@ -106,7 +106,7 @@ struct _store_info {
void *done_data;
int ref_count:31;
- int removed:1;
+ guint removed:1;
};
struct _MailComponentPrivate {
Index: mail-folder-cache.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-folder-cache.c,v
retrieving revision 1.102
diff -u -p -r1.102 mail-folder-cache.c
--- mail-folder-cache.c 24 Aug 2005 03:05:26 -0000 1.102
+++ mail-folder-cache.c 10 Dec 2005 19:12:27 -0000
@@ -336,14 +336,11 @@ free_folder_info(struct _folder_info *mf
static void
update_1folder(struct _folder_info *mfi, int new, CamelFolderInfo *info)
{
- struct _store_info *si;
struct _folder_update *up;
CamelFolder *folder;
int unread = -1;
int deleted;
- si = mfi->store_info;
-
folder = mfi->folder;
if (folder) {
d(printf("update 1 folder '%s'\n", folder->full_name));
@@ -752,7 +749,7 @@ struct _update_data {
struct _update_data *prev;
int id; /* id for cancellation */
- int cancel:1; /* also tells us we're cancelled */
+ guint cancel:1; /* also tells us we're cancelled */
void (*done)(CamelStore *store, CamelFolderInfo *info, void *data);
void *data;
Index: mail-mt.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-mt.c,v
retrieving revision 1.90
diff -u -p -r1.90 mail-mt.c
--- mail-mt.c 21 Aug 2005 19:34:58 -0000 1.90
+++ mail-mt.c 10 Dec 2005 19:12:27 -0000
@@ -670,7 +670,7 @@ idle_async_event(void *mm)
return FALSE;
}
-struct _mail_msg_op async_event_op = {
+static struct _mail_msg_op async_event_op = {
NULL,
do_async_event,
NULL,
@@ -812,7 +812,7 @@ do_call(struct _mail_msg *mm)
}
}
-struct _mail_msg_op mail_call_op = {
+static struct _mail_msg_op mail_call_op = {
NULL,
do_call,
NULL,
@@ -862,7 +862,7 @@ static void do_set_busy(struct _mail_msg
set_stop(busy_state > 0);
}
-struct _mail_msg_op set_busy_op = {
+static struct _mail_msg_op set_busy_op = {
NULL,
do_set_busy,
NULL,
@@ -995,7 +995,7 @@ do_op_status_free (struct _mail_msg *mm)
g_free (m->what);
}
-struct _mail_msg_op op_status_op = {
+static struct _mail_msg_op op_status_op = {
NULL,
do_op_status,
NULL,
Index: message-list.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-list.c,v
retrieving revision 1.419
diff -u -p -r1.419 message-list.c
--- message-list.c 28 Sep 2005 10:46:26 -0000 1.419
+++ message-list.c 10 Dec 2005 19:12:28 -0000
@@ -176,7 +176,7 @@ struct _EMailAddress {
typedef struct _EMailAddress EMailAddress;
#endif /* SMART_ADDRESS_COMPARE */
-G_DEFINE_TYPE (MessageList, message_list, E_TREE_SCROLLED_TYPE);
+G_DEFINE_TYPE (MessageList, message_list, E_TREE_SCROLLED_TYPE)
static void on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_data);
static void on_selection_changed_cmd(ETree *tree, MessageList *ml);
@@ -643,10 +643,6 @@ message_list_select_uid (MessageList *me
node = g_hash_table_lookup (message_list->uid_nodemap, uid);
if (node) {
- CamelMessageInfo *info;
-
- info = get_message_info (message_list, node);
-
/* This will emit a changed signal that we'll pick up */
e_tree_set_cursor (message_list->tree, node);
} else {
@@ -1044,7 +1040,7 @@ ml_value_to_string (ETreeModel *etm, int
case COL_DELETED:
case COL_UNREAD:
case COL_FOLLOWUP_FLAG_STATUS:
- return g_strdup_printf ("%d", GPOINTER_TO_UINT(value));
+ return g_strdup_printf ("%u", GPOINTER_TO_UINT(value));
case COL_SENT:
case COL_RECEIVED:
@@ -1170,7 +1166,6 @@ ml_tree_value_at (ETreeModel *etm, ETree
return GINT_TO_POINTER (1);
else
return GINT_TO_POINTER (0);
- break;
case COL_FLAGGED:
return GINT_TO_POINTER ((camel_message_info_flags(msg_info) & CAMEL_MESSAGE_FLAGGED) != 0);
case COL_SCORE: {
@@ -2180,8 +2175,6 @@ find_next_undeleted (MessageList *ml)
vrow ++;
while (vrow < last) {
- CamelMessageInfo *info;
-
node = e_tree_node_at_row (et, vrow);
info = get_message_info (ml, node);
if (info && (camel_message_info_flags(info) & check) == 0) {
@@ -2207,7 +2200,9 @@ build_tree (MessageList *ml, CamelFolder
{
int row = 0;
ETreeModel *etm = ml->model;
+#ifndef BROKEN_ETREE
ETreePath *top;
+#endif
char *saveuid = NULL;
#ifdef BROKEN_ETREE
GPtrArray *selected;
@@ -2234,8 +2229,8 @@ build_tree (MessageList *ml, CamelFolder
if (ml->cursor_uid)
saveuid = find_next_undeleted(ml);
- top = e_tree_model_node_get_first_child(etm, ml->tree_root);
#ifndef BROKEN_ETREE
+ top = e_tree_model_node_get_first_child(etm, ml->tree_root);
if (top == NULL || changes == NULL) {
#else
selected = message_list_get_selected(ml);
@@ -2576,7 +2571,7 @@ build_flat (MessageList *ml, GPtrArray *
#endif
if (saveuid) {
- ETreePath *node = g_hash_table_lookup(ml->uid_nodemap, saveuid);
+ node = g_hash_table_lookup(ml->uid_nodemap, saveuid);
if (node == NULL) {
g_free (ml->cursor_uid);
ml->cursor_uid = NULL;
Index: importers/mail-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/importers/mail-importer.c,v
retrieving revision 1.10
diff -u -p -r1.10 mail-importer.c
--- importers/mail-importer.c 12 Jul 2005 04:04:12 -0000 1.10
+++ importers/mail-importer.c 10 Dec 2005 19:12:28 -0000
@@ -159,12 +159,11 @@ static guint32
decode_status(const char *status)
{
const char *p;
- char c;
guint32 flags = 0;
int i;
p = status;
- while ((c = *p++)) {
+ while ((*p++)) {
for (i=0;i<sizeof(status_flags)/sizeof(status_flags[0]);i++)
if (status_flags[i].tag == *p)
flags |= status_flags[i].flag;
@@ -353,7 +352,7 @@ struct _import_folders_data {
MailImporterSpecial *special_folders;
CamelOperation *cancel;
- int elmfmt:1;
+ guint elmfmt:1;
};
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]