Commit f2f461b3 authored by Johannes Schmid's avatar Johannes Schmid

project-wizard: Don't use name, email and homedir preferences

Instead we use what glib provides but we still have to find a way for the correct email
(libfolks might work but is an additional dependency)
parent 41a36094
......@@ -1112,33 +1112,17 @@ npw_druid_add_default_property (NPWDruid* druid)
/* Add default base project directory */
value = npw_value_heap_find_value (druid->values, ANJUTA_PROJECT_DIRECTORY_PROPERTY);
s = anjuta_preferences_get (pref, "project_directory");
npw_value_set_value (value, s == NULL ? "~" : s, NPW_VALID_VALUE);
g_free (s);
npw_value_set_value (value, g_get_home_dir (), NPW_VALID_VALUE);
/* Add user name */
value = npw_value_heap_find_value (druid->values, USER_NAME_PROPERTY);
s = anjuta_preferences_get (pref, "user_name");
if (!s || strlen(s) == 0)
{
s = (gchar *)g_get_real_name();
npw_value_set_value (value, s, NPW_VALID_VALUE);
}
else
{
npw_value_set_value (value, s, NPW_VALID_VALUE);
g_free (s);
}
s = (gchar *)g_get_real_name();
npw_value_set_value (value, s, NPW_VALID_VALUE);
/* Add Email address */
value = npw_value_heap_find_value (druid->values, EMAIL_ADDRESS_PROPERTY);
s = anjuta_preferences_get (pref, "user_email");
/* If Email address not defined in Preferences */
if (!s || strlen(s) == 0)
{
if (!(s = getenv("USERNAME")) || strlen(s) == 0)
s = getenv("USER");
s = g_strconcat(s, "@", getenv("HOSTNAME"), NULL);
}
/* FIXME: We need a default way for the mail */
s = g_strconcat(g_get_user_name (), "@", g_get_host_name (), NULL);
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