aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-01 10:53:20 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-02-20 23:04:25 +0800
commit23f5773903d64a554d977ae7d0ebbaca73528f1f (patch)
tree104e1a59da8bf96b004bce204b79f47bbe0a6d13 /addressbook/gui/contact-editor
parent49bc4c2d765ee1780c23fdc9f42152850dabb220 (diff)
downloadgsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.gz
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.bz2
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.lz
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.xz
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.zst
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c41
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c8
-rw-r--r--addressbook/gui/contact-editor/eab-editor.c38
3 files changed, 22 insertions, 65 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index f926eea764..3189632d53 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -73,8 +73,6 @@ enum {
NUM_IM_COLUMNS
};
-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 property_id,
const GValue *value,
@@ -205,6 +203,8 @@ static const gint email_default[] = { 0, 1, 2, 2 };
#define STRING_IS_EMPTY(x) (!(x) || !(*(x)))
#define STRING_MAKE_NON_NULL(x) ((x) ? (x) : "")
+G_DEFINE_TYPE (EContactEditor, e_contact_editor, EAB_TYPE_EDITOR)
+
static void
e_contact_editor_contact_added (EABEditor *editor,
const GError *error,
@@ -256,37 +256,11 @@ e_contact_editor_closed (EABEditor *editor)
g_object_unref (editor);
}
-GType
-e_contact_editor_get_type (void)
-{
- static GType contact_editor_type = 0;
-
- if (!contact_editor_type) {
- static const GTypeInfo contact_editor_info = {
- sizeof (EContactEditorClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_init,
- };
-
- contact_editor_type = g_type_register_static (
- EAB_TYPE_EDITOR, "EContactEditor",
- &contact_editor_info, 0);
- }
-
- return contact_editor_type;
-}
-
static void
-e_contact_editor_class_init (EContactEditorClass *klass)
+e_contact_editor_class_init (EContactEditorClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- EABEditorClass *editor_class = EAB_EDITOR_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+ EABEditorClass *editor_class = EAB_EDITOR_CLASS (class);
parent_class = g_type_class_ref (EAB_TYPE_EDITOR);
@@ -3286,8 +3260,9 @@ categories_clicked (GtkWidget *button,
return;
}
- g_signal_connect (dialog, "response",
- G_CALLBACK (categories_response), editor);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (categories_response), editor);
/* Close the category dialog if the editor is closed*/
g_signal_connect_swapped (
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c
index 3595437f28..3ec9430040 100644
--- a/addressbook/gui/contact-editor/e-contact-quick-add.c
+++ b/addressbook/gui/contact-editor/e-contact-quick-add.c
@@ -450,7 +450,9 @@ build_quick_add_dialog (QuickAdd *qa)
container = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_container_set_border_width (GTK_CONTAINER (container), 0);
- g_signal_connect (dialog, "response", G_CALLBACK (clicked_cb), qa);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (clicked_cb), qa);
qa->dialog = dialog;
@@ -607,7 +609,9 @@ e_contact_quick_add_free_form (const gchar *text,
/* walk backwards to whitespace or a < or a quote... */
while (last_at >= text && !bad_char
- && !(isspace ((gint) *last_at) || *last_at == '<' || *last_at == '"')) {
+ && !(isspace ((gint) *last_at) ||
+ *last_at == '<' ||
+ *last_at == '"')) {
/* Check for some stuff that can't appear in a legal e-mail address. */
if (*last_at == '['
|| *last_at == ']'
diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c
index 241bc477a4..d6e8322ad8 100644
--- a/addressbook/gui/contact-editor/eab-editor.c
+++ b/addressbook/gui/contact-editor/eab-editor.c
@@ -31,6 +31,10 @@
#include "e-util/e-util.h"
#include "addressbook/gui/widgets/eab-gui-util.h"
+#define EAB_EDITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EAB_TYPE_EDITOR, EABEditorPrivate))
+
struct _EABEditorPrivate {
EShell *shell;
};
@@ -52,6 +56,8 @@ static GSList *all_editors;
static gpointer parent_class;
static guint signals[LAST_SIGNAL];
+G_DEFINE_ABSTRACT_TYPE (EABEditor, eab_editor, G_TYPE_OBJECT)
+
static void
eab_editor_quit_requested_cb (EShell *shell,
EShellQuitReason reason,
@@ -123,7 +129,7 @@ eab_editor_dispose (GObject *object)
{
EABEditorPrivate *priv;
- priv = EAB_EDITOR (object)->priv;
+ priv = EAB_EDITOR_GET_PRIVATE (object);
if (priv->shell != NULL) {
g_signal_handlers_disconnect_matched (
@@ -214,39 +220,11 @@ eab_editor_class_init (EABEditorClass *class)
static void
eab_editor_init (EABEditor *editor)
{
- editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- editor, EAB_TYPE_EDITOR, EABEditorPrivate);
+ editor->priv = EAB_EDITOR_GET_PRIVATE (editor);
all_editors = g_slist_prepend (all_editors, editor);
}
-GType
-eab_editor_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EABEditorClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) eab_editor_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EABEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) eab_editor_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- G_TYPE_OBJECT, "EABEditor", &type_info,
- G_TYPE_FLAG_ABSTRACT);
- }
-
- return type;
-}
-
EShell *
eab_editor_get_shell (EABEditor *editor)
{