return result;
}
-gchar* modest_account_mgr_get_signature (ModestAccountMgr *self, const gchar* name,
- gboolean* use_signature)
+gchar*
+modest_account_mgr_get_signature (ModestAccountMgr *self,
+ const gchar* name,
+ gboolean* use_signature)
{
- if (use_signature) {
- *use_signature =
- modest_account_mgr_get_bool (self, name, MODEST_ACCOUNT_USE_SIGNATURE, FALSE);
- }
+ *use_signature =
+ modest_account_mgr_get_bool (self, name, MODEST_ACCOUNT_USE_SIGNATURE, FALSE);
return modest_account_mgr_get_string (self, name, MODEST_ACCOUNT_SIGNATURE, FALSE);
}
gboolean modest_account_mgr_set_connection_specific_smtp (ModestAccountMgr *self,
- const gchar* connection_name, const gchar* server_account_name)
+ const gchar* connection_id, const gchar* server_account_name)
{
- modest_account_mgr_remove_connection_specific_smtp (self, connection_name);
+ modest_account_mgr_remove_connection_specific_smtp (self, connection_id);
ModestConf *conf = MODEST_ACCOUNT_MGR_GET_PRIVATE (self)->modest_conf;
result = FALSE;
} else {
/* The server account is in the item after the connection name: */
- list = g_slist_append (list, (gpointer)connection_name);
+ list = g_slist_append (list, (gpointer)connection_id);
list = g_slist_append (list, (gpointer)server_account_name);
/* Reset the changed list: */
* modest_account_mgr_remove_connection_specific_smtp
* @self: a ModestAccountMgr instance
* @name: the account name
- * @connection_name: A libconic IAP connection name
+ * @connection_id: A libconic IAP connection id
*
* Disassacoiate a server account to use with the specific connection for this account.
*
* Returns: TRUE if it worked, FALSE otherwise
*/
gboolean modest_account_mgr_remove_connection_specific_smtp (ModestAccountMgr *self,
- const gchar* connection_name)
+ const gchar* connection_id)
{
ModestAccountMgrPrivate *priv = MODEST_ACCOUNT_MGR_GET_PRIVATE (self);
gboolean result = TRUE;
GError *err = NULL;
GSList *list = modest_conf_get_list (priv->modest_conf,
- MODEST_CONF_CONNECTION_SPECIFIC_SMTP_LIST,
- MODEST_CONF_VALUE_STRING, &err);
+ MODEST_CONF_CONNECTION_SPECIFIC_SMTP_LIST,
+ MODEST_CONF_VALUE_STRING, &err);
if (err) {
g_printerr ("modest: %s: error getting list: %s.\n", __FUNCTION__, err->message);
g_error_free (err);
return FALSE;
/* The server account is in the item after the connection name: */
- GSList *list_connection = g_slist_find_custom (list, connection_name, (GCompareFunc)strcmp);
+ GSList *list_connection = g_slist_find_custom (list, connection_id, (GCompareFunc)strcmp);
if (list_connection) {
GSList *account_node = g_slist_next (list_connection);
/* remove both items: */
/**
* modest_account_mgr_get_connection_specific_smtp
* @self: a ModestAccountMgr instance
- * @connection_name: A libconic IAP connection name
+ * @connection_id: A libconic IAP connection id
*
* Retrieve a server account to use with this specific connection for this account.
*
* Returns: a server account name to use for this connection, or NULL if none is specified.
*/
-gchar* modest_account_mgr_get_connection_specific_smtp (ModestAccountMgr *self, const gchar* connection_name)
+gchar* modest_account_mgr_get_connection_specific_smtp (ModestAccountMgr *self, const gchar* connection_id)
{
gchar *result = NULL;
/* The server account is in the item after the connection name: */
GSList *iter = list;
while (iter) {
- const gchar* this_connection_name = (const gchar*)(iter->data);
- if (strcmp (this_connection_name, connection_name) == 0) {
+ const gchar* this_connection_id = (const gchar*)(iter->data);
+ if (strcmp (this_connection_id, connection_id) == 0) {
iter = g_slist_next (iter);
if (iter) {
/*
if (!result) {
- printf (" debug: no server found for connection_name=%s.\n", connection_name);
+ printf (" debug: no server found for connection_id=%s.\n", connection_id);
}
*/
has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_HOSTNAME,
hostname, TRUE);
- has_errors || (has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_USERNAME,
+ if (!has_errors)
+ (has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_USERNAME,
username, TRUE));
- has_errors || (has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_PASSWORD,
+ if (!has_errors)
+ (has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_PASSWORD,
password, TRUE));
- has_errors || (has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_PROTO,
+ if (!has_errors)
+ (has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_PROTO,
protocol, TRUE));
- has_errors || (has_errors = !modest_account_mgr_set_int (self, account_name, MODEST_ACCOUNT_PORT,
+ if (!has_errors)
+ (has_errors = !modest_account_mgr_set_int (self, account_name, MODEST_ACCOUNT_PORT,
port, TRUE));
- has_errors || (has_errors = !modest_account_mgr_set_string (self, account_name,
+ if (!has_errors)
+ (has_errors = !modest_account_mgr_set_string (self, account_name,
MODEST_ACCOUNT_AUTH_MECH,
auth_protocol, TRUE));
- has_errors || (has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_SECURITY,
+ if (!has_errors)
+ (has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_SECURITY,
security,
TRUE));
} else {
const gchar *uri = modest_server_account_settings_get_uri (settings);
has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_URI,
uri, TRUE);
- has_errors || (has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_PROTO,
+ if (!has_errors)
+ (has_errors = !modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_PROTO,
protocol, TRUE));
}
+ if (!has_errors) {
+ modest_account_mgr_set_server_account_username_has_succeeded (self, account_name, FALSE);
+ }
+
return !has_errors;
}