diff options
Diffstat (limited to 'addressbook/gui/widgets')
20 files changed, 389 insertions, 292 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index dc1068dea3..74e794bd6e 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -324,10 +324,13 @@ view_complete_cb (EBookClientView *client_view, static void readonly_cb (EBookClient *book_client, - GParamSpec *pspec, + GParamSpec *pspec, EAddressbookModel *model) { - e_addressbook_model_set_editable (model, !e_client_is_readonly (E_CLIENT (book_client))); + gboolean editable; + + editable = !e_client_is_readonly (E_CLIENT (book_client)); + e_addressbook_model_set_editable (model, editable); } static void @@ -734,7 +737,7 @@ e_addressbook_model_get_type (void) return type; } -EAddressbookModel* +EAddressbookModel * e_addressbook_model_new (void) { return g_object_new (E_TYPE_ADDRESSBOOK_MODEL, NULL); @@ -742,7 +745,7 @@ e_addressbook_model_new (void) EContact * e_addressbook_model_get_contact (EAddressbookModel *model, - gint row) + gint row) { GPtrArray *array; @@ -845,6 +848,8 @@ void e_addressbook_model_set_client (EAddressbookModel *model, EBookClient *book_client) { + gboolean editable; + g_return_if_fail (E_IS_ADDRESSBOOK_MODEL (model)); g_return_if_fail (E_IS_BOOK_CLIENT (book_client)); @@ -878,7 +883,8 @@ e_addressbook_model_set_client (EAddressbookModel *model, book_client, "backend-died", G_CALLBACK (backend_died_cb), model); - e_addressbook_model_set_editable (model, !e_client_is_readonly (E_CLIENT (book_client))); + editable = !e_client_is_readonly (E_CLIENT (book_client)); + e_addressbook_model_set_editable (model, editable); if (model->priv->client_view_idle_id == 0) model->priv->client_view_idle_id = g_idle_add ( diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index 680a511d05..0d2fc85478 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -99,7 +99,8 @@ unlink_model (EAddressbookReflowAdapter *adapter) } static gint -text_height (PangoLayout *layout, const gchar *text) +text_height (PangoLayout *layout, + const gchar *text) { gint height; @@ -119,7 +120,8 @@ addressbook_dispose (GObject *object) } static void -addressbook_set_width (EReflowModel *erm, gint width) +addressbook_set_width (EReflowModel *erm, + gint width) { } @@ -135,14 +137,16 @@ addressbook_count (EReflowModel *erm) /* This function returns the height of the minicontact in question */ static gint -addressbook_height (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) +addressbook_height (EReflowModel *erm, + gint i, + GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; EContactField field; gint count = 0; gchar *string; - EContact *contact = (EContact*) e_addressbook_model_contact_at (priv->model, i); + EContact *contact = (EContact *) e_addressbook_model_contact_at (priv->model, i); PangoLayout *layout; gint height; @@ -220,18 +224,21 @@ addressbook_create_cmp_cache (EReflowModel *erm) } static gint -addressbook_compare (EReflowModel *erm, gint n1, gint n2, GHashTable *cmp_cache) +addressbook_compare (EReflowModel *erm, + gint n1, + gint n2, + GHashTable *cmp_cache) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; EContact *contact1, *contact2; if (priv->loading) { - return n1-n2; + return n1 - n2; } else { - contact1 = (EContact*) e_addressbook_model_contact_at (priv->model, n1); - contact2 = (EContact*) e_addressbook_model_contact_at (priv->model, n2); + contact1 = (EContact *) e_addressbook_model_contact_at (priv->model, n1); + contact2 = (EContact *) e_addressbook_model_contact_at (priv->model, n2); if (contact1 && contact2) { const gchar *file_as1, *file_as2; @@ -292,7 +299,9 @@ adapter_open_contact (EMinicard *card, } static GnomeCanvasItem * -addressbook_incarnate (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) +addressbook_incarnate (EReflowModel *erm, + gint i, + GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -319,7 +328,9 @@ addressbook_incarnate (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) } static void -addressbook_reincarnate (EReflowModel *erm, gint i, GnomeCanvasItem *item) +addressbook_reincarnate (EReflowModel *erm, + gint i, + GnomeCanvasItem *item) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -331,8 +342,9 @@ addressbook_reincarnate (EReflowModel *erm, gint i, GnomeCanvasItem *item) static void create_contact (EAddressbookModel *model, - gint index, gint count, - EAddressbookReflowAdapter *adapter) + gint index, + gint count, + EAddressbookReflowAdapter *adapter) { e_reflow_model_items_inserted (E_REFLOW_MODEL (adapter), index, @@ -341,8 +353,8 @@ create_contact (EAddressbookModel *model, static void remove_contacts (EAddressbookModel *model, - gpointer data, - EAddressbookReflowAdapter *adapter) + gpointer data, + EAddressbookReflowAdapter *adapter) { GArray *indices = (GArray *) data; gint count = indices->len; @@ -358,22 +370,22 @@ remove_contacts (EAddressbookModel *model, static void modify_contact (EAddressbookModel *model, - gint index, - EAddressbookReflowAdapter *adapter) + gint index, + EAddressbookReflowAdapter *adapter) { e_reflow_model_item_changed (E_REFLOW_MODEL (adapter), index); } static void model_changed (EAddressbookModel *model, - EAddressbookReflowAdapter *adapter) + EAddressbookReflowAdapter *adapter) { e_reflow_model_changed (E_REFLOW_MODEL (adapter)); } static void search_started (EAddressbookModel *model, - EAddressbookReflowAdapter *adapter) + EAddressbookReflowAdapter *adapter) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -382,8 +394,8 @@ search_started (EAddressbookModel *model, static void search_result (EAddressbookModel *model, - const GError *error, - EAddressbookReflowAdapter *adapter) + const GError *error, + EAddressbookReflowAdapter *adapter) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -394,14 +406,14 @@ search_result (EAddressbookModel *model, static void addressbook_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (object); EAddressbookReflowAdapterPrivate *priv = adapter->priv; - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: g_object_set (priv->model, "client", g_value_get_object (value), @@ -418,21 +430,21 @@ addressbook_set_property (GObject *object, NULL); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void addressbook_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (object); EAddressbookReflowAdapterPrivate *priv = adapter->priv; - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: { g_object_get_property (G_OBJECT (priv->model), "client", value); @@ -452,7 +464,7 @@ addressbook_get_property (GObject *object, g_value_set_object (value, priv->model); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -568,7 +580,7 @@ e_addressbook_reflow_adapter_get_type (void) void e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter, - EAddressbookModel *model) + EAddressbookModel *model) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -616,7 +628,7 @@ e_addressbook_reflow_adapter_new (EAddressbookModel *model) EContact * e_addressbook_reflow_adapter_get_contact (EAddressbookReflowAdapter *adapter, - gint index) + gint index) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index e47b5bb186..f102b684d7 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -107,7 +107,9 @@ addressbook_row_count (ETableModel *etc) /* This function returns the value at a particular point in our ETableModel. */ static gpointer -addressbook_value_at (ETableModel *etc, gint col, gint row) +addressbook_value_at (ETableModel *etc, + gint col, + gint row) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -157,7 +159,10 @@ contact_modified_cb (EBookClient *book_client, } static void -addressbook_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) +addressbook_set_value_at (ETableModel *etc, + gint col, + gint row, + gconstpointer val) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -199,33 +204,17 @@ addressbook_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer va /* This function returns whether a particular cell is editable. */ static gboolean -addressbook_is_cell_editable (ETableModel *etc, gint col, gint row) +addressbook_is_cell_editable (ETableModel *etc, + gint col, + gint row) { -#if 0 - EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc); - EAddressbookTableAdapterPrivate *priv = adapter->priv; - const EContact *contact; - - if (row >= 0 && row < e_addressbook_model_contact_count (priv->model)) - contact = e_addressbook_model_contact_at (priv->model, row); - else - contact = NULL; - - if (!e_addressbook_model_editable (priv->model)) - return FALSE; - else if (contact && e_contact_get ((EContact *) contact, E_CONTACT_IS_LIST)) - /* we only allow editing of the name and file as for - * lists */ - return col == E_CONTACT_FULL_NAME || col == E_CONTACT_FILE_AS; - else - return col < E_CONTACT_LAST_SIMPLE_STRING; -#endif - return FALSE; } static void -addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) +addressbook_append_row (ETableModel *etm, + ETableModel *source, + gint row) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etm); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -248,32 +237,41 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) /* This function duplicates the value passed to it. */ static gpointer -addressbook_duplicate_value (ETableModel *etc, gint col, gconstpointer value) +addressbook_duplicate_value (ETableModel *etc, + gint col, + gconstpointer value) { return g_strdup (value); } /* This function frees the value passed to it. */ static void -addressbook_free_value (ETableModel *etc, gint col, gpointer value) +addressbook_free_value (ETableModel *etc, + gint col, + gpointer value) { g_free (value); } static gpointer -addressbook_initialize_value (ETableModel *etc, gint col) +addressbook_initialize_value (ETableModel *etc, + gint col) { return g_strdup(""); } static gboolean -addressbook_value_is_empty (ETableModel *etc, gint col, gconstpointer value) +addressbook_value_is_empty (ETableModel *etc, + gint col, + gconstpointer value) { return !(value && *(gchar *) value); } static gchar * -addressbook_value_to_string (ETableModel *etc, gint col, gconstpointer value) +addressbook_value_to_string (ETableModel *etc, + gint col, + gconstpointer value) { return g_strdup (value); } @@ -316,8 +314,9 @@ eab_table_adapter_init (GObject *object) static void create_contact (EAddressbookModel *model, - gint index, gint count, - EAddressbookTableAdapter *adapter) + gint index, + gint count, + EAddressbookTableAdapter *adapter) { e_table_model_pre_change (E_TABLE_MODEL (adapter)); e_table_model_rows_inserted (E_TABLE_MODEL (adapter), index, count); @@ -325,8 +324,8 @@ create_contact (EAddressbookModel *model, static void remove_contacts (EAddressbookModel *model, - gpointer data, - EAddressbookTableAdapter *adapter) + gpointer data, + EAddressbookTableAdapter *adapter) { GArray *indices = (GArray *) data; gint count = indices->len; @@ -345,8 +344,8 @@ remove_contacts (EAddressbookModel *model, static void modify_contact (EAddressbookModel *model, - gint index, - EAddressbookTableAdapter *adapter) + gint index, + EAddressbookTableAdapter *adapter) { /* clear whole cache */ g_hash_table_remove_all (adapter->priv->emails); diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 55310949b0..7f3a7a85b8 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -298,8 +298,8 @@ addressbook_view_create_table_view (EAddressbookView *view, e_cell_date_set_format_component (E_CELL_DATE (cell), "addressbook"); /* Here we create the table. We give it the three pieces of - the table we've created, the header, the model, and the - initial layout. It does the rest. */ + * the table we've created, the header, the model, and the + * initial layout. It does the rest. */ etspecfile = g_build_filename ( EVOLUTION_ETSPECDIR, "e-addressbook-view.etspec", NULL); widget = e_table_new_from_spec_file ( @@ -973,7 +973,8 @@ e_addressbook_view_get_view_object (EAddressbookView *view) /* Helper for e_addressbook_view_get_selected() */ static void -add_to_list (gint model_row, gpointer closure) +add_to_list (gint model_row, + gpointer closure) { GSList **list = closure; *list = g_slist_prepend (*list, GINT_TO_POINTER (model_row)); @@ -1058,7 +1059,9 @@ e_addressbook_view_get_paste_target_list (EAddressbookView *view) } static void -status_message (EAddressbookView *view, const gchar *status, gint percent) +status_message (EAddressbookView *view, + const gchar *status, + gint percent) { EActivity *activity; EShellView *shell_view; @@ -1122,7 +1125,8 @@ folder_bar_message (EAddressbookView *view, } static void -stop_state_changed (GObject *object, EAddressbookView *view) +stop_state_changed (GObject *object, + EAddressbookView *view) { command_state_change (view); } @@ -1180,7 +1184,8 @@ contact_print_button_draw_page (GtkPrintOperation *operation, } static void -e_contact_print_button (EPrintable *printable, GtkPrintOperationAction action) +e_contact_print_button (EPrintable *printable, + GtkPrintOperationAction action) { GtkPrintOperation *operation; @@ -1362,7 +1367,8 @@ addressbook_view_confirm_delete (GtkWindow *parent, } void -e_addressbook_view_delete_selection (EAddressbookView *view, gboolean is_delete) +e_addressbook_view_delete_selection (EAddressbookView *view, + gboolean is_delete) { GSList *list, *l; gboolean plural = FALSE, is_list = FALSE; @@ -1621,13 +1627,15 @@ view_transfer_contacts (EAddressbookView *view, } void -e_addressbook_view_copy_to_folder (EAddressbookView *view, gboolean all) +e_addressbook_view_copy_to_folder (EAddressbookView *view, + gboolean all) { view_transfer_contacts (view, FALSE, all); } void -e_addressbook_view_move_to_folder (EAddressbookView *view, gboolean all) +e_addressbook_view_move_to_folder (EAddressbookView *view, + gboolean all) { view_transfer_contacts (view, TRUE, all); } diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index 967853d7b6..c22ffe58a5 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -37,8 +37,8 @@ static void e_minicard_label_init (EMinicardLabel *card); static void e_minicard_label_class_init (EMinicardLabelClass *klass); -static void e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_minicard_label_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_minicard_label_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static gboolean e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event); static void e_minicard_label_realize (GnomeCanvasItem *item); static void e_minicard_label_unrealize (GnomeCanvasItem *item); @@ -199,7 +199,10 @@ e_minicard_label_init (EMinicardLabel *minicard_label) } static void -e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_minicard_label_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { EMinicardLabel *e_minicard_label; GnomeCanvasItem *item; @@ -207,7 +210,7 @@ e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *va e_minicard_label = E_MINICARD_LABEL (object); item = GNOME_CANVAS_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: e_minicard_label->width = g_value_get_double (value); e_minicard_label_resize_children (e_minicard_label); @@ -234,19 +237,22 @@ e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *va g_object_set (e_minicard_label->field, "editable", FALSE /* e_minicard_label->editable */, NULL); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_minicard_label_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicardLabel *e_minicard_label; e_minicard_label = E_MINICARD_LABEL (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, e_minicard_label->width); break; @@ -275,7 +281,7 @@ e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, G g_value_set_boolean (value, e_minicard_label->editable); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -341,7 +347,8 @@ e_minicard_label_unrealize (GnomeCanvasItem *item) } static gboolean -e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event) +e_minicard_label_event (GnomeCanvasItem *item, + GdkEvent *event) { EMinicardLabel *e_minicard_label; @@ -455,13 +462,15 @@ set_colors (EMinicardLabel *label) } static void -e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style) +e_minicard_label_style_set (EMinicardLabel *label, + GtkStyle *previous_style) { set_colors (label); } static void -e_minicard_label_reflow (GnomeCanvasItem *item, gint flags) +e_minicard_label_reflow (GnomeCanvasItem *item, + gint flags) { EMinicardLabel *e_minicard_label = E_MINICARD_LABEL (item); diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 65fa12d9f1..0a0b19df94 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -37,12 +37,12 @@ static void e_minicard_view_widget_class_init (EMinicardViewWidgetClass *class); static void e_minicard_view_widget_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec); static void e_minicard_view_widget_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec); static void e_minicard_view_widget_dispose (GObject *object); @@ -231,15 +231,15 @@ e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter) static void e_minicard_view_widget_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { EMinicardViewWidget *emvw; emvw = E_MINICARD_VIEW_WIDGET (object); - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: if (emvw->book_client) g_object_unref (emvw->book_client); @@ -277,22 +277,22 @@ e_minicard_view_widget_set_property (GObject *object, } break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_minicard_view_widget_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicardViewWidget *emvw; emvw = E_MINICARD_VIEW_WIDGET (object); - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: g_value_set_object (value, emvw->book_client); break; @@ -306,7 +306,7 @@ e_minicard_view_widget_get_property (GObject *object, g_value_set_double (value, emvw->column_width); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -335,49 +335,57 @@ e_minicard_view_widget_dispose (GObject *object) } static void -selection_change (ESelectionModel *esm, EMinicardViewWidget *widget) +selection_change (ESelectionModel *esm, + EMinicardViewWidget *widget) { - g_signal_emit (widget, - signals[SELECTION_CHANGE], 0); + g_signal_emit (widget, signals[SELECTION_CHANGE], 0); } static void -selection_row_change (ESelectionModel *esm, gint row, EMinicardViewWidget *widget) +selection_row_change (ESelectionModel *esm, + gint row, + EMinicardViewWidget *widget) { selection_change (esm, widget); } static void -column_width_changed (ESelectionModel *esm, double width, EMinicardViewWidget *widget) +column_width_changed (ESelectionModel *esm, + gdouble width, + EMinicardViewWidget *widget) { - g_signal_emit (widget, - signals[COLUMN_WIDTH_CHANGED], 0, width); + g_signal_emit (widget, signals[COLUMN_WIDTH_CHANGED], 0, width); } static void -create_contact (EMinicardView *view, EMinicardViewWidget *widget) +create_contact (EMinicardView *view, + EMinicardViewWidget *widget) { g_signal_emit (widget, signals[CREATE_CONTACT], 0); } static void -create_contact_list (EMinicardView *view, EMinicardViewWidget *widget) +create_contact_list (EMinicardView *view, + EMinicardViewWidget *widget) { g_signal_emit (widget, signals[CREATE_CONTACT_LIST], 0); } static guint -right_click (EMinicardView *view, GdkEvent *event, EMinicardViewWidget *widget) +right_click (EMinicardView *view, + GdkEvent *event, + EMinicardViewWidget *widget) { guint ret_val; - g_signal_emit (widget, - signals[RIGHT_CLICK], 0, - event, &ret_val); + + g_signal_emit (widget, signals[RIGHT_CLICK], 0, event, &ret_val); + return ret_val; } static void -e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style) +e_minicard_view_widget_style_set (GtkWidget *widget, + GtkStyle *previous_style) { EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET (widget); GtkStyle *style; @@ -493,7 +501,7 @@ e_minicard_view_widget_get_selection_model (EMinicardViewWidget *view) } EMinicardView * -e_minicard_view_widget_get_view (EMinicardViewWidget *view) +e_minicard_view_widget_get_view (EMinicardViewWidget *view) { if (view->emv) return E_MINICARD_VIEW (view->emv); @@ -502,7 +510,8 @@ e_minicard_view_widget_get_view (EMinicardViewWidget *view) } static gboolean -e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *event) +e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, + GdkEventFocus *event) { GnomeCanvas *canvas; EMinicardViewWidget *view; @@ -524,6 +533,5 @@ e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *ev return GTK_WIDGET_CLASS (parent_class)->focus_in_event (widget, event); return FALSE; - } diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 91a4a12991..ba52e7a0a8 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -81,11 +81,11 @@ static GtkTargetEntry drag_types[] = { static void e_minicard_view_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - EMinicardView *view) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + EMinicardView *view) { GdkAtom target; @@ -149,7 +149,7 @@ e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter, target_list = gtk_target_list_new (drag_types, G_N_ELEMENTS (drag_types)); context = gtk_drag_begin (GTK_WIDGET (GNOME_CANVAS_ITEM (view)->canvas), - target_list, actions, 1/*XXX*/, event); + target_list, actions, 1/*XXX */, event); if (!view->canvas_drag_data_get_id) view->canvas_drag_data_get_id = g_signal_connect ( @@ -235,15 +235,15 @@ adapter_changed (EMinicardView *view) static void e_minicard_view_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { EMinicardView *view; view = E_MINICARD_VIEW (object); - switch (prop_id) { + switch (property_id) { case PROP_ADAPTER: if (view->adapter) { if (view->writable_status_id || view->stop_state_id) { @@ -303,22 +303,22 @@ e_minicard_view_set_property (GObject *object, set_empty_message (view); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_minicard_view_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicardView *view; view = E_MINICARD_VIEW (object); - switch (prop_id) { + switch (property_id) { case PROP_ADAPTER: g_value_set_object (value, view->adapter); break; @@ -335,7 +335,7 @@ e_minicard_view_get_property (GObject *object, "editable", value); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -378,7 +378,8 @@ e_minicard_view_dispose (GObject *object) } static guint -e_minicard_view_right_click (EMinicardView *view, GdkEvent *event) +e_minicard_view_right_click (EMinicardView *view, + GdkEvent *event) { guint ret_val = 0; g_signal_emit (view, signals[RIGHT_CLICK], 0, @@ -387,7 +388,8 @@ e_minicard_view_right_click (EMinicardView *view, GdkEvent *event) } static gboolean -e_minicard_view_event (GnomeCanvasItem *item, GdkEvent *event) +e_minicard_view_event (GnomeCanvasItem *item, + GdkEvent *event) { EMinicardView *view; @@ -463,32 +465,6 @@ e_minicard_view_selection_event (EReflow *reflow, return return_val; } -#if 0 -static gint -compare_to_utf_str (EMinicard *card, const gchar *utf_str) -{ - g_return_val_if_fail (card != NULL, 0); - g_return_val_if_fail (E_IS_MINICARD (card), 0); - - if (g_unichar_isdigit (g_utf8_get_char (utf_str))) { - return 1; - } - - if (card->card) { - gchar *file_as; - g_object_get (card->card, - "file_as", &file_as, - NULL); - if (file_as) - return g_utf8_strcasecmp (file_as, utf_str); - else - return 0; - } else { - return 0; - } -} -#endif - static void e_minicard_view_class_init (EMinicardViewClass *klass) { @@ -625,7 +601,8 @@ typedef struct { } ModelAndList; static void -add_to_list (gint index, gpointer closure) +add_to_list (gint index, + gpointer closure) { ModelAndList *mal = closure; mal->list = g_slist_prepend ( diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 352604984c..78d98e2cb2 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -43,8 +43,8 @@ static void e_minicard_init (EMinicard *card); static void e_minicard_class_init (EMinicardClass *class); -static void e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_minicard_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_minicard_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_minicard_dispose (GObject *object); static void e_minicard_finalize (GObject *object); static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event); @@ -266,7 +266,8 @@ e_minicard_init (EMinicard *minicard) } static void -set_selected (EMinicard *minicard, gboolean selected) +set_selected (EMinicard *minicard, + gboolean selected) { GnomeCanvas *canvas; GtkStyle *style; @@ -299,7 +300,8 @@ set_selected (EMinicard *minicard, gboolean selected) } static void -set_has_cursor (EMinicard *minicard, gboolean has_cursor) +set_has_cursor (EMinicard *minicard, + gboolean has_cursor) { if (!minicard->has_focus && has_cursor) e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (minicard), FALSE); @@ -307,7 +309,10 @@ set_has_cursor (EMinicard *minicard, gboolean has_cursor) } static void -e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_minicard_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; EMinicard *e_minicard; @@ -317,7 +322,7 @@ e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, G item = GNOME_CANVAS_ITEM (object); e_minicard = E_MINICARD (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: if (e_minicard->width != g_value_get_double (value)) { e_minicard->width = g_value_get_double (value); @@ -376,19 +381,22 @@ e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, G e_minicard->changed = FALSE; break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_minicard_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicard *e_minicard; e_minicard = E_MINICARD (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, e_minicard->width); break; @@ -411,7 +419,7 @@ e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamS g_value_set_object (value, e_minicard->contact); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -466,7 +474,8 @@ e_minicard_finalize (GObject *object) } static void -e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style) +e_minicard_style_set (EMinicard *minicard, + GtkStyle *previous_style) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (minicard); @@ -552,7 +561,8 @@ e_minicard_activate_editor (EMinicard *minicard) } static gboolean -e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) +e_minicard_event (GnomeCanvasItem *item, + GdkEvent *event) { EMinicard *e_minicard; @@ -658,7 +668,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) gint view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); if (view_index == 0) - view_index = row_count-1; + view_index = row_count - 1; else view_index--; @@ -683,7 +693,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) gint model_index = e_selection_model_cursor_row (reflow->selection); gint view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); - if (view_index == row_count-1) + if (view_index == row_count - 1) view_index = 0; else view_index++; @@ -718,7 +728,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) } static void -e_minicard_resize_children ( EMinicard *e_minicard ) +e_minicard_resize_children (EMinicard *e_minicard) { GList *list; gboolean is_list = GPOINTER_TO_INT (e_contact_get (e_minicard->contact, E_CONTACT_IS_LIST)); @@ -742,7 +752,9 @@ e_minicard_resize_children ( EMinicard *e_minicard ) } static void -add_field (EMinicard *e_minicard, EContactField field, gdouble left_width) +add_field (EMinicard *e_minicard, + EContactField field, + gdouble left_width) { GnomeCanvasItem *new_item; GnomeCanvasGroup *group; @@ -808,7 +820,11 @@ get_email_location (EVCardAttribute *attr) } static void -add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, gint limit, gboolean is_list) +add_email_field (EMinicard *e_minicard, + GList *email_list, + gdouble left_width, + gint limit, + gboolean is_list) { GnomeCanvasItem *new_item; GnomeCanvasGroup *group; @@ -820,7 +836,7 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, g GList *emails = e_contact_get (e_minicard->contact, E_CONTACT_EMAIL); group = GNOME_CANVAS_GROUP ( e_minicard ); - for (l=email_list, le=emails; l!=NULL && count < limit && le!=NULL; l = l->next, le=le->next) { + for (l = email_list, le = emails; l != NULL && count < limit && le != NULL; l = l->next, le = le->next) { const gchar *tmp; gchar *email = NULL; gchar *string = NULL; @@ -881,7 +897,8 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, g } static gint -get_left_width (EMinicard *e_minicard, gboolean is_list) +get_left_width (EMinicard *e_minicard, + gboolean is_list) { gchar *name; EContactField field; @@ -910,7 +927,7 @@ get_left_width (EMinicard *e_minicard, gboolean is_list) } static void -remodel ( EMinicard *e_minicard ) +remodel (EMinicard *e_minicard) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (e_minicard); gint count = 0; @@ -947,7 +964,7 @@ remodel ( EMinicard *e_minicard ) for (field = E_CONTACT_FULL_NAME; field != (E_CONTACT_LAST_SIMPLE_STRING -1) && count < 5; field++) { EMinicardField *minicard_field = NULL; - gboolean is_email=FALSE; + gboolean is_email = FALSE; if (field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_GIVEN_NAME) continue; @@ -958,7 +975,7 @@ remodel ( EMinicard *e_minicard ) if (email_rendered) continue; email_rendered = TRUE; - is_email=TRUE; + is_email = TRUE; } if (list) @@ -992,7 +1009,7 @@ remodel ( EMinicard *e_minicard ) limit = 5 - count; email = e_contact_get_attributes (e_minicard->contact, E_CONTACT_EMAIL); add_email_field (e_minicard, email, left_width, limit, is_list); - if (count+limit >5) + if (count + limit >5) count = 5; else count = count + g_list_length (email); @@ -1014,7 +1031,8 @@ remodel ( EMinicard *e_minicard ) } static void -e_minicard_reflow (GnomeCanvasItem *item, gint flags) +e_minicard_reflow (GnomeCanvasItem *item, + gint flags) { EMinicard *e_minicard = E_MINICARD (item); @@ -1074,7 +1092,8 @@ e_minicard_get_card_id (EMinicard *minicard) } gint -e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) +e_minicard_compare (EMinicard *minicard1, + EMinicard *minicard2) { gint cmp = 0; @@ -1109,7 +1128,8 @@ e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) } gint -e_minicard_selected (EMinicard *minicard, GdkEvent *event) +e_minicard_selected (EMinicard *minicard, + GdkEvent *event) { gint ret_val = 0; GnomeCanvasItem *item = GNOME_CANVAS_ITEM (minicard); @@ -1129,7 +1149,8 @@ e_minicard_selected (EMinicard *minicard, GdkEvent *event) } static gint -e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event) +e_minicard_drag_begin (EMinicard *minicard, + GdkEvent *event) { gint ret_val = 0; GnomeCanvasItem *parent; diff --git a/addressbook/gui/widgets/ea-addressbook-view.c b/addressbook/gui/widgets/ea-addressbook-view.c index 2d432b6a76..c5bb9fc018 100644 --- a/addressbook/gui/widgets/ea-addressbook-view.c +++ b/addressbook/gui/widgets/ea-addressbook-view.c @@ -106,7 +106,7 @@ ea_ab_view_get_description (AtkObject *accessible) return _("evolution address book"); } -AtkObject* +AtkObject * ea_ab_view_new (GObject *obj) { GObject *object; diff --git a/addressbook/gui/widgets/ea-addressbook-view.h b/addressbook/gui/widgets/ea-addressbook-view.h index db9e008ab1..55da1d5e37 100644 --- a/addressbook/gui/widgets/ea-addressbook-view.h +++ b/addressbook/gui/widgets/ea-addressbook-view.h @@ -48,7 +48,7 @@ struct _EaABViewClass }; GType ea_ab_view_get_type (void); -AtkObject* ea_ab_view_new (GObject *obj); +AtkObject * ea_ab_view_new (GObject *obj); G_END_DECLS diff --git a/addressbook/gui/widgets/ea-addressbook.c b/addressbook/gui/widgets/ea-addressbook.c index b67d876139..b57720be39 100644 --- a/addressbook/gui/widgets/ea-addressbook.c +++ b/addressbook/gui/widgets/ea-addressbook.c @@ -36,9 +36,9 @@ EA_FACTORY_GOBJECT (EA_TYPE_MINICARD_VIEW, ea_minicard_view, ea_minicard_view_ne EA_FACTORY_GOBJECT (EA_TYPE_AB_VIEW, ea_ab_view, ea_ab_view_new) static gboolean ea_addressbook_focus_watcher (GSignalInvocationHint *ihint, - guint n_param_values, - const GValue *param_values, - gpointer data); + guint n_param_values, + const GValue *param_values, + gpointer data); void e_minicard_a11y_init (void) { @@ -64,9 +64,9 @@ void eab_view_a11y_init (void) static gboolean ea_addressbook_focus_watcher (GSignalInvocationHint *ihint, - guint n_param_values, - const GValue *param_values, - gpointer data) + guint n_param_values, + const GValue *param_values, + gpointer data) { GObject *object; GdkEvent *event; diff --git a/addressbook/gui/widgets/ea-minicard-view.c b/addressbook/gui/widgets/ea-minicard-view.c index a61c6074a0..58d3a5fd2b 100644 --- a/addressbook/gui/widgets/ea-minicard-view.c +++ b/addressbook/gui/widgets/ea-minicard-view.c @@ -51,7 +51,7 @@ static void atk_selection_interface_init (AtkSelectionIface *iface); static gboolean selection_interface_add_selection (AtkSelection *selection, gint i); static gboolean selection_interface_clear_selection (AtkSelection *selection); -static AtkObject* selection_interface_ref_selection (AtkSelection *selection, +static AtkObject * selection_interface_ref_selection (AtkSelection *selection, gint i); static gint selection_interface_get_selection_count (AtkSelection *selection); static gboolean selection_interface_is_child_selected (AtkSelection *selection, @@ -187,7 +187,7 @@ ea_minicard_view_get_description (AtkObject *accessible) return _("evolution address book"); } -AtkObject* +AtkObject * ea_minicard_view_new (GObject *obj) { GObject *object; @@ -242,7 +242,8 @@ static AtkStateSet *ea_minicard_view_ref_state_set (AtkObject *obj) } static AtkObject * -ea_minicard_view_ref_child (AtkObject *accessible, gint index) +ea_minicard_view_ref_child (AtkObject *accessible, + gint index) { EReflow *reflow; gint child_num; @@ -288,7 +289,8 @@ atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_interface_add_selection (AtkSelection *selection, gint i) +selection_interface_add_selection (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj= NULL; EReflow *reflow = NULL; @@ -322,8 +324,9 @@ selection_interface_clear_selection (AtkSelection *selection) return TRUE; } -static AtkObject* -selection_interface_ref_selection (AtkSelection *selection, gint i) +static AtkObject * +selection_interface_ref_selection (AtkSelection *selection, + gint i) { return ea_minicard_view_ref_child (ATK_OBJECT (selection), i); } @@ -344,7 +347,8 @@ selection_interface_get_selection_count (AtkSelection *selection) } static gboolean -selection_interface_is_child_selected (AtkSelection *selection, gint i) +selection_interface_is_child_selected (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj = NULL; EReflow *reflow = NULL; @@ -407,13 +411,15 @@ static gint atk_action_interface_get_n_action (AtkAction *iface) } static const gchar * -atk_action_interface_get_description (AtkAction *iface, gint i) +atk_action_interface_get_description (AtkAction *iface, + gint i) { return atk_action_interface_get_name (iface, i); } static const gchar * -atk_action_interface_get_name (AtkAction *iface, gint i) +atk_action_interface_get_name (AtkAction *iface, + gint i) { if ( i >= G_N_ELEMENTS (action_name) || i < 0) return NULL; diff --git a/addressbook/gui/widgets/ea-minicard-view.h b/addressbook/gui/widgets/ea-minicard-view.h index 320c74d15e..889674bb92 100644 --- a/addressbook/gui/widgets/ea-minicard-view.h +++ b/addressbook/gui/widgets/ea-minicard-view.h @@ -49,7 +49,7 @@ struct _EaMinicardViewClass GType ea_minicard_view_get_type (void); -AtkObject* ea_minicard_view_new (GObject *obj); +AtkObject * ea_minicard_view_new (GObject *obj); G_END_DECLS diff --git a/addressbook/gui/widgets/ea-minicard.c b/addressbook/gui/widgets/ea-minicard.c index 2e8d4281ef..45d496ffa0 100644 --- a/addressbook/gui/widgets/ea-minicard.c +++ b/addressbook/gui/widgets/ea-minicard.c @@ -229,7 +229,8 @@ ea_minicard_get_n_children (AtkObject *accessible) } static AtkObject * -ea_minicard_ref_child (AtkObject *accessible, gint index) +ea_minicard_ref_child (AtkObject *accessible, + gint index) { return NULL; } @@ -246,7 +247,8 @@ atk_action_interface_init (AtkActionIface *iface) } static gboolean -atk_action_interface_do_action (AtkAction *iface, gint i) +atk_action_interface_do_action (AtkAction *iface, + gint i) { EMinicard *minicard = NULL; @@ -278,13 +280,15 @@ atk_action_interface_get_n_action (AtkAction *iface) } static const gchar * -atk_action_interface_get_description (AtkAction *iface, gint i) +atk_action_interface_get_description (AtkAction *iface, + gint i) { return atk_action_interface_get_name (iface, i); } static const gchar * -atk_action_interface_get_name (AtkAction *iface, gint i) +atk_action_interface_get_name (AtkAction *iface, + gint i) { if ( i >= G_N_ELEMENTS (action_name) || i < 0) return NULL; diff --git a/addressbook/gui/widgets/ea-minicard.h b/addressbook/gui/widgets/ea-minicard.h index d4c96fa787..ea27158011 100644 --- a/addressbook/gui/widgets/ea-minicard.h +++ b/addressbook/gui/widgets/ea-minicard.h @@ -49,7 +49,7 @@ struct _EaMinicardClass }; GType ea_minicard_get_type (void); -AtkObject* ea_minicard_new (GObject *obj); +AtkObject * ea_minicard_new (GObject *obj); G_END_DECLS diff --git a/addressbook/gui/widgets/eab-config.c b/addressbook/gui/widgets/eab-config.c index 5cb8d25e81..e1a0501203 100644 --- a/addressbook/gui/widgets/eab-config.c +++ b/addressbook/gui/widgets/eab-config.c @@ -40,7 +40,8 @@ ecp_init (EABConfig *cfg) } static void -ecp_target_free (EConfig *ec, EConfigTarget *t) +ecp_target_free (EConfig *ec, + EConfigTarget *t) { struct _EABConfigPrivate *p = EAB_CONFIG (ec)->priv; @@ -78,13 +79,15 @@ ecp_target_free (EConfig *ec, EConfigTarget *t) } static void -ecp_source_changed (struct _ESource *source, EConfig *ec) +ecp_source_changed (ESource *source, + EConfig *ec) { e_config_target_changed (ec, E_CONFIG_TARGET_CHANGED_STATE); } static void -ecp_set_target (EConfig *ec, EConfigTarget *t) +ecp_set_target (EConfig *ec, + EConfigTarget *t) { struct _EABConfigPrivate *p = EAB_CONFIG (ec)->priv; @@ -137,7 +140,8 @@ eab_config_get_type (void) } EABConfig * -eab_config_new (gint type, const gchar *menuid) +eab_config_new (gint type, + const gchar *menuid) { EABConfig *ecp = g_object_new (eab_config_get_type (), NULL); e_config_construct (&ecp->config, type, menuid); @@ -145,7 +149,8 @@ eab_config_new (gint type, const gchar *menuid) } EABConfigTargetSource * -eab_config_target_new_source (EABConfig *ecp, struct _ESource *source) +eab_config_target_new_source (EABConfig *ecp, + ESource *source) { EABConfigTargetSource *t = e_config_target_new ( &ecp->config, EAB_CONFIG_TARGET_SOURCE, sizeof (*t)); @@ -157,7 +162,8 @@ eab_config_target_new_source (EABConfig *ecp, struct _ESource *source) } EABConfigTargetPrefs * -eab_config_target_new_prefs (EABConfig *ecp, GConfClient *gconf) +eab_config_target_new_prefs (EABConfig *ecp, + GConfClient *gconf) { EABConfigTargetPrefs *t = e_config_target_new ( &ecp->config, EAB_CONFIG_TARGET_PREFS, sizeof (*t)); diff --git a/addressbook/gui/widgets/eab-config.h b/addressbook/gui/widgets/eab-config.h index 7cf79244e2..70023360e0 100644 --- a/addressbook/gui/widgets/eab-config.h +++ b/addressbook/gui/widgets/eab-config.h @@ -25,6 +25,7 @@ #define __EAB_CONFIG_H__ #include <gconf/gconf-client.h> +#include <libedataserver/e-source.h> #include "e-util/e-config.h" #define EAB_TYPE_CONFIG (eab_config_get_type ()) @@ -56,7 +57,7 @@ typedef struct _EABConfigTargetSource EABConfigTargetSource; struct _EABConfigTargetSource { EConfigTarget target; - struct _ESource *source; + ESource *source; }; typedef struct _EABConfigTargetPrefs EABConfigTargetPrefs; @@ -73,7 +74,7 @@ typedef struct _EConfigItem EABConfigItem; GType eab_config_get_type (void); EABConfig *eab_config_new (gint type, const gchar *menuid); -EABConfigTargetSource *eab_config_target_new_source (EABConfig *ecp, struct _ESource *source); +EABConfigTargetSource *eab_config_target_new_source (EABConfig *ecp, ESource *source); EABConfigTargetPrefs *eab_config_target_new_prefs (EABConfig *ecp, GConfClient *gconf); G_END_DECLS diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index 56a2511d64..da558352bb 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -52,7 +52,7 @@ struct _EABContactDisplayPrivate { GtkOrientation orientation; gboolean show_maps; - GHashTable *closed_lists; /* see render_contact_list_* */ + GHashTable *closed_lists; /* see render_contact_list_ * */ }; enum { @@ -193,7 +193,9 @@ static GtkActionEntry internal_mailto_entries[] = { }; static void -render_address_link (GString *buffer, EContact *contact, gint map_type) +render_address_link (GString *buffer, + EContact *contact, + gint map_type) { EContactAddress *adr; GString *link = g_string_new (""); @@ -366,8 +368,7 @@ accum_multival_attribute (GString *buffer, GList *val_list, *l; /* Workaround till bug [1] is fixed. - [1] https://bugzilla.gnome.org/show_bug.cgi?id=473862 - */ + * [1] https://bugzilla.gnome.org/show_bug.cgi?id=473862 */ icon = NULL; val_list = e_contact_get (contact, field); @@ -409,7 +410,8 @@ get_email_location (EVCardAttribute *attr) } static void -render_title_block (GString *buffer, EContact *contact) +render_title_block (GString *buffer, + EContact *contact) { const gchar *str; gchar *html; @@ -455,9 +457,9 @@ render_title_block (GString *buffer, EContact *contact) static void render_contact_list_row (GString *buffer, - EDestination *destination, - EABContactDisplay *display) - { + EDestination *destination, + EABContactDisplay *display) +{ gchar *evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL); gboolean list_collapsed = FALSE; const gchar *listId = e_destination_get_contact_uid (destination), *textrep; @@ -576,13 +578,14 @@ render_contact_list (GString *buffer, } static void -render_contact_block (GString *buffer, EContact *contact) +render_contact_block (GString *buffer, + EContact *contact) { GString *accum; GList *email_list, *l, *email_attr_list, *al; gint email_num = 0; const gchar *nl; - gchar *nick=NULL; + gchar *nick = NULL; accum = g_string_new (""); nl = ""; @@ -592,7 +595,7 @@ render_contact_block (GString *buffer, EContact *contact) email_list = e_contact_get (contact, E_CONTACT_EMAIL); email_attr_list = e_contact_get_attributes (contact, E_CONTACT_EMAIL); - for (l = email_list, al=email_attr_list; l && al; l = l->next, al = al->next) { + for (l = email_list, al = email_attr_list; l && al; l = l->next, al = al->next) { gchar *name = NULL, *mail = NULL; gchar *attr_str = (gchar *) get_email_location ((EVCardAttribute *) al->data); @@ -669,7 +672,8 @@ render_contact_block (GString *buffer, EContact *contact) } static void -render_work_block (GString *buffer, EContact *contact) +render_work_block (GString *buffer, + EContact *contact) { GString *accum = g_string_new (""); @@ -696,7 +700,8 @@ render_work_block (GString *buffer, EContact *contact) } static void -render_personal_block (GString *buffer, EContact *contact) +render_personal_block (GString *buffer, + EContact *contact) { GString *accum = g_string_new (""); @@ -719,7 +724,8 @@ render_personal_block (GString *buffer, EContact *contact) } static void -render_note_block (GString *buffer, EContact *contact) +render_note_block (GString *buffer, + EContact *contact) { const gchar *str; gchar *html; @@ -738,7 +744,9 @@ render_note_block (GString *buffer, EContact *contact) } static void -render_address_map (GString *buffer, EContact *contact, gint map_type) +render_address_map (GString *buffer, + EContact *contact, + gint map_type) { #ifdef WITH_CONTACT_MAPS if (map_type == E_CONTACT_ADDRESS_WORK) { @@ -750,7 +758,9 @@ render_address_map (GString *buffer, EContact *contact, gint map_type) } static void -render_contact_horizontal (GString *buffer, EContact *contact, gboolean show_maps) +render_contact_horizontal (GString *buffer, + EContact *contact, + gboolean show_maps) { g_string_append (buffer, "<table border=\"0\">"); render_title_block (buffer, contact); @@ -776,7 +786,9 @@ render_contact_horizontal (GString *buffer, EContact *contact, gboolean show_map } static void -render_contact_vertical (GString *buffer, EContact *contact, gboolean show_maps) +render_contact_vertical (GString *buffer, + EContact *contact, + gboolean show_maps) { /* First row: photo & name */ g_string_append (buffer, "<tr><td colspan=\"3\">"); @@ -817,7 +829,10 @@ render_contact_vertical (GString *buffer, EContact *contact, gboolean show_maps) } static void -render_contact (GString *buffer, EContact *contact, GtkOrientation orientation, gboolean show_maps) +render_contact (GString *buffer, + EContact *contact, + GtkOrientation orientation, + gboolean show_maps) { if (orientation == GTK_ORIENTATION_VERTICAL) render_contact_vertical (buffer, contact, show_maps); @@ -911,9 +926,9 @@ eab_contact_display_render_compact (EABContactDisplay *display, GdkPixbuf *pixbuf; /* figure out if we need to downscale the - image here. we don't scale the pixbuf - itself, just insert width/height tags in - the html */ + * image here. we don't scale the pixbuf + * itself, just insert width/height tags in + * the html */ gdk_pixbuf_loader_write (loader, photo->data.inlined.data, photo->data.inlined.length, NULL); gdk_pixbuf_loader_close (loader, NULL); pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); @@ -1259,7 +1274,7 @@ contact_display_link_clicked (EWebView *web_view, contact_display_emit_send_message (display, index); return; } else if (g_str_has_prefix (uri, "##") && g_str_has_suffix (uri, "##")) { - gchar *list_id = g_strndup (uri+2, strlen (uri) - 4); + gchar *list_id = g_strndup (uri + 2, strlen (uri) - 4); if (g_hash_table_lookup (display->priv->closed_lists, list_id)) { g_hash_table_remove (display->priv->closed_lists, list_id); @@ -1278,19 +1293,21 @@ contact_display_link_clicked (EWebView *web_view, } #ifdef WITH_CONTACT_MAPS -/** - * Clutter event handling workaround. Clutter-gtk propagates events down to parent widgets. - * In this case it leads to GtkHTML scrolling up and down while user's trying to zoom in the - * champlain widget. This workaround stops the propagation from map widget down to GtkHTML - */ +/* XXX Clutter event handling workaround. Clutter-gtk propagates events down + * to parent widgets. In this case it leads to GtkHTML scrolling up and + * down while user's trying to zoom in the champlain widget. This + * workaround stops the propagation from map widget down to GtkHTML. */ static gboolean -handle_map_scroll_event (GtkWidget *widget, GdkEvent *event) +handle_map_scroll_event (GtkWidget *widget, + GdkEvent *event) { return TRUE; } static void -contact_display_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, EABContactDisplay *display) +contact_display_object_requested (GtkHTML *html, + GtkHTMLEmbedded *eb, + EABContactDisplay *display) { EContact *contact = display->priv->contact; const gchar *name = e_contact_get_const (contact, E_CONTACT_FILE_AS); @@ -1587,7 +1604,8 @@ eab_contact_display_get_orientation (EABContactDisplay *display) } void -eab_contact_display_set_orientation (EABContactDisplay *display, GtkOrientation orientation) +eab_contact_display_set_orientation (EABContactDisplay *display, + GtkOrientation orientation) { EABContactDisplayMode mode; EContact *contact; @@ -1620,7 +1638,8 @@ eab_contact_display_get_show_maps (EABContactDisplay *display) } void -eab_contact_display_set_show_maps (EABContactDisplay *display, gboolean show_maps) +eab_contact_display_set_show_maps (EABContactDisplay *display, + gboolean show_maps) { EABContactDisplayMode mode; EContact *contact; diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index d910b339b4..c951b290c7 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -83,23 +83,29 @@ typedef enum { } AddressFormat; void -eab_error_dialog (EAlertSink *alert_sink, const gchar *msg, const GError *error) +eab_error_dialog (EAlertSink *alert_sink, + const gchar *msg, + const GError *error) { if (error && error->message) { if (alert_sink) - e_alert_submit (alert_sink, - "addressbook:generic-error", - msg, error->message, NULL); + e_alert_submit ( + alert_sink, + "addressbook:generic-error", + msg, error->message, NULL); else e_alert_run_dialog_for_args ( - e_shell_get_active_window (NULL), - "addressbook:generic-error", - msg, error->message, NULL); + e_shell_get_active_window (NULL), + "addressbook:generic-error", + msg, error->message, NULL); } } void -eab_load_error_dialog (GtkWidget *parent, EAlertSink *alert_sink, ESource *source, const GError *error) +eab_load_error_dialog (GtkWidget *parent, + EAlertSink *alert_sink, + ESource *source, + const GError *error) { gchar *label_string, *label = NULL, *uri; gboolean can_detail_error = TRUE; @@ -110,10 +116,12 @@ eab_load_error_dialog (GtkWidget *parent, EAlertSink *alert_sink, ESource *sourc if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_OFFLINE_UNAVAILABLE)) { can_detail_error = FALSE; - label_string = _("This address book cannot be opened. This either means this " - "book is not marked for offline usage or not yet downloaded " - "for offline usage. Please load the address book once in online mode " - "to download its contents."); + label_string = + _("This address book cannot be opened. This either " + "means this book is not marked for offline usage " + "or not yet downloaded for offline usage. Please " + "load the address book once in online mode to " + "download its contents."); } else if (uri && g_str_has_prefix (uri, "local:")) { @@ -187,7 +195,8 @@ eab_load_error_dialog (GtkWidget *parent, EAlertSink *alert_sink, ESource *sourc } void -eab_search_result_dialog (EAlertSink *alert_sink, const GError *error) +eab_search_result_dialog (EAlertSink *alert_sink, + const GError *error) { gchar *str = NULL; @@ -265,7 +274,8 @@ make_safe_filename (gchar *name) } static void -source_selection_changed_cb (ESourceSelector *selector, GtkWidget *ok_button) +source_selection_changed_cb (ESourceSelector *selector, + GtkWidget *ok_button) { ESource *except_source = NULL, *selected; @@ -276,7 +286,11 @@ source_selection_changed_cb (ESourceSelector *selector, GtkWidget *ok_button) } ESource * -eab_select_source (ESource *except_source, const gchar *title, const gchar *message, const gchar *select_uid, GtkWindow *parent) +eab_select_source (ESource *except_source, + const gchar *title, + const gchar *message, + const gchar *select_uid, + GtkWindow *parent) { ESource *source; ESourceList *source_list; @@ -395,7 +409,8 @@ remove_contact_ready_cb (GObject *source_object, } static void -do_delete_from_source (gpointer data, gpointer user_data) +do_delete_from_source (gpointer data, + gpointer user_data) { ContactCopyProcess *process = user_data; EContact *contact = data; @@ -441,7 +456,10 @@ process_unref (ContactCopyProcess *process) } static void -contact_added_cb (EBookClient *book_client, const GError *error, const gchar *id, gpointer user_data) +contact_added_cb (EBookClient *book_client, + const GError *error, + const gchar *id, + gpointer user_data) { ContactCopyProcess *process = user_data; @@ -462,7 +480,8 @@ contact_added_cb (EBookClient *book_client, const GError *error, const gchar *id } static void -do_copy (gpointer data, gpointer user_data) +do_copy (gpointer data, + gpointer user_data) { EBookClient *book_client; EContact *contact; @@ -568,11 +587,12 @@ eab_transfer_contacts (EBookClient *source_client, } /* To parse something like... -=?UTF-8?Q?=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87?=\t\n=?UTF-8?Q?=E0=A4=B0?=\t\n<aa@aa.ccom> -and return the decoded representation of name & email parts. -*/ + * =?UTF-8?Q?=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87?=\t\n=?UTF-8?Q?=E0=A4=B0?=\t\n<aa@aa.ccom> + * and return the decoded representation of name & email parts. */ gboolean -eab_parse_qp_email (const gchar *string, gchar **name, gchar **email) +eab_parse_qp_email (const gchar *string, + gchar **name, + gchar **email) { struct _camel_header_address *address; gboolean res = FALSE; @@ -595,9 +615,9 @@ eab_parse_qp_email (const gchar *string, gchar **name, gchar **email) } /* This is only wrapper to parse_qp_mail, it decodes string and if returned TRUE, - then makes one string and returns it, otherwise returns NULL. - Returned string is usable to place directly into GtkHtml stream. - Returned value should be freed with g_free. */ + * then makes one string and returns it, otherwise returns NULL. + * Returned string is usable to place directly into GtkHtml stream. + * Returned value should be freed with g_free. */ gchar * eab_parse_qp_email_to_html (const gchar *string) { @@ -731,7 +751,7 @@ country_to_ISO (const gchar *country) } /* If we get here, then no match was found in the map file and we - fallback to local system locales */ + * fallback to local system locales */ fclose (file); pair = get_locales (); @@ -748,8 +768,8 @@ country_to_ISO (const gchar *country) */ static gchar * get_key_file_locale_string (GKeyFile *key_file, - const gchar *key, - const gchar *locale) + const gchar *key, + const gchar *locale) { gchar *result; gchar *group; @@ -773,9 +793,9 @@ get_key_file_locale_string (GKeyFile *key_file, static void get_address_format (AddressFormat address_format, - const gchar *locale, - gchar **format, - gchar **country_position) + const gchar *locale, + gchar **format, + gchar **country_position) { GKeyFile *key_file; GError *error; @@ -858,7 +878,8 @@ find_balanced_bracket (const gchar *str) } static GString * -string_append_upper (GString *str, const gchar *c) +string_append_upper (GString *str, + const gchar *c) { gchar *up_c; @@ -876,10 +897,10 @@ string_append_upper (GString *str, const gchar *c) static gboolean parse_address_template_section (const gchar *format, - const gchar *realname, - const gchar *org_name, - EContactAddress *address, - gchar **result) + const gchar *realname, + const gchar *org_name, + EContactAddress *address, + gchar **result) { const gchar *pos, *old_pos; @@ -1026,7 +1047,7 @@ parse_address_template_section (const gchar *format, gchar * eab_format_address (EContact *contact, - EContactField address_type) + EContactField address_type) { gchar *result; gchar *format = NULL; @@ -1063,7 +1084,7 @@ eab_format_address (EContact *contact, } /* Expand all the variables in format. - Don't display organization in home address */ + * Don't display organization in home address */ parse_address_template_section (format, e_contact_get_const (contact, E_CONTACT_FULL_NAME), (address_type == E_CONTACT_ADDRESS_WORK) ? e_contact_get_const (contact, E_CONTACT_ORG): NULL, @@ -1071,7 +1092,7 @@ eab_format_address (EContact *contact, &result); /* Add the country line. In some countries, the address can be located above the - rest of the address */ + * rest of the address */ if (addr->country && country_position) { gchar *country_upper = g_utf8_strup (addr->country, -1); gchar *p = result; diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c index 6033b34758..280ae7583f 100644 --- a/addressbook/gui/widgets/gal-view-minicard.c +++ b/addressbook/gui/widgets/gal-view-minicard.c @@ -236,8 +236,8 @@ gal_view_minicard_new (const gchar *title) * Returns: The GalViewMinicard. */ GalView * -gal_view_minicard_construct (GalViewMinicard *view, - const gchar *title) +gal_view_minicard_construct (GalViewMinicard *view, + const gchar *title) { view->title = g_strdup (title); |