From 4b58038f453d5d84169611269e57160e65e9f569 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Mon, 11 Jun 2001 09:29:36 +0000 Subject: Made e_card_simple_get_id return const char *. 2001-06-11 Christopher James Lahey * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h: Made e_card_simple_get_id return const char *. * backend/ebook/e-card.c, backend/ebook/e-card.h: Made e_card_get_id return const char *. * gui/component/e-cardlist-model.c (e_cardlist_model_add): Made id variable const here. Added a break to make it slightly more efficient. * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h: Made e_minicard_get_card_id return const char *. svn path=/trunk/; revision=10183 --- addressbook/ChangeLog | 15 +++++++++++++++ addressbook/backend/ebook/e-card-simple.c | 2 +- addressbook/backend/ebook/e-card-simple.h | 2 +- addressbook/backend/ebook/e-card.c | 2 +- addressbook/backend/ebook/e-card.h | 2 +- addressbook/gui/component/e-cardlist-model.c | 3 ++- addressbook/gui/widgets/e-minicard.c | 2 +- addressbook/gui/widgets/e-minicard.h | 10 ++++++---- 8 files changed, 28 insertions(+), 10 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 0992290196..5ee4ba0c17 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,18 @@ +2001-06-11 Christopher James Lahey + + * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h: + Made e_card_simple_get_id return const char *. + + * backend/ebook/e-card.c, backend/ebook/e-card.h: Made + e_card_get_id return const char *. + + * gui/component/e-cardlist-model.c (e_cardlist_model_add): Made id + variable const here. Added a break to make it slightly more + efficient. + + * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h: Made + e_minicard_get_card_id return const char *. + 2001-06-11 Christopher James Lahey * backend/pas/pas-backend-file.c (entry_compare): Made this handle diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c index ed10a56685..9eda02e484 100644 --- a/addressbook/backend/ebook/e-card-simple.c +++ b/addressbook/backend/ebook/e-card-simple.c @@ -253,7 +253,7 @@ ECardSimple *e_card_simple_duplicate(ECardSimple *simple) * Returns: a string representing the id of the simple, which is unique * within its book. */ -char * +const char * e_card_simple_get_id (ECardSimple *simple) { if (simple->card) diff --git a/addressbook/backend/ebook/e-card-simple.h b/addressbook/backend/ebook/e-card-simple.h index 899964fd24..24441df172 100644 --- a/addressbook/backend/ebook/e-card-simple.h +++ b/addressbook/backend/ebook/e-card-simple.h @@ -148,7 +148,7 @@ struct _ECardSimpleClass { typedef void (*ECardSimpleArbitraryCallback) (const ECardArbitrary *arbitrary, gpointer closure); ECardSimple *e_card_simple_new (ECard *card); -char *e_card_simple_get_id (ECardSimple *simple); +const char *e_card_simple_get_id (ECardSimple *simple); void e_card_simple_set_id (ECardSimple *simple, const gchar *character); char *e_card_simple_get_vcard (ECardSimple *simple); diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index 59fa211d39..50dc348059 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -222,7 +222,7 @@ ECard *e_card_duplicate(ECard *card) * Returns: a string representing the id of the card, which is unique * within its book. */ -char * +const char * e_card_get_id (ECard *card) { return card->id; diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h index ae0ab3c1ef..667fbdc89c 100644 --- a/addressbook/backend/ebook/e-card.h +++ b/addressbook/backend/ebook/e-card.h @@ -107,7 +107,7 @@ struct _ECardClass { /* Simple functions */ ECard *e_card_new (char *vcard); -char *e_card_get_id (ECard *card); +const char *e_card_get_id (ECard *card); void e_card_set_id (ECard *card, const char *character); diff --git a/addressbook/gui/component/e-cardlist-model.c b/addressbook/gui/component/e-cardlist-model.c index 007aa395d9..9c5ca84379 100644 --- a/addressbook/gui/component/e-cardlist-model.c +++ b/addressbook/gui/component/e-cardlist-model.c @@ -121,10 +121,11 @@ e_cardlist_model_add(ECardlistModel *model, model->data = g_realloc(model->data, model->data_count + count * sizeof(ECard *)); for (i = 0; i < count; i++) { gboolean found = FALSE; - gchar *id = e_card_get_id(cards[i]); + const gchar *id = e_card_get_id(cards[i]); for ( i = 0; i < model->data_count; i++) { if ( !strcmp(e_card_simple_get_id(model->data[i]), id) ) { found = TRUE; + break; } } if (!found) { diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index cf93f52423..1627dd722a 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -802,7 +802,7 @@ e_minicard_reflow( GnomeCanvasItem *item, int flags ) } } -char * +const char * e_minicard_get_card_id (EMinicard *minicard) { g_return_val_if_fail(minicard != NULL, NULL); diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h index 3480d9d071..ec78e24be2 100644 --- a/addressbook/gui/widgets/e-minicard.h +++ b/addressbook/gui/widgets/e-minicard.h @@ -101,11 +101,13 @@ struct _EMinicardClass }; -GtkType e_minicard_get_type (void); -char *e_minicard_get_card_id (EMinicard *minicard); -int e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2); +GtkType e_minicard_get_type (void); +const char *e_minicard_get_card_id (EMinicard *minicard); +int e_minicard_compare (EMinicard *minicard1, + EMinicard *minicard2); -int e_minicard_selected (EMinicard *minicard, GdkEvent *event); +int e_minicard_selected (EMinicard *minicard, + GdkEvent *event); #ifdef __cplusplus } -- cgit v1.2.3