aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-16 23:25:56 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:09:00 +0800
commit777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 (patch)
treedfab9ca8f30c7b1539f86dfe19b8bf761d6a899c /addressbook/gui/contact-editor
parent83675abbc2b3a3bc6421094a56651d021fc0cdcd (diff)
downloadgsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.gz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.bz2
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.lz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.xz
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.tar.zst
gsoc2013-evolution-777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-fullname.c2
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c89
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c38
-rw-r--r--addressbook/gui/contact-editor/eab-editor.c12
-rw-r--r--addressbook/gui/contact-editor/eab-editor.h2
-rw-r--r--addressbook/gui/contact-editor/test-editor.c6
6 files changed, 92 insertions, 57 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
index c2dc45304b..c23a05ba6f 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
@@ -249,7 +249,7 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam
GTK_WINDOW (e_contact_editor_fullname), "contact-new");
}
-GtkWidget*
+GtkWidget *
e_contact_editor_fullname_new (const EContactName *name)
{
GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_FULLNAME, NULL);
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 5dd02b48e6..6ce9524afc 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -76,11 +76,11 @@ enum {
static void e_contact_editor_init (EContactEditor *editor);
static void e_contact_editor_class_init (EContactEditorClass *klass);
static void e_contact_editor_set_property (GObject *object,
- guint prop_id,
+ guint property_id,
const GValue *value,
GParamSpec *pspec);
static void e_contact_editor_get_property (GObject *object,
- guint prop_id,
+ guint property_id,
GValue *value,
GParamSpec *pspec);
static void e_contact_editor_dispose (GObject *object);
@@ -488,7 +488,7 @@ name_to_style (const EContactName *name,
string = g_strjoinv(" ", strings);
break;
case 2:
- midstrptr=midstring;
+ midstrptr = midstring;
if (name) {
if (name->family && *name->family)
*(midstrptr++) = name->family;
@@ -567,7 +567,8 @@ file_as_get_style (EContactEditor *editor)
}
static void
-file_as_set_style (EContactEditor *editor, gint style)
+file_as_set_style (EContactEditor *editor,
+ gint style)
{
gchar *string;
gint i;
@@ -1008,7 +1009,8 @@ get_ui_slot (EVCardAttribute *attr)
}
static void
-set_ui_slot (EVCardAttribute *attr, gint slot)
+set_ui_slot (EVCardAttribute *attr,
+ gint slot)
{
EVCardAttributeParam *param;
gchar *slot_str;
@@ -1524,7 +1526,8 @@ extract_phone (EContactEditor *editor)
}
static void
-init_phone_record_type (EContactEditor *editor, gint record)
+init_phone_record_type (EContactEditor *editor,
+ gint record)
{
GtkWidget *phone_type_combo_box;
GtkWidget *phone_entry;
@@ -1945,7 +1948,8 @@ extract_im (EContactEditor *editor)
}
static void
-sensitize_im_types (EContactEditor *editor, GtkWidget *combo_box)
+sensitize_im_types (EContactEditor *editor,
+ GtkWidget *combo_box)
{
GtkTreeModel *model;
GtkTreeIter iter;
@@ -1971,7 +1975,9 @@ sensitize_im_types (EContactEditor *editor, GtkWidget *combo_box)
}
static void
-sensitize_im_record (EContactEditor *editor, gint record, gboolean enabled)
+sensitize_im_record (EContactEditor *editor,
+ gint record,
+ gboolean enabled)
{
GtkWidget *service_combo_box;
#ifdef ENABLE_IM_LOCATION
@@ -2038,7 +2044,8 @@ init_personal (EContactEditor *editor)
}
static void
-init_address_textview (EContactEditor *editor, gint record)
+init_address_textview (EContactEditor *editor,
+ gint record)
{
gchar *textview_name;
GtkWidget *textview;
@@ -2078,7 +2085,8 @@ init_address_field (EContactEditor *editor,
}
static void
-init_address_record (EContactEditor *editor, gint record)
+init_address_record (EContactEditor *editor,
+ gint record)
{
init_address_textview (editor, record);
init_address_field (editor, record, "city");
@@ -2325,7 +2333,8 @@ set_address_label (EContact *contact,
}
static void
-extract_address_record (EContactEditor *editor, gint record)
+extract_address_record (EContactEditor *editor,
+ gint record)
{
EContactAddress *address;
@@ -2411,7 +2420,9 @@ sensitize_address_field (EContactEditor *editor,
}
static void
-sensitize_address_record (EContactEditor *editor, gint record, gboolean enabled)
+sensitize_address_record (EContactEditor *editor,
+ gint record,
+ gboolean enabled)
{
sensitize_address_textview (editor, record, enabled);
sensitize_address_field (editor, record, "city", enabled);
@@ -2520,7 +2531,8 @@ static FieldMapping simple_field_map[] = {
};
static void
-init_simple_field (EContactEditor *editor, GtkWidget *widget)
+init_simple_field (EContactEditor *editor,
+ GtkWidget *widget)
{
GObject *changed_object = NULL;
@@ -2569,7 +2581,9 @@ init_simple_field (EContactEditor *editor, GtkWidget *widget)
}
static void
-fill_in_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id)
+fill_in_simple_field (EContactEditor *editor,
+ GtkWidget *widget,
+ gint field_id)
{
EContact *contact;
@@ -2707,9 +2721,9 @@ extract_simple_field (EContactEditor *editor,
EContactDate date;
if (e_date_edit_get_date (
E_DATE_EDIT (widget),
- (gint *)&date.year,
- (gint *)&date.month,
- (gint *)&date.day))
+ (gint *) &date.year,
+ (gint *) &date.month,
+ (gint *) &date.day))
e_contact_set (contact, field_id, &date);
else
e_contact_set (contact, field_id, NULL);
@@ -2809,7 +2823,8 @@ extract_simple_field (EContactEditor *editor,
}
static void
-sensitize_simple_field (GtkWidget *widget, gboolean enabled)
+sensitize_simple_field (GtkWidget *widget,
+ gboolean enabled)
{
if (GTK_IS_ENTRY (widget))
gtk_editable_set_editable (GTK_EDITABLE (widget), enabled);
@@ -3258,7 +3273,7 @@ categories_clicked (GtkWidget *button,
return;
}
- g_signal_connect(dialog, "response",
+ g_signal_connect (dialog, "response",
G_CALLBACK (categories_response), editor);
/* Close the category dialog if the editor is closed*/
@@ -3649,7 +3664,8 @@ save_contact (EContactEditor *ce,
}
static void
-e_contact_editor_save_contact (EABEditor *editor, gboolean should_close)
+e_contact_editor_save_contact (EABEditor *editor,
+ gboolean should_close)
{
save_contact (E_CONTACT_EDITOR (editor), should_close);
}
@@ -3782,7 +3798,7 @@ e_contact_editor_is_changed (EABEditor *editor)
return E_CONTACT_EDITOR (editor)->changed;
}
-static GtkWindow*
+static GtkWindow *
e_contact_editor_get_window (EABEditor *editor)
{
return GTK_WINDOW (E_CONTACT_EDITOR (editor)->app);
@@ -3837,14 +3853,17 @@ app_delete_event_cb (GtkWidget *widget,
}
static void
-show_help_cb (GtkWidget *widget, gpointer data)
+show_help_cb (GtkWidget *widget,
+ gpointer data)
{
/* FIXME Pass a proper parent window. */
e_display_help (NULL, "usage-contact-cards");
}
static GList *
-add_to_tab_order (GList *list, GtkBuilder *builder, const gchar *name)
+add_to_tab_order (GList *list,
+ GtkBuilder *builder,
+ const gchar *name)
{
GtkWidget *widget = e_builder_get_widget (builder, name);
return g_list_prepend (list, widget);
@@ -3857,7 +3876,7 @@ setup_tab_order (GtkBuilder *builder)
GList *list = NULL;
/*
container = e_builder_get_widget(builder, "table-contact-editor-general");
-
+ *
if (container) {
list = add_to_tab_order(list, builder, "entry-fullname");
list = add_to_tab_order(list, builder, "entry-jobtitle");
@@ -3867,7 +3886,7 @@ setup_tab_order (GtkBuilder *builder)
list = add_to_tab_order(list, builder, "entry-phone-2");
list = add_to_tab_order(list, builder, "entry-phone-3");
list = add_to_tab_order(list, builder, "entry-phone-4");
-
+ *
list = add_to_tab_order(list, builder, "entry-email1");
list = add_to_tab_order(list, builder, "alignment-htmlmail");
list = add_to_tab_order(list, builder, "entry-web");
@@ -4253,12 +4272,16 @@ e_contact_editor_new (EShell *shell,
}
static void
-notify_readonly_cb (EBookClient *book_client, GParamSpec *pspec, EContactEditor *ce)
+notify_readonly_cb (EBookClient *book_client,
+ GParamSpec *pspec,
+ EContactEditor *ce)
{
+ EClient *client;
gint new_target_editable;
gboolean changed = FALSE;
- new_target_editable = !e_client_is_readonly (E_CLIENT (ce->target_client));
+ client = E_CLIENT (ce->target_client);
+ new_target_editable = !e_client_is_readonly (client);
if (ce->target_editable != new_target_editable)
changed = TRUE;
@@ -4271,7 +4294,7 @@ notify_readonly_cb (EBookClient *book_client, GParamSpec *pspec, EContactEditor
static void
e_contact_editor_set_property (GObject *object,
- guint prop_id,
+ guint property_id,
const GValue *value,
GParamSpec *pspec)
{
@@ -4279,7 +4302,7 @@ e_contact_editor_set_property (GObject *object,
editor = E_CONTACT_EDITOR (object);
- switch (prop_id) {
+ switch (property_id) {
case PROP_SOURCE_CLIENT: {
gboolean writable;
gboolean changed = FALSE;
@@ -4429,14 +4452,14 @@ e_contact_editor_set_property (GObject *object,
NULL, g_value_get_pointer (value));
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_contact_editor_get_property (GObject *object,
- guint prop_id,
+ guint property_id,
GValue *value,
GParamSpec *pspec)
{
@@ -4444,7 +4467,7 @@ e_contact_editor_get_property (GObject *object,
e_contact_editor = E_CONTACT_EDITOR (object);
- switch (prop_id) {
+ switch (property_id) {
case PROP_SOURCE_CLIENT:
g_value_set_object (value, e_contact_editor->source_client);
break;
@@ -4480,7 +4503,7 @@ e_contact_editor_get_property (GObject *object,
g_value_set_pointer (value, e_contact_editor->required_fields);
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c
index 0b33f8aa79..96af36fed2 100644
--- a/addressbook/gui/contact-editor/e-contact-quick-add.c
+++ b/addressbook/gui/contact-editor/e-contact-quick-add.c
@@ -91,7 +91,8 @@ quick_add_unref (QuickAdd *qa)
}
static void
-quick_add_set_name (QuickAdd *qa, const gchar *name)
+quick_add_set_name (QuickAdd *qa,
+ const gchar *name)
{
if (name == qa->name)
return;
@@ -101,7 +102,8 @@ quick_add_set_name (QuickAdd *qa, const gchar *name)
}
static void
-quick_add_set_email (QuickAdd *qa, const gchar *email)
+quick_add_set_email (QuickAdd *qa,
+ const gchar *email)
{
if (email == qa->email)
return;
@@ -111,7 +113,8 @@ quick_add_set_email (QuickAdd *qa, const gchar *email)
}
static void
-quick_add_set_vcard (QuickAdd *qa, const gchar *vcard)
+quick_add_set_vcard (QuickAdd *qa,
+ const gchar *vcard)
{
if (vcard == qa->vcard)
return;
@@ -332,7 +335,9 @@ edit_contact (QuickAdd *qa)
#define QUICK_ADD_RESPONSE_EDIT_FULL 2
static void
-clicked_cb (GtkWidget *w, gint button, gpointer closure)
+clicked_cb (GtkWidget *w,
+ gint button,
+ gpointer closure)
{
QuickAdd *qa = (QuickAdd *) closure;
@@ -400,7 +405,8 @@ sanitize_widgets (QuickAdd *qa)
}
static void
-source_changed (ESourceComboBox *source_combo_box, QuickAdd *qa)
+source_changed (ESourceComboBox *source_combo_box,
+ QuickAdd *qa)
{
ESource *source;
@@ -423,7 +429,7 @@ build_quick_add_dialog (QuickAdd *qa)
GtkWidget *label;
GtkTable *table;
ESource *source;
- const gint xpad=0, ypad=0;
+ const gint xpad = 0, ypad = 0;
g_return_val_if_fail (qa != NULL, NULL);
@@ -480,7 +486,7 @@ build_quick_add_dialog (QuickAdd *qa)
gtk_table_set_col_spacings (table, 12);
label = gtk_label_new_with_mnemonic (_("_Full name"));
- gtk_label_set_mnemonic_widget ((GtkLabel*) label, qa->name_entry);
+ gtk_label_set_mnemonic_widget ((GtkLabel *) label, qa->name_entry);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach (table, label,
@@ -522,8 +528,10 @@ build_quick_add_dialog (QuickAdd *qa)
}
void
-e_contact_quick_add (const gchar *in_name, const gchar *email,
- EContactQuickAddCallback cb, gpointer closure)
+e_contact_quick_add (const gchar *in_name,
+ const gchar *email,
+ EContactQuickAddCallback cb,
+ gpointer closure)
{
QuickAdd *qa;
GtkWidget *dialog;
@@ -543,10 +551,10 @@ e_contact_quick_add (const gchar *in_name, const gchar *email,
/* Remove extra whitespace and the quotes some mailers put around names. */
g_strstrip (name);
len = strlen (name);
- if ((name[0] == '\'' && name[len-1] == '\'') ||
+ if ((name[0] == '\'' && name[len - 1] == '\'') ||
(name[0] == '"' && name[len-1] == '"')) {
name[0] = ' ';
- name[len-1] = ' ';
+ name[len - 1] = ' ';
}
g_strstrip (name);
}
@@ -570,7 +578,7 @@ e_contact_quick_add_free_form (const gchar *text,
EContactQuickAddCallback cb,
gpointer closure)
{
- gchar *name=NULL, *email=NULL;
+ gchar *name = NULL, *email = NULL;
const gchar *last_at, *s;
gboolean in_quote;
@@ -612,7 +620,7 @@ e_contact_quick_add_free_form (const gchar *text,
/* ...and then split the text there */
if (!bad_char) {
if (text < last_at)
- name = g_strndup (text, last_at-text);
+ name = g_strndup (text, last_at - text);
email = g_strdup (last_at);
}
}
@@ -629,8 +637,8 @@ e_contact_quick_add_free_form (const gchar *text,
*email = ' ';
changed = TRUE;
}
- if (email[strlen (email)-1] == '>') {
- email[strlen (email)-1] = ' ';
+ if (email[strlen (email) - 1] == '>') {
+ email[strlen (email) - 1] = ' ';
changed = TRUE;
}
if (changed)
diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c
index bea34db512..241bc477a4 100644
--- a/addressbook/gui/contact-editor/eab-editor.c
+++ b/addressbook/gui/contact-editor/eab-editor.c
@@ -301,7 +301,8 @@ eab_editor_raise (EABEditor *editor)
}
void
-eab_editor_save_contact (EABEditor *editor, gboolean should_close)
+eab_editor_save_contact (EABEditor *editor,
+ gboolean should_close)
{
EABEditorClass *class;
@@ -339,7 +340,7 @@ eab_editor_is_valid (EABEditor *editor)
return class->is_valid (editor);
}
-GtkWindow*
+GtkWindow *
eab_editor_get_window (EABEditor *editor)
{
EABEditorClass *class;
@@ -353,11 +354,12 @@ eab_editor_get_window (EABEditor *editor)
}
/* This function prompts for saving if editor conents are in changed state and
- save or discards or cancels (just returns with out doing anything) according
- to user input. Editor gets destroyed in case of save and discard case. */
+ * save or discards or cancels (just returns with out doing anything) according
+ * to user input. Editor gets destroyed in case of save and discard case. */
gboolean
-eab_editor_prompt_to_save_changes (EABEditor *editor, GtkWindow *window)
+eab_editor_prompt_to_save_changes (EABEditor *editor,
+ GtkWindow *window)
{
if (!eab_editor_is_changed (editor)) {
eab_editor_close (EAB_EDITOR (editor));
diff --git a/addressbook/gui/contact-editor/eab-editor.h b/addressbook/gui/contact-editor/eab-editor.h
index 43e36e53a3..cf8a20aecb 100644
--- a/addressbook/gui/contact-editor/eab-editor.h
+++ b/addressbook/gui/contact-editor/eab-editor.h
@@ -68,7 +68,7 @@ struct _EABEditorClass {
void (* save_contact) (EABEditor *editor, gboolean should_close);
gboolean (* is_valid) (EABEditor *editor);
gboolean (* is_changed) (EABEditor *editor);
- GtkWindow* (* get_window) (EABEditor *editor);
+ GtkWindow * (* get_window) (EABEditor *editor);
/* signals */
void (* contact_added) (EABEditor *editor, const GError *error, EContact *contact);
diff --git a/addressbook/gui/contact-editor/test-editor.c b/addressbook/gui/contact-editor/test-editor.c
index 2f54bd57b1..1d9c24aed7 100644
--- a/addressbook/gui/contact-editor/test-editor.c
+++ b/addressbook/gui/contact-editor/test-editor.c
@@ -67,7 +67,8 @@ read_file (gchar *name)
/* Callback used when a contact editor is closed */
static void
-editor_closed_cb (EContactEditor *ce, gpointer data)
+editor_closed_cb (EContactEditor *ce,
+ gpointer data)
{
static gint count = 2;
@@ -79,7 +80,8 @@ editor_closed_cb (EContactEditor *ce, gpointer data)
}
gint
-main (gint argc, gchar *argv[])
+main (gint argc,
+ gchar *argv[])
{
gchar *cardstr;
EContactEditor *ce;