diff options
author | Jon Trowbridge <trow@src.gnome.org> | 2001-07-07 14:39:30 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-07-07 14:39:30 +0800 |
commit | f9e0870bb8f2cee522b1d74d8d430cd898a420e5 (patch) | |
tree | afe1ea372bafca21d8f328fd861305919fcc97a0 /addressbook/gui/component/select-names/e-select-names-model.c | |
parent | da9c4d10641eed27263f12c7415100348991ef32 (diff) | |
download | gsoc2013-evolution-f9e0870bb8f2cee522b1d74d8d430cd898a420e5.tar.gz gsoc2013-evolution-f9e0870bb8f2cee522b1d74d8d430cd898a420e5.tar.zst gsoc2013-evolution-f9e0870bb8f2cee522b1d74d8d430cd898a420e5.zip |
CVS is unhappy this evening. My commit keeps dying in the middle.
svn path=/trunk/; revision=10883
Diffstat (limited to 'addressbook/gui/component/select-names/e-select-names-model.c')
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names-model.c | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c index 8c10aa6035..3cdd5913a5 100644 --- a/addressbook/gui/component/select-names/e-select-names-model.c +++ b/addressbook/gui/component/select-names/e-select-names-model.c @@ -212,21 +212,6 @@ e_select_names_model_changed (ESelectNamesModel *model) g_free (model->priv->addr_text); model->priv->addr_text = NULL; -#if 0 - { - GList *i = model->priv->data; - gint j = 0; - g_print ("ESelectNamesModel state:\n"); - while (i) { - EDestination *dest = (EDestination *) i->data; - g_print ("%d: %s <%s>\n", j, e_destination_get_string (dest), e_destination_get_email (dest)); - i = g_list_next (i); - ++j; - } - g_print ("\n"); - } -#endif - gtk_signal_emit (GTK_OBJECT(model), e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED]); } @@ -276,9 +261,7 @@ e_select_names_model_get_textification (ESelectNamesModel *model) while (iter) { EDestination *dest = E_DESTINATION (iter->data); - strv[i] = (gchar *) e_destination_get_string (dest); - if (strv[i] == NULL) - strv[i] = ""; + strv[i] = (gchar *) e_destination_get_textrep (dest); ++i; iter = g_list_next (iter); } @@ -311,7 +294,7 @@ e_select_names_model_get_address_text (ESelectNamesModel *model) while (iter) { EDestination *dest = E_DESTINATION (iter->data); - strv[i] = (gchar *) e_destination_get_email_verbose (dest); + strv[i] = (gchar *) e_destination_get_address (dest); if (strv[i]) ++i; iter = g_list_next (iter); @@ -421,7 +404,7 @@ e_select_names_model_get_string (ESelectNamesModel *model, gint index) dest = e_select_names_model_get_destination (model, index); - return dest ? e_destination_get_string (dest) : ""; + return dest ? e_destination_get_textrep (dest) : ""; } void @@ -458,6 +441,7 @@ void e_select_names_model_replace (ESelectNamesModel *model, gint index, EDestination *dest) { GList *node; + const gchar *new_str, *old_str; gint old_strlen=0, new_strlen=0; g_return_if_fail (model != NULL); @@ -465,7 +449,8 @@ e_select_names_model_replace (ESelectNamesModel *model, gint index, EDestination g_return_if_fail (model->priv->data == NULL || (0 <= index && index < g_list_length (model->priv->data))); g_return_if_fail (dest && E_IS_DESTINATION (dest)); - new_strlen = e_destination_get_strlen (dest); + new_str = e_destination_get_textrep (dest); + new_strlen = new_str ? strlen (new_str) : 0; if (model->priv->data == NULL) { @@ -478,7 +463,9 @@ e_select_names_model_replace (ESelectNamesModel *model, gint index, EDestination node = g_list_nth (model->priv->data, index); if (node->data != dest) { - old_strlen = e_destination_get_strlen (E_DESTINATION (node->data)); + + old_str = e_destination_get_textrep (E_DESTINATION (node->data)); + old_strlen = old_str ? strlen (old_str) : 0; gtk_object_unref (GTK_OBJECT (node->data)); @@ -560,6 +547,7 @@ e_select_names_model_name_pos (ESelectNamesModel *model, gint index, gint *pos, { gint rp = 0, i, len = 0; GList *iter; + const gchar *str; g_return_if_fail (model != NULL); g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model)); @@ -568,7 +556,8 @@ e_select_names_model_name_pos (ESelectNamesModel *model, gint index, gint *pos, iter = model->priv->data; while (iter && i <= index) { rp += len + (i > 0 ? SEPLEN : 0); - len = e_destination_get_strlen (E_DESTINATION (iter->data)); + str = e_destination_get_textrep (E_DESTINATION (iter->data)); + len = str ? strlen (str) : 0; ++i; iter = g_list_next (iter); } @@ -588,6 +577,7 @@ void e_select_names_model_text_pos (ESelectNamesModel *model, gint pos, gint *index, gint *start_pos, gint *length) { GList *iter; + const gchar *str; gint len = 0, i = 0, sp = 0, adj = 0; g_return_if_fail (model != NULL); @@ -596,16 +586,10 @@ e_select_names_model_text_pos (ESelectNamesModel *model, gint pos, gint *index, iter = model->priv->data; while (iter != NULL) { - len = e_destination_get_strlen (E_DESTINATION (iter->data)); - -#if 0 - g_print ("text_pos: %d %d %d %d\n", len, sp, pos, adj); -#endif + str = e_destination_get_textrep (E_DESTINATION (iter->data)); + len = str ? strlen (str) : 0; if (sp <= pos && pos <= sp + len + adj) { -#if 0 - g_print ("breaking\n"); -#endif break; } |