aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-04-17 04:28:13 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-04-17 04:28:13 +0800
commita35d86361dbbf29c3b7da3a481c77c6a876ae8f4 (patch)
tree79a784b7f0a5272341c60890ecafe75be47d5b40 /addressbook/backend/ebook
parenta8d2769cabc1889fd35e97d8494b824d06c0cde1 (diff)
downloadgsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar
gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar.gz
gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar.bz2
gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar.lz
gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar.xz
gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.tar.zst
gsoc2013-evolution-a35d86361dbbf29c3b7da3a481c77c6a876ae8f4.zip
Added.
2001-04-16 Jon Trowbridge <trow@ximian.com> * backend/ebook/e-destination.c (e_destination_get_name): Added. * gui/component/select-names/e-select-names.c (real_add_address_cb): Use e_select_names_model_append. It's nicer. * gui/component/select-names/e-select-names-model.c (e_select_names_model_append): Added. * gui/component/select-names/e-select-names-completion.c (book_query_process_card_list): Filter out completion matches that don't have an associated e-mail address. (book_query_score): Give a bonus to the primary address, so that it always comes up first in the completion results. * gui/component/e-address-popup.c (e_address_popup_refresh_names): Convert utf8 strings into gtk strings before displaying. svn path=/trunk/; revision=9390
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r--addressbook/backend/ebook/e-destination.c33
-rw-r--r--addressbook/backend/ebook/e-destination.h2
2 files changed, 31 insertions, 4 deletions
diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c
index a44ce3ddc8..e6fdb3ee43 100644
--- a/addressbook/backend/ebook/e-destination.c
+++ b/addressbook/backend/ebook/e-destination.c
@@ -36,6 +36,7 @@ struct _EDestinationPrivate {
ECard *card;
gint card_email_num;
+ gchar *name;
gchar *string;
gchar *string_email;
gchar *string_email_verbose;
@@ -147,10 +148,12 @@ e_destination_clear_card (EDestination *dest)
static void
e_destination_clear_strings (EDestination *dest)
{
+ g_free (dest->priv->name);
g_free (dest->priv->string);
g_free (dest->priv->string_email);
g_free (dest->priv->string_email_verbose);
+ dest->priv->name = NULL;
dest->priv->string = NULL;
dest->priv->string_email = NULL;
dest->priv->string_email_verbose = NULL;
@@ -245,6 +248,28 @@ e_destination_get_strlen (const EDestination *dest)
}
const gchar *
+e_destination_get_name (const EDestination *dest)
+{
+ struct _EDestinationPrivate *priv;
+ g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
+
+ priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */
+
+ if (priv->name == NULL) {
+
+ if (priv->card) {
+
+ priv->name = e_card_name_to_string (priv->card->name);
+
+ }
+
+ }
+
+ return priv->name;
+
+}
+
+const gchar *
e_destination_get_email (const EDestination *dest)
{
struct _EDestinationPrivate *priv;
@@ -296,10 +321,10 @@ e_destination_get_email_verbose (const EDestination *dest)
const gchar *email = e_destination_get_email (dest);
if (priv->card) {
-
- priv->string_email_verbose = g_strdup_printf ("%s <%s>",
- e_card_name_to_string (priv->card->name),
- email);
+ gchar *n = e_card_name_to_string (priv->card->name);
+ priv->string_email_verbose = g_strdup_printf ("%s <%s>", n, email);
+ g_free (n);
+
} else {
return email;
diff --git a/addressbook/backend/ebook/e-destination.h b/addressbook/backend/ebook/e-destination.h
index d0af6b0d23..3c6de6e316 100644
--- a/addressbook/backend/ebook/e-destination.h
+++ b/addressbook/backend/ebook/e-destination.h
@@ -67,6 +67,8 @@ gint e_destination_get_email_num (const EDestination *);
const gchar *e_destination_get_string (const EDestination *);
gint e_destination_get_strlen (const EDestination *); /* a convenience function... */
+const gchar *e_destination_get_name (const EDestination *);
+
const gchar *e_destination_get_email (const EDestination *);
const gchar *e_destination_get_email_verbose (const EDestination *);