Commit 5800a84a authored by Johannes Schmid's avatar Johannes Schmid

libanjuta/various: Create anjuta_util_get_user_mail()

Have the code to query for the email address centralized. We need to update that to
something that gives us what has been configured in GNOME but for now it just returns
user@host
parent 0ea649f8
......@@ -2430,3 +2430,16 @@ anjuta_util_drop_get_files (GtkSelectionData *selection_data)
return files;
}
/*
* anjuta_util_get_user_mail:
*
* Returns: The e-mail Address of the logged-in user. The resulting string
* must be free'd after use.
*/
gchar*
anjuta_util_get_user_mail()
{
/* FIXME: Use libfolks or something like it to query the mail address */
return g_strconcat(g_get_user_name (), "@", g_get_host_name (), NULL);
}
......@@ -137,6 +137,9 @@ gchar* anjuta_util_get_user_data_file_path (const gchar* path, ...);
gchar* anjuta_util_get_user_cache_file_path (const gchar* path, ...);
gchar* anjuta_util_get_user_config_file_path (const gchar* path, ...);
/* Get the correct e-mail address */
gchar* anjuta_util_get_user_mail(void);
/* Function for converting GFile objects to string paths
* Free the returned list with anjuta_util_glist_strings_free. */
GList *anjuta_util_convert_gfile_list_to_path_list (GList *list);
......
......@@ -459,7 +459,7 @@ iwizard_activate (IAnjutaWizard *wiz, G_GNUC_UNUSED GError **err)
user_name = g_strdup(g_get_real_name ());
/* FIXME: */
user_email = NULL;
user_email = anjuta_util_get_user_mail();
if (user_name != NULL)
cg_window_set_author (cg_plugin->window, user_name);
......
......@@ -1122,7 +1122,7 @@ npw_druid_add_default_property (NPWDruid* druid)
value = npw_value_heap_find_value (druid->values, EMAIL_ADDRESS_PROPERTY);
/* FIXME: We need a default way for the mail */
s = g_strconcat(g_get_user_name (), "@", g_get_host_name (), NULL);
s = anjuta_util_get_user_mail();
npw_value_set_value (value, s, NPW_VALID_VALUE);
g_free (s);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment