source_dir = e_source_peek_relative_uri (source);
if (!source_dir || !g_str_equal (source_dir, "system"))
- source_dir = e_source_peek_uid (source);
+ source_dir = e_source_get_uid (source);
/* Mangle the URI to not contain invalid characters. */
mangled_source_dir = g_strdelimit (g_strdup (source_dir), ":/", '_');
res = e_source_list_sync (source_list, error);
else
g_set_error (error, E_CLIENT_ERROR, E_CLIENT_ERROR_INVALID_ARG,
- _("There was no source for UID '%s' stored in a source list."), e_source_peek_uid (source));
+ _("There was no source for UID '%s' stored in a source list."), e_source_get_uid (source));
g_object_unref (source_list);
g_return_val_if_fail (E_IS_SOURCE (source), FALSE);
- uid = e_source_peek_uid (source);
+ uid = e_source_get_uid (source);
if (!e_book_get_addressbooks (&sources, &err)) {
if (error)
g_return_if_fail (book && E_IS_BOOK (book));
source = e_book_get_source (book);
- uid = e_source_peek_uid (source);
+ uid = e_source_get_uid (source);
g_return_if_fail (uid != NULL);
if (!dest->priv->source_uid || strcmp (uid, dest->priv->source_uid)) {
g_return_if_fail (client && E_IS_BOOK_CLIENT (client));
source = e_client_get_source (E_CLIENT (client));
- uid = e_source_peek_uid (source);
+ uid = e_source_get_uid (source);
g_return_if_fail (uid != NULL);
if (!dest->priv->source_uid || strcmp (uid, dest->priv->source_uid)) {
source = e_client_get_source (client);
- source_uid = e_source_peek_uid (source);
+ source_uid = e_source_get_uid (source);
g_return_val_if_fail (source_uid != NULL, FALSE);
use_credentials = g_hash_table_lookup (cbc->priv->credentials, source_uid);
reason = e_credentials_get (credentials, E_CREDENTIALS_KEY_PROMPT_REASON);
username_markup = g_markup_printf_escaped ("<b>%s</b>", e_credentials_peek (credentials, E_CREDENTIALS_KEY_USERNAME));
- source_name_markup = g_markup_printf_escaped ("<b>%s</b>", e_source_peek_name (source));
+ source_name_markup = g_markup_printf_escaped ("<b>%s</b>", e_source_get_display_name (source));
if (reason && *reason)
prompt = g_strdup_printf (_("Enter password for address book %s (user %s)\nReason: %s"), source_name_markup, username_markup, reason);
}
e_credentials_set (credentials, E_CREDENTIALS_KEY_FOREIGN_REQUEST, "1");
- e_credentials_set (credentials, CBC_CREDENTIALS_KEY_SOURCE_UID, e_source_peek_uid (source));
+ e_credentials_set (credentials, CBC_CREDENTIALS_KEY_SOURCE_UID, e_source_get_uid (source));
/* this is a reprompt, set proper flags */
if (use_credentials) {
g_signal_handlers_disconnect_by_func (book_client, G_CALLBACK (book_client_opened_cb), cbc);
source = e_client_get_source (E_CLIENT (book_client));
- source_uid = e_source_peek_uid (source);
+ source_uid = e_source_get_uid (source);
g_return_if_fail (source_uid != NULL);
if (source_uid) {
e_book_query_unref (query);
if (!e_book_client_get_view_sync (book_client, query_sexp, &book_view, NULL, &error))
- g_warning ("%s: Failed to get book view on '%s': %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
+ g_warning ("%s: Failed to get book view on '%s': %s", G_STRFUNC, e_source_get_display_name (source), error ? error->message : "Unknown error");
g_free (query_sexp);
g_clear_error (&error);
ESource *source)
{
BookRecord *br = book_record_new (cbc, source);
- const gchar *uid = e_source_peek_uid (source);
+ const gchar *uid = e_source_get_uid (source);
if (!br)
return;
gpointer user_data)
{
ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
- const gchar *uid = e_source_peek_uid (source);
+ const gchar *uid = e_source_get_uid (source);
g_return_if_fail (cbc);
if (!source)
continue;
- uid = e_source_peek_uid (source);
+ uid = e_source_get_uid (source);
if (!uid)
continue;
/* Unload all address books from this group */
for (i = e_source_group_peek_sources (group); i; i = i->next) {
ESource *source = E_SOURCE (i->data);
- const gchar *uid = e_source_peek_uid (source);
+ const gchar *uid = e_source_get_uid (source);
g_hash_table_remove (cbc->priv->addressbooks, uid);
g_hash_table_remove (cbc->priv->credentials, uid);
source_dir = e_source_peek_relative_uri (source);
if (!source_dir || !g_str_equal (source_dir, "system"))
- source_dir = e_source_peek_uid (source);
+ source_dir = e_source_get_uid (source);
/* Mangle the URI to not contain invalid characters. */
mangled_source_dir = g_strdelimit (g_strdup (source_dir), ":/", '_');
res = e_source_list_sync (source_list, error);
else
g_set_error (error, E_CLIENT_ERROR, E_CLIENT_ERROR_INVALID_ARG,
- _("There was no source for UID '%s' stored in a source list."), e_source_peek_uid (source));
+ _("There was no source for UID '%s' stored in a source list."), e_source_get_uid (source));
g_object_unref (source_list);
}
prompt = g_strdup_printf (_("Enter password for %s (user %s)"),
- e_source_peek_name (priv->source), username);
+ e_source_get_display_name (priv->source), username);
auth_type = e_source_get_duped_property (priv->source, "auth-type");
if (auth_type)
* This password prompt will be prompted rarely. Since the key that is passed to
* the auth_func corresponds to the parent user.
*/
- prompt = g_strdup_printf (_("Enter password for %s to enable proxy for user %s"), e_source_peek_name (priv->source), parent_user);
+ prompt = g_strdup_printf (_("Enter password for %s to enable proxy for user %s"), e_source_get_display_name (priv->source), parent_user);
g_free (parent_user);
} else
key = g_strdup (e_cal_get_uri (cal));
GError *err = NULL;
GSList *g;
- uid = e_source_peek_uid (source);
+ uid = e_source_get_uid (source);
/* make sure the source is actually in the ESourceList. if
* it's not we don't bother adding it, just return an error */
e_source_set_color_spec
e_source_set_readonly
e_source_peek_group
-e_source_peek_uid
-e_source_peek_name
+e_source_get_uid
+e_source_get_display_name
e_source_peek_relative_uri
e_source_peek_absolute_uri
e_source_peek_color_spec
e_source_build_absolute_uri
e_source_equal
e_source_xmlstr_equal
+e_source_peek_uid
+e_source_peek_name
<SUBSECTION Standard>
E_SOURCE
E_IS_SOURCE
g_return_val_if_fail (hash_key != NULL, NULL);
g_return_val_if_fail (E_IS_SOURCE (source), NULL);
- uid = e_source_peek_uid (source);
+ uid = e_source_get_uid (source);
g_return_val_if_fail (uid != NULL, NULL);
g_mutex_lock (data_factory->priv->mutex);
g_return_val_if_fail (source != NULL, FALSE);
g_return_val_if_fail (E_IS_SOURCE (source), FALSE);
- uid = e_source_peek_uid (source);
+ uid = e_source_get_uid (source);
/* make sure the source is actually in the ESourceList. If
* it's not we don't bother adding it, just return an error */
GSList *p;
for (p = group->priv->sources; p != NULL; p = p->next) {
- if (strcmp (e_source_peek_uid (E_SOURCE (p->data)), uid) == 0)
+ if (strcmp (e_source_get_uid (E_SOURCE (p->data)), uid) == 0)
return E_SOURCE (p->data);
}
GSList *p;
for (p = group->priv->sources; p != NULL; p = p->next) {
- if (strcmp (e_source_peek_name (E_SOURCE (p->data)), name) == 0)
+ if (strcmp (e_source_get_display_name (E_SOURCE (p->data)), name) == 0)
return E_SOURCE (p->data);
}
if (group->priv->readonly)
return FALSE;
- if (e_source_group_peek_source_by_uid (group, e_source_peek_uid (source)) != NULL)
+ if (e_source_group_peek_source_by_uid (group, e_source_get_uid (source)) != NULL)
return FALSE;
e_source_set_group (source, group);
for (p = group->priv->sources; p != NULL; p = p->next) {
ESource *source = E_SOURCE (p->data);
- if (strcmp (e_source_peek_uid (source), uid) == 0) {
+ if (strcmp (e_source_get_uid (source), uid) == 0) {
group->priv->sources = g_slist_remove_link (group->priv->sources, p);
g_signal_handlers_disconnect_by_func (source,
G_CALLBACK (source_changed_callback),
find_esource_from_uid (gconstpointer a,
gconstpointer b)
{
- return g_ascii_strcasecmp (e_source_peek_uid ((ESource *)(a)), (gchar *)(b));
+ return g_ascii_strcasecmp (e_source_get_uid ((ESource *)(a)), (gchar *)(b));
}
static gboolean
return FALSE;
for (l = a; l != NULL && retval; l = l->next) {
- GSList *elem = g_slist_find_custom (b, e_source_peek_uid ((ESource *)(l->data)), (GCompareFunc) find_esource_from_uid);
+ GSList *elem = g_slist_find_custom (b, e_source_get_uid ((ESource *)(l->data)), (GCompareFunc) find_esource_from_uid);
if (!elem || !e_source_equal ((ESource *)(l->data), (ESource *)(elem->data)))
retval = FALSE;
}
/**
- * e_source_peek_uid:
+ * e_source_get_uid:
* @source: an #ESource
*
* Returns the unique identifier string for @source.
* Returns: the source's unique ID
**/
const gchar *
-e_source_peek_uid (ESource *source)
+e_source_get_uid (ESource *source)
{
g_return_val_if_fail (E_IS_SOURCE (source), NULL);
}
/**
- * e_source_peek_name:
+ * e_source_get_display_name:
* @source: an #ESource
*
* Returns the display name for @source.
* Returns: the source's display name
**/
const gchar *
-e_source_peek_name (ESource *source)
+e_source_get_display_name (ESource *source)
{
g_return_val_if_fail (E_IS_SOURCE (source), NULL);
else
node = xmlNewNode (NULL, (xmlChar *)"source");
- xmlSetProp (node, (xmlChar *)"uid", (xmlChar *)e_source_peek_uid (source));
- xmlSetProp (node, (xmlChar *)"name", (xmlChar *)e_source_peek_name (source));
+ xmlSetProp (node, (xmlChar *)"uid", (xmlChar *)e_source_get_uid (source));
+ xmlSetProp (node, (xmlChar *)"name", (xmlChar *)e_source_get_display_name (source));
abs_uri = e_source_peek_absolute_uri (source);
/* do not store absolute uris for local:system sources */
relative_uri = e_source_peek_relative_uri (source);
g_return_val_if_fail (E_IS_SOURCE (source), NULL);
new_source = g_object_new (E_TYPE_SOURCE, NULL);
- new_source->priv->uid = g_strdup (e_source_peek_uid (source));
+ new_source->priv->uid = g_strdup (e_source_get_uid (source));
- e_source_set_name (new_source, e_source_peek_name (source));
+ e_source_set_name (new_source, e_source_get_display_name (source));
new_source->priv->color_spec =
g_strdup (source->priv->color_spec);
gboolean readonly);
struct _ESourceGroup *
e_source_peek_group (ESource *source);
-const gchar * e_source_peek_uid (ESource *source);
-const gchar * e_source_peek_name (ESource *source);
+const gchar * e_source_get_uid (ESource *source);
+const gchar * e_source_get_display_name (ESource *source);
const gchar * e_source_peek_relative_uri (ESource *source);
const gchar * e_source_peek_absolute_uri (ESource *source);
const gchar * e_source_peek_color_spec (ESource *source);
gboolean e_source_xmlstr_equal (const gchar *a,
const gchar *b);
+#ifndef EDS_DISABLE_DEPRECATED
+#define e_source_peek_uid e_source_get_uid
+#define e_source_peek_name e_source_get_display_name
+#endif /* EDS_DISABLE_DEPRECATED */
+
G_END_DECLS
#endif /* E_SOURCE_H */
}
password_prompt = g_strdup_printf (_("Enter password for %s (user %s)"),
- e_source_peek_name (source), user);
+ e_source_get_display_name (source), user);
prompt = g_strconcat (failed_auth, password_prompt, NULL);
g_free (password_prompt);
g_string_append_printf (
string, _("Enter password for %s (user %s)"),
- e_source_peek_name (source), context->auth_username);
+ e_source_get_display_name (source), context->auth_username);
/* XXX Dialog windows should not have titles. */
title = "";
reason = e_credentials_get (credentials, E_CREDENTIALS_KEY_PROMPT_REASON);
username_markup = g_markup_printf_escaped ("<b>%s</b>", e_credentials_peek (credentials, E_CREDENTIALS_KEY_USERNAME));
- source_name_markup = g_markup_printf_escaped ("<b>%s</b>", e_source_peek_name (source));
+ source_name_markup = g_markup_printf_escaped ("<b>%s</b>", e_source_get_display_name (source));
if (is_cal) {
switch (e_cal_client_get_source_type (E_CAL_CLIENT (client))) {
if (!source)
continue;
- if (g_strcmp0 (source_uid, e_source_peek_uid (source)) == 0)
+ if (g_strcmp0 (source_uid, e_source_get_uid (source)) == 0)
return client;
}
}
&& !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning (
"ENameSelector: Could not load \"%s\": %s",
- e_source_peek_name (source), error->message);
+ e_source_get_display_name (source), error->message);
g_error_free (error);
goto exit;
}
g_return_val_if_fail (E_IS_SOURCE (source_a), -1);
g_return_val_if_fail (E_IS_SOURCE (source_b), 1);
- name_a = e_source_peek_name (source_a);
- name_b = e_source_peek_name (source_b);
+ name_a = e_source_get_display_name (source_a);
+ name_b = e_source_get_display_name (source_b);
return g_utf8_collate (name_a, name_b);
}
const gchar *color_spec;
GdkColor color;
- name = e_source_peek_name (s->data);
+ name = e_source_get_display_name (s->data);
indented_name = g_strconcat (" ", name, NULL);
color_spec = e_source_peek_color_spec (s->data);
COLUMN_SOURCE, s->data,
-1);
- uid = e_source_peek_uid (s->data);
+ uid = e_source_get_uid (s->data);
path = gtk_tree_model_get_path (model, &iter);
g_hash_table_replace (
priv->uid_index, g_strdup (uid),
g_return_if_fail (E_IS_SOURCE (source));
e_source_combo_box_set_active_uid (
- combo_box, e_source_peek_uid (source));
+ combo_box, e_source_get_uid (source));
}
/**
if (source == NULL)
return NULL;
- return e_source_peek_uid (source);
+ return e_source_get_uid (source);
}
/**
if (except_source != NULL) {
const gchar *except_uid, *selected_uid;
- except_uid = e_source_peek_uid (except_source);
- selected_uid = e_source_peek_uid (priv->selected_source);
+ except_uid = e_source_get_uid (except_source);
+ selected_uid = e_source_get_uid (priv->selected_source);
if (except_uid && selected_uid && g_str_equal (except_uid, selected_uid))
priv->selected_source = NULL;
rebuild_data->deleted_uids = g_slist_append (
rebuild_data->deleted_uids, reference);
} else {
- uid = e_source_peek_uid (E_SOURCE (node));
+ uid = e_source_get_uid (E_SOURCE (node));
if (e_source_list_peek_source_by_uid (source_list, uid)) {
g_hash_table_insert (
g_return_val_if_fail (E_IS_SOURCE (a), -1);
g_return_val_if_fail (E_IS_SOURCE (b), 1);
- name_a = e_source_peek_name (E_SOURCE (a));
- name_b = e_source_peek_name (E_SOURCE (b));
+ name_a = e_source_get_display_name (E_SOURCE (a));
+ name_b = e_source_get_display_name (E_SOURCE (b));
return g_utf8_collate (name_a, name_b);
}
reference = g_hash_table_lookup (
rebuild_data->remaining_uids,
- e_source_peek_uid (source));
+ e_source_get_uid (source));
if (reference == NULL) {
if (selector->priv->select_new) {
gtk_tree_model_get (model, &source_iter, 0, &data, -1);
g_assert (E_IS_SOURCE (data));
- source_name = e_source_peek_name (E_SOURCE (data));
+ source_name = e_source_get_display_name (E_SOURCE (data));
if (source_name && g_str_equal (name, source_name)) {
g_object_unref (data);
source = E_SOURCE (data);
g_object_set (renderer,
- "text", e_source_peek_name (source),
+ "text", e_source_get_display_name (source),
"weight", PANGO_WEIGHT_NORMAL,
"foreground_set", FALSE,
NULL);
else {
g_assert (E_IS_SOURCE (data));
- name = e_source_peek_name (E_SOURCE (data));
+ name = e_source_get_display_name (E_SOURCE (data));
}
if (name)
gtk_tree_path_free (path);
} else {
g_warning (G_STRLOC ": Cannot find source %p (%s) in selector %p",
- (gpointer) source, e_source_peek_name (source),
+ (gpointer) source, e_source_get_display_name (source),
(gpointer) selector);
}
}
g_return_if_fail (source != NULL);
- name = e_source_peek_name (source);
+ name = e_source_get_display_name (source);
if (!name)
name = "Unknown name";
break;
}
- name = e_source_peek_name (source);
+ name = e_source_get_display_name (source);
if (!name)
name = "Unknown name";
gchar *uri = e_source_get_uri (source);
const gchar *color_spec;
- g_print ("\tSource %s\n", e_source_peek_uid (source));
- g_print ("\t\tname: %s\n", e_source_peek_name (source));
+ g_print ("\tSource %s\n", e_source_get_uid (source));
+ g_print ("\t\tname: %s\n", e_source_get_display_name (source));
g_print ("\t\trelative_uri: %s\n", e_source_peek_relative_uri (source));
g_print ("\t\tabsolute_uri: %s\n", uri);
{
static gint count = 0;
- g_print ("** Event: source \"%s\" changed (%d)\n", e_source_peek_name (source), ++count);
+ g_print ("** Event: source \"%s\" changed (%d)\n", e_source_get_display_name (source), ++count);
dump_on_idle ();
}
{
static gint count = 0;
- g_print ("** Event: source \"%s\" added (%d)\n", e_source_peek_name (source), ++count);
+ g_print ("** Event: source \"%s\" added (%d)\n", e_source_get_display_name (source), ++count);
connect_source (source);
dump_on_idle ();
{
static gint count = 0;
- g_print ("** Event: source \"%s\" removed (%d)\n", e_source_peek_name (source), ++count);
+ g_print ("** Event: source \"%s\" removed (%d)\n", e_source_get_display_name (source), ++count);
disconnect_source (source);
dump_on_idle ();
g_return_if_fail (source != NULL);
- name = e_source_peek_name (source);
+ name = e_source_get_display_name (source);
if (!name)
name = "Unknown name";
ESource *source;
source = e_source_combo_box_get_active (combo_box);
- g_print ("source selected: \"%s\"\n", e_source_peek_name (source));
+ g_print ("source selected: \"%s\"\n", e_source_get_display_name (source));
}
static gint
ESource *source = E_SOURCE (p->data);
g_print ("\tSource %s (group %s)\n",
- e_source_peek_name (source),
+ e_source_get_display_name (source),
e_source_group_peek_name (e_source_peek_group (source)));
}
}