Commit e64d6fe0 authored by Matthew Barnes's avatar Matthew Barnes

Miscellaneous cleanups.

parent 2e60b6a4
......@@ -106,7 +106,8 @@ process_removal_in_hash (const gchar *uri,
}
static gint
find_slist_source_uri_cb (gconstpointer a, gconstpointer b)
find_slist_source_uri_cb (gconstpointer a,
gconstpointer b)
{
ESource *asource = (ESource *) a;
const gchar *buri = b;
......
......@@ -36,7 +36,6 @@
#include "alarm.h"
#include "config-data.h"
/* Our glib timeout */
static guint timeout_id;
......
......@@ -29,7 +29,6 @@
#include <time.h>
#include <glib.h>
typedef void (* AlarmFunction) (gpointer alarm_id, time_t trigger, gpointer data);
typedef void (* AlarmDestroyNotify) (gpointer alarm_id, gpointer data);
......
......@@ -62,7 +62,7 @@ calendar_config_init (void)
void
calendar_config_remove_notification (CalendarConfigChangedFunc func,
gpointer data)
gpointer data)
{
calendar_config_init ();
......
......@@ -30,7 +30,6 @@
#include "calendar-view-factory.h"
#include "calendar-view.h"
/* Private part of the CalendarViewFactory structure */
struct _CalendarViewFactoryPrivate {
/* Type of views created by this factory */
......
......@@ -28,7 +28,6 @@
#include "calendar-view.h"
/* Private part of the CalendarView structure */
struct _CalendarViewPrivate {
/* Type of the view */
......
......@@ -39,7 +39,6 @@
#include "shell/e-shell-window.h"
#include "shell/e-shell-view.h"
/**
* cal_comp_util_add_exdate:
* @comp: A calendar component object.
......
......@@ -45,7 +45,6 @@
#include "comp-editor-util.h"
#include "alarm-dialog.h"
typedef struct {
GtkBuilder *builder;
......
......@@ -42,7 +42,6 @@
#include "alarm-dialog.h"
#include "alarm-list-dialog.h"
typedef struct {
GtkBuilder *builder;
......
......@@ -31,7 +31,6 @@
#include "e-util/e-alert-dialog.h"
#include "cancel-comp.h"
/* is_past_event:
*
* returns TRUE if @comp is in the past, FALSE otherwise.
......
......@@ -29,7 +29,6 @@
#include <glib/gi18n.h>
#include "changed-comp.h"
/**
* changed_component_dialog:
* @parent: Parent window for the dialog.
......
......@@ -37,7 +37,6 @@
#include <shell/e-shell.h>
#include "comp-editor-util.h"
/**
* comp_editor_dates:
* @dates: A structure to be filled out with dates of a component
......
......@@ -30,7 +30,6 @@
#include "e-util/e-alert-dialog.h"
#include "delete-comp.h"
/**
* delete_component_dialog:
* @comp: A calendar component if a single component is to be deleted, or NULL
......
......@@ -30,7 +30,6 @@
#include <glib/gi18n.h>
#include "delete-error.h"
/**
* delete_error_dialog:
*
......
......@@ -29,7 +29,6 @@
#include <glib/gi18n.h>
#include "recur-comp.h"
gboolean
recur_component_dialog (ECalClient *client,
ECalComponent *comp,
......
......@@ -30,7 +30,6 @@
#include "e-util/e-alert-dialog.h"
#include "send-comp.h"
static gboolean
component_has_new_attendees (ECalComponent *comp)
{
......
......@@ -729,7 +729,7 @@ e_day_view_time_item_event (GnomeCanvasItem *item,
static void
edvti_second_zone_changed_cb (GSettings *settings,
const gchar *key,
const gchar *key,
gpointer user_data)
{
EDayViewTimeItem *time_item = user_data;
......
......@@ -577,11 +577,11 @@ comp_to_list (ECalComponentItipMethod method,
ECalComponentAttendee *att = l->data;
/* Bugfix: 688711 - Varadhan
Resource is also considered as a "attendee". If the respective backend
is able to successfully book resources automagically, it will appear
in the users list and thereby won't get added to the list of destinations
to send the meeting invite, otherwise, as a safety measure, a meeting
invite will be sent to the resources as well. */
* Resource is also considered as a "attendee". If the respective backend
* is able to successfully book resources automagically, it will appear
* in the users list and thereby won't get added to the list of destinations
* to send the meeting invite, otherwise, as a safety measure, a meeting
* invite will be sent to the resources as well. */
if (att->cutype != ICAL_CUTYPE_INDIVIDUAL &&
att->cutype != ICAL_CUTYPE_GROUP &&
att->cutype != ICAL_CUTYPE_RESOURCE)
......
......@@ -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))
......
......@@ -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
......
......@@ -664,7 +664,9 @@ e_datetime_format_format_tm (const gchar *component,
}
gboolean
e_datetime_format_includes_day_name (const gchar *component, const gchar *part, DTFormatKind kind)
e_datetime_format_includes_day_name (const gchar *component,
const gchar *part,
DTFormatKind kind)
{
gchar *key;
const gchar *fmt;
......
......@@ -1394,7 +1394,7 @@ e_binding_transform_color_to_string (GBinding *binding,
g_value_set_string (target_value, "");
} else {
/* encode color manually, because css styles expect colors in #rrggbb,
not in #rrrrggggbbbb, which is a result of gdk_color_to_string()
* not in #rrrrggggbbbb, which is a result of gdk_color_to_string()
*/
string = g_strdup_printf ("#%02x%02x%02x",
(gint) color->red * 256 / 65536,
......
......@@ -67,7 +67,6 @@ static void gnome_canvas_pixbuf_bounds (GnomeCanvasItem *item,
G_DEFINE_TYPE (GnomeCanvasPixbuf, gnome_canvas_pixbuf, GNOME_TYPE_CANVAS_ITEM)
/* Class initialization function for the pixbuf canvas item */
static void
gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class)
......
......@@ -46,7 +46,6 @@
#include "gnome-canvas-util.h"
#include "gnome-canvas-i18n.h"
/* Object argument IDs */
enum {
PROP_0,
......
......@@ -167,32 +167,43 @@ mail_label_list_store_get_stock_id (EMailLabelListStore *store,
}
static void
mail_label_list_store_finalize (GObject *object)
mail_label_list_store_dispose (GObject *object)
{
EMailLabelListStorePrivate *priv;
priv = E_MAIL_LABEL_LIST_STORE_GET_PRIVATE (object);
g_hash_table_destroy (priv->tag_index);
if (priv->mail_settings != NULL) {
g_object_unref (priv->mail_settings);
priv->mail_settings = NULL;
}
/* Chain up to parent's dispose() method. */
G_OBJECT_CLASS (e_mail_label_list_store_parent_class)->
dispose (object);
}
static void
mail_label_list_store_finalize (GObject *object)
{
EMailLabelListStorePrivate *priv;
priv = E_MAIL_LABEL_LIST_STORE_GET_PRIVATE (object);
g_hash_table_destroy (priv->tag_index);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_mail_label_list_store_parent_class)->
finalize (object);
}
static void labels_settings_changed_cb (GSettings *settings, const gchar *key, gpointer user_data);
static void
labels_model_changed_cb (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer user_data)
GtkTreePath *path,
GtkTreeIter *iter,
gpointer user_data)
{
EMailLabelListStore *store;
GPtrArray *array;
......@@ -228,8 +239,8 @@ labels_model_changed_cb (GtkTreeModel *model,
static void
labels_settings_changed_cb (GSettings *settings,
const gchar *key,
gpointer user_data)
const gchar *key,
gpointer user_data)
{
EMailLabelListStore *store;
gchar **strv;
......@@ -326,6 +337,7 @@ e_mail_label_list_store_class_init (EMailLabelListStoreClass *class)
g_type_class_add_private (class, sizeof (EMailLabelListStorePrivate));
object_class = G_OBJECT_CLASS (class);
object_class->dispose = mail_label_list_store_dispose;
object_class->finalize = mail_label_list_store_finalize;
object_class->constructed = mail_label_list_store_constructed;
......
......@@ -483,7 +483,7 @@ mail_session_make_key (CamelService *service,
static void
mail_session_check_junk_notify (GSettings *settings,
const gchar *key,
const gchar *key,
CamelSession *session)
{
if (strcmp (key, "junk-check-incoming") == 0)
......@@ -1089,9 +1089,9 @@ mail_session_forward_to (CamelSession *session,
static void
mail_session_get_socks_proxy (CamelSession *session,
const gchar *for_host,
gchar **host_ret,
gint *port_ret)
const gchar *for_host,
gchar **host_ret,
gint *port_ret)
{
EMailSession *mail_session;
gchar *uri;
......
......@@ -3786,8 +3786,12 @@ emae_defaults_page (EConfig *ec,
priv->trash_folder_button, "sensitive",
G_BINDING_SYNC_CREATE);
pspec = !settings ? NULL : g_object_class_find_property (
G_OBJECT_GET_CLASS (settings), "use-real-trash-path");
if (settings != NULL)
pspec = g_object_class_find_property (
G_OBJECT_GET_CLASS (settings),
"use-real-trash-path");
else
pspec = NULL;
if (pspec != NULL)
g_object_bind_property (
......@@ -3796,12 +3800,20 @@ emae_defaults_page (EConfig *ec,
G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
pspec = !settings ? NULL : g_object_class_find_property (
G_OBJECT_GET_CLASS (settings), "real-trash-path");
if (settings != NULL)
pspec = g_object_class_find_property (
G_OBJECT_GET_CLASS (settings),
"real-trash-path");
else
pspec = NULL;
if (pspec != NULL) {
set_real_folder_path (priv->trash_folder_button, settings, "real-trash-path", account);
g_signal_connect (priv->trash_folder_button, "notify::folder-uri", G_CALLBACK (update_real_folder_cb), emae);
set_real_folder_path (
priv->trash_folder_button,
settings, "real-trash-path", account);
g_signal_connect (
priv->trash_folder_button, "notify::folder-uri",
G_CALLBACK (update_real_folder_cb), emae);
}
flags = CAMEL_PROVIDER_ALLOW_REAL_TRASH_FOLDER;
......@@ -3832,8 +3844,12 @@ emae_defaults_page (EConfig *ec,
priv->junk_folder_button, "sensitive",
G_BINDING_SYNC_CREATE);
pspec = !settings ? NULL : g_object_class_find_property (
G_OBJECT_GET_CLASS (settings), "use-real-junk-path");
if (settings != NULL)
pspec = g_object_class_find_property (
G_OBJECT_GET_CLASS (settings),
"use-real-junk-path");
else
pspec = NULL;
if (pspec != NULL)
g_object_bind_property (
......@@ -3842,12 +3858,20 @@ emae_defaults_page (EConfig *ec,
G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
pspec = !settings ? NULL : g_object_class_find_property (
G_OBJECT_GET_CLASS (settings), "real-junk-path");
if (settings != NULL)
pspec = g_object_class_find_property (
G_OBJECT_GET_CLASS (settings),
"real-junk-path");
else
pspec = NULL;
if (pspec != NULL) {
set_real_folder_path (priv->junk_folder_button, settings, "real-junk-path", account);
g_signal_connect (priv->junk_folder_button, "notify::folder-uri", G_CALLBACK (update_real_folder_cb), emae);
set_real_folder_path (
priv->junk_folder_button,
settings, "real-junk-path", account);
g_signal_connect (
priv->junk_folder_button, "notify::folder-uri",
G_CALLBACK (update_real_folder_cb), emae);
}
flags = CAMEL_PROVIDER_ALLOW_REAL_JUNK_FOLDER;
......@@ -3861,7 +3885,9 @@ emae_defaults_page (EConfig *ec,
/* Special Folders "Reset Defaults" button */
priv->restore_folders_button = (GtkButton *)e_builder_get_widget (builder, "default_folders_button");
g_signal_connect (priv->restore_folders_button, "clicked", G_CALLBACK (default_folders_clicked), emae);
g_signal_connect (
priv->restore_folders_button, "clicked",
G_CALLBACK (default_folders_clicked), emae);
/* Always Cc/Bcc */
emae_account_toggle (emae, "always_cc", E_ACCOUNT_CC_ALWAYS, builder);
......@@ -3869,12 +3895,13 @@ emae_defaults_page (EConfig *ec,
emae_account_toggle (emae, "always_bcc", E_ACCOUNT_BCC_ALWAYS, builder);
emae_account_entry (emae, "bcc_addrs", E_ACCOUNT_BCC_ADDRS, builder);
gtk_widget_set_sensitive ( (GtkWidget *) priv->sent_folder_button,
(provider ? !(provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER): TRUE)
);
gtk_widget_set_sensitive (
GTK_WIDGET (priv->sent_folder_button),
(provider ? !(provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER) : TRUE));
gtk_widget_set_sensitive ((GtkWidget *) priv->restore_folders_button,
(provider && !(provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER)));
gtk_widget_set_sensitive (
GTK_WIDGET (priv->restore_folders_button),
(provider && !(provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER)));
/* Receipt policy */
emae_setup_receipt_policy (emae, builder);
......
......@@ -121,7 +121,6 @@ em_config_class_init (EMConfigClass *class)
{
EConfigClass *config_class;
config_class = E_CONFIG_CLASS (class);
config_class->set_target = em_config_set_target;
config_class->target_free = em_config_target_free;
......
......@@ -374,10 +374,9 @@ subscription_editor_subscribe_folder_done (CamelSubscribable *subscribable,
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
}
static void
subscription_editor_subscribe_many (EMSubscriptionEditor *editor,
GSList *async_datas)
GSList *async_datas)
{
AsyncData *async_data;
AsyncContext *context;
......@@ -499,10 +498,9 @@ subscription_editor_unsubscribe_folder_done (CamelSubscribable *subscribable,
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
}
static void
subscription_editor_unsubscribe_many (EMSubscriptionEditor *editor,
GSList *async_datas)
GSList *async_datas)
{
AsyncData *async_data;
AsyncContext *context;
......@@ -552,9 +550,9 @@ subscription_editor_unsubscribe_many (EMSubscriptionEditor *editor,
static GtkWidget *
subscription_editor_create_menu_item (const gchar *label,
gboolean sensitive,
GCallback activate_cb,
EMSubscriptionEditor *editor)
gboolean sensitive,
GCallback activate_cb,
EMSubscriptionEditor *editor)
{
GtkWidget *item;
......@@ -570,10 +568,10 @@ subscription_editor_create_menu_item (const gchar *label,
static void
position_below_widget_cb (GtkMenu *menu,
gint *x,
gint *y,
gboolean *push_in,
gpointer under_widget)
gint *x,
gint *y,
gboolean *push_in,
gpointer under_widget)
{
GtkRequisition menu_requisition;
GtkTextDirection direction;
......@@ -611,9 +609,9 @@ position_below_widget_cb (GtkMenu *menu,
static AsyncData *
subscription_editor_async_data_from_iter (GtkTreeView *tree_view,
GtkTreeModel *model,
GtkTreeIter *iter,
gboolean *is_expanded)
GtkTreeModel *model,
GtkTreeIter *iter,
gboolean *is_expanded)
{
AsyncData *data;
CamelFolderInfo *folder_info = NULL;
......@@ -650,7 +648,8 @@ typedef enum {
} EPickMode;
static gboolean
can_pick_folder_info (CamelFolderInfo *fi, EPickMode mode)
can_pick_folder_info (CamelFolderInfo *fi,
EPickMode mode)
{
if (!FOLDER_CAN_SELECT (fi))
return FALSE;
......@@ -670,9 +669,9 @@ struct PickAllData {
static gboolean
pick_all_cb (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer user_data)
GtkTreePath *path,
GtkTreeIter *iter,
gpointer user_data)
{
struct PickAllData *data = user_data;
AsyncData *async_data;
......@@ -696,13 +695,13 @@ pick_all_cb (GtkTreeModel *model,
}
/* skip_folder_infos contains CamelFolderInfo-s to skip;
these should come from the tree view; can be NULL
to include everything.
* these should come from the tree view; can be NULL
* to include everything.
*/
static GSList *
subscription_editor_pick_all (EMSubscriptionEditor *editor,
EPickMode mode,
GHashTable *skip_folder_infos)
EPickMode mode,
GHashTable *skip_folder_infos)
{
GtkTreeView *tree_view;
GtkTreeModel *tree_model;
......@@ -723,7 +722,7 @@ subscription_editor_pick_all (EMSubscriptionEditor *editor,
static GSList *
subscription_editor_pick_shown (EMSubscriptionEditor *editor,
EPickMode mode)
EPickMode mode)
{
GtkTreeView *tree_view;
GtkTreeModel *tree_model;
......
......@@ -58,8 +58,8 @@ static GSettings *mail_settings = NULL;
static void
settings_outlook_filenames_changed (GSettings *settings,
const gchar *key,
gpointer user_data)
const gchar *key,
gpointer user_data)
{
/* pass option to the camel */
if (g_settings_get_boolean (settings, key))
......@@ -70,8 +70,8 @@ settings_outlook_filenames_changed (GSettings *settings,
static void
settings_jh_headers_changed (GSettings *settings,
const gchar *key,
EMailSession *session)
const gchar *key,
EMailSession *session)
{
GSList *node;
GPtrArray *name, *value;
......@@ -110,8 +110,8 @@ settings_jh_headers_changed (GSettings *settings,
static void
settings_jh_check_changed (GSettings *settings,
const gchar *key,
EMailSession *session)
const gchar *key,
EMailSession *session)
{
config->jh_check = g_settings_get_boolean (settings, "junk-check-custom-header");
if (!config->jh_check) {
......@@ -124,16 +124,16 @@ settings_jh_check_changed (GSettings *settings,
static void
settings_bool_value_changed (GSettings *settings,
const gchar *key,
gboolean *save_location)
const gchar *key,
gboolean *save_location)
{
*save_location = g_settings_get_boolean (settings, key);
}
static void
settings_int_value_changed (GSettings *settings,
const gchar *key,
gint *save_location)
const gchar *key,
gint *save_location)
{
*save_location = g_settings_get_int (settings, key);
}
......
......@@ -185,8 +185,8 @@ contacts_removed (EBookShellView *book_shell_view,
static void
model_query_changed_cb (EBookShellView *book_shell_view,
GParamSpec *param,
EAddressbookModel *model)
GParamSpec *param,
EAddressbookModel *model)
{
EBookShellContent *book_shell_content;
EAddressbookView *current_view;
......
......@@ -903,7 +903,7 @@ e_cal_shell_backend_get_selected_calendars (ECalShellBackend *cal_shell_backend)
{
GSettings *settings;
GSList *selected_calendars = NULL;
char **strv;
gchar **strv;
gint ii;
g_return_val_if_fail (
......
......@@ -647,7 +647,7 @@ e_memo_shell_backend_get_selected_memo_lists (EMemoShellBackend *memo_shell_back
{
GSettings *settings;
GSList *selected_memo_lists = NULL;
char **strv;
gchar **strv;
gint ii;
g_return_val_if_fail (
......@@ -657,7 +657,6 @@ e_memo_shell_backend_get_selected_memo_lists (EMemoShellBackend *memo_shell_back
strv = g_settings_get_strv (settings, "selected-memos");
g_object_unref (settings);
if (strv != NULL) {
for (ii = 0; strv[ii] != NULL; ii++)
selected_memo_lists = g_slist_append (selected_memo_lists, g_strdup (strv[ii]));
......
......@@ -652,7 +652,7 @@ e_task_shell_backend_get_selected_task_lists (ETaskShellBackend *task_shell_back
{
GSettings *settings;
GSList *selected_task_lists = NULL;
char **strv;
gchar **strv;
gint ii;
g_return_val_if_fail (
......@@ -690,5 +690,5 @@ e_task_shell_backend_set_selected_task_lists (ETaskShellBackend *task_shell_back
g_settings_set_strv (settings, "selected-tasks", (const gchar *const *) array->pdata);