Don't build e-util-marshal, as we can use the glib marshallers. Use

2005-07-16  Diego Gonzalez  <diego@pemas.net>

    * Makefile.am: Don't build e-util-marshal, as we can use
      the glib marshallers.
    * e-image-chooser.c: (e_image_chooser_class_init): Use standard
      glib marshallers.
    * gnome-about-me.c: (about_me_focus_out),
      (about_me_get_address_field), (about_me_setup_dialog): Add some
      error checking.

      Patch by James Bowes.
This commit is contained in:
Diego Gonzalez 2005-07-16 21:09:01 +00:00 committed by Diego González
parent e1723021da
commit 542dfba26c
4 changed files with 34 additions and 24 deletions

View file

@ -1,3 +1,15 @@
2005-07-16 Diego Gonzalez <diego@pemas.net>
* Makefile.am: Don't build e-util-marshal, as we can use
the glib marshallers.
* e-image-chooser.c: (e_image_chooser_class_init): Use standard
glib marshallers.
* gnome-about-me.c: (about_me_focus_out),
(about_me_get_address_field), (about_me_setup_dialog): Add some
error checking.
Patch by James Bowes.
2005-07-13 Sebastien Bacher <seb128@debian.org>
* .cvsignore: new file.

View file

@ -11,26 +11,12 @@ gnome_about_me_SOURCES = \
eel-alert-dialog.c \
eel-alert-dialog.h \
eel-gtk-macros.h \
e-util-marshal.c \
e-util-marshal.h \
gnome-about-me-password.c \
gnome-about-me-password.h \
e-image-chooser.c \
e-image-chooser.h \
gnome-about-me.c
e-util-marshal.h: e-util-marshal.list
( @GLIB_GENMARSHAL@ --prefix=e_util_marshal $(srcdir)/e-util-marshal.list \
--header > util-marshal.tmp \
&& mv util-marshal.tmp e-util-marshal.h ) \
|| ( rm -f util-marshal.tmp && exit 1 )
e-util-marshal.c: e-util-marshal.h
( @GLIB_GENMARSHAL@ --prefix=e_util_marshal $(srcdir)/e-util-marshal.list \
--body > util-marshal.tmp \
&& mv util-marshal.tmp e-util-marshal.c ) \
|| ( rm -f util-marshal.tmp && exit 1 )
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
@ -42,4 +28,4 @@ Glade_DATA = gnome-about-me.glade
INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) $(LIBEBOOK_CFLAGS)
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA)
EXTRA_DIST = e-util-marshal.list $(Glade_DATA) $(pixmap_DATA)
EXTRA_DIST = $(Glade_DATA) $(pixmap_DATA)

View file

@ -22,6 +22,7 @@
#include <string.h>
#include <glib-object.h>
#include <glib/gi18n.h>
#include <gtk/gtkalignment.h>
#include <gtk/gtkframe.h>
@ -32,7 +33,6 @@
#include <libgnomevfs/gnome-vfs-ops.h>
#include "e-image-chooser.h"
#include "e-util-marshal.h"
struct _EImageChooserPrivate {
@ -136,7 +136,7 @@ e_image_chooser_class_init (EImageChooserClass *klass)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (EImageChooserClass, changed),
NULL, NULL,
e_util_marshal_NONE__NONE,
g_cclosure_marshal_VOID__VOID,
GTK_TYPE_NONE, 0);
/*

View file

@ -229,10 +229,10 @@ about_me_focus_out (GtkWidget *widget, GdkEventFocus *event, GnomeAboutMe *me)
iter_end = iter_start;
gtk_text_iter_forward_to_end (&iter_end);
str = gtk_text_iter_get_text (&iter_start, &iter_end);
} else {
str = "";
}
str = str ? str : "";
/* FIXME: i'm getting an empty address field in evolution */
if (i >= ADDRESS_HOME && i < ADDRESS_WORK) {
about_me_set_address_field (me->addr1, ids[i].cid, str);
@ -273,10 +273,11 @@ get_user_login (void)
static gchar *
about_me_get_address_field (EContactAddress *addr, guint cid)
{
gchar *str = NULL;
gchar *str;
if (addr == NULL)
if (addr == NULL) {
return NULL;
}
switch (cid) {
case ADDRESS_STREET:
@ -297,6 +298,9 @@ about_me_get_address_field (EContactAddress *addr, guint cid)
case ADDRESS_COUNTRY:
str = addr->country;
break;
default:
str = NULL;
break;
}
return str;
@ -666,6 +670,11 @@ about_me_setup_dialog (void)
dialog = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/gnome-about-me.glade",
"about-me-dialog", NULL);
if (dialog == NULL) {
g_error ("Unable to load glade file.");
exit (1);
}
me->dialog = dialog;
/* Connect the close button signal */
@ -696,18 +705,21 @@ about_me_setup_dialog (void)
me->create_self = TRUE;
me->contact = e_contact_new ();
g_print ("%s\n", error->message);
g_warning ("%s\n", error->message);
g_clear_error (&error);
if (me->book == NULL) {
me->book = e_book_new_system_addressbook (&error);
if (me->book == NULL)
g_print ("error message: %s\n", error->message);
if (me->book == NULL || error != NULL) {
g_error ("%s\n", error->message);
g_clear_error (&error);
}
if (e_book_open (me->book, FALSE, NULL) == FALSE) {
about_me_error (GTK_WINDOW (main_dialog),
_("Unable to open address book"));
g_clear_error (&error);
}
}
}