diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-11-23 07:22:14 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-11-23 09:43:04 +0800 |
commit | e64d6fe05c30c2cc1d7625a202afba3ba2da07cd (patch) | |
tree | f99df204ecdd5629acdc9f7e7b00d1c0d7903d6d /composer | |
parent | 2e60b6a4a21105bb4a1e2badd1be51b3e684d165 (diff) | |
download | gsoc2013-evolution-e64d6fe05c30c2cc1d7625a202afba3ba2da07cd.tar.gz gsoc2013-evolution-e64d6fe05c30c2cc1d7625a202afba3ba2da07cd.tar.zst gsoc2013-evolution-e64d6fe05c30c2cc1d7625a202afba3ba2da07cd.zip |
Miscellaneous cleanups.
Diffstat (limited to 'composer')
-rw-r--r-- | composer/e-composer-private.h | 24 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 30 |
2 files changed, 13 insertions, 41 deletions
diff --git a/composer/e-composer-private.h b/composer/e-composer-private.h index 040f8d8d10..695510949a 100644 --- a/composer/e-composer-private.h +++ b/composer/e-composer-private.h @@ -58,30 +58,6 @@ #include <X11/XF86keysym.h> #endif -/* Mail configuration keys */ -#define MAIL_GCONF_PREFIX \ - "/apps/evolution/mail" -#define MAIL_GCONF_CHARSET_KEY \ - MAIL_GCONF_PREFIX "/format/charset" - -/* Composer configuration keys */ -#define COMPOSER_GCONF_PREFIX \ - MAIL_GCONF_PREFIX "/composer" -#define COMPOSER_GCONF_INLINE_SPELLING_KEY \ - COMPOSER_GCONF_PREFIX "/inline_spelling" -#define COMPOSER_GCONF_MAGIC_LINKS_KEY \ - COMPOSER_GCONF_PREFIX "/magic_links" -#define COMPOSER_GCONF_MAGIC_SMILEYS_KEY \ - COMPOSER_GCONF_PREFIX "/magic_smileys" -#define COMPOSER_GCONF_REQUEST_RECEIPT_KEY \ - COMPOSER_GCONF_PREFIX "/request_receipt" -#define COMPOSER_GCONF_TOP_SIGNATURE_KEY \ - COMPOSER_GCONF_PREFIX "/top_signature" -#define COMPOSER_GCONF_SEND_HTML_KEY \ - COMPOSER_GCONF_PREFIX "/send_html" -#define COMPOSER_GCONF_WINDOW_PREFIX \ - COMPOSER_GCONF_PREFIX "/window" - /* Shorthand, requires a variable named "composer". */ #define ACTION(name) (E_COMPOSER_ACTION_##name (composer)) diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index f3b4ddfa21..b7aaf883a5 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -128,8 +128,6 @@ static void handle_multipart_signed (EMsgComposer *composer, static void e_msg_composer_alert_sink_init (EAlertSinkInterface *interface); -gboolean check_blacklisted_file (gchar *filename); - G_DEFINE_TYPE_WITH_CODE ( EMsgComposer, e_msg_composer, @@ -4006,25 +4004,24 @@ merge_always_cc_and_bcc (EComposerHeaderTable *table, e_destination_freev (addrv); } -static const gchar *blacklisted_files [] = {".", "etc", ".."}; +static const gchar *blacklisted_files [] = { ".", "etc", ".." }; -gboolean check_blacklisted_file (gchar *filename) +static gboolean +check_blacklisted_file (gchar *filename) { gboolean blacklisted = FALSE; - gint i,j,len; + guint ii, jj, length; gchar **filename_part; filename_part = g_strsplit (filename, G_DIR_SEPARATOR_S, -1); - len = g_strv_length(filename_part); - for(i = 0; !blacklisted && i < G_N_ELEMENTS(blacklisted_files); i++) - { - for (j = 0; !blacklisted && j < len;j++) - if (g_str_has_prefix (filename_part[j], blacklisted_files[i])) + length = g_strv_length (filename_part); + for (ii = 0; !blacklisted && ii < G_N_ELEMENTS (blacklisted_files); ii++) { + for (jj = 0; !blacklisted && jj < length; jj++) + if (g_str_has_prefix (filename_part[jj], blacklisted_files[ii])) blacklisted = TRUE; } + g_strfreev (filename_part); - g_strfreev(filename_part); - return blacklisted; } @@ -4119,14 +4116,13 @@ handle_mailto (EMsgComposer *composer, } else if (!g_ascii_strcasecmp (header, "attach") || !g_ascii_strcasecmp (header, "attachment")) { EAttachment *attachment; - gboolean check = FALSE; camel_url_decode (content); - check = check_blacklisted_file(content); - if(check) + if (check_blacklisted_file (content)) e_alert_submit ( - E_ALERT_SINK (composer), - "mail:blacklisted-file", content, NULL); + E_ALERT_SINK (composer), + "mail:blacklisted-file", + content, NULL); if (g_ascii_strncasecmp (content, "file:", 5) == 0) attachment = e_attachment_new_for_uri (content); else |