* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <modest-protocol-registry.h>
#include <modest-server-account-settings.h>
+#include <strings.h>
+#include <string.h>
/* 'private'/'protected' functions */
static void modest_server_account_settings_class_init (ModestServerAccountSettingsClass *klass);
struct _ModestServerAccountSettingsPrivate {
gchar *hostname;
guint port;
- ModestTransportStoreProtocol protocol;
+ ModestProtocolType protocol;
gchar *username;
gchar *password;
- ModestConnectionProtocol security;
- ModestAuthProtocol auth_protocol;
+ ModestProtocolType security_protocol;
+ ModestProtocolType auth_protocol;
gchar *account_name;
gchar *uri;
};
priv = MODEST_SERVER_ACCOUNT_SETTINGS_GET_PRIVATE (obj);
priv->hostname = NULL;
- priv->protocol = MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN;
+ priv->protocol = MODEST_PROTOCOL_REGISTRY_TYPE_INVALID;
priv->port = 0;
priv->username = NULL;
priv->password = NULL;
- priv->security = MODEST_PROTOCOL_CONNECTION_NORMAL;
- priv->auth_protocol = MODEST_PROTOCOL_AUTH_NONE;
+ priv->security_protocol = MODEST_PROTOCOLS_CONNECTION_NONE;
+ priv->auth_protocol = MODEST_PROTOCOLS_AUTH_NONE;
priv->account_name = NULL;
priv->uri = NULL;
}
priv->hostname = NULL;
g_free (priv->username);
priv->username = NULL;
- g_free (priv->password);
+
+ if (priv->password) {
+ bzero (priv->password, strlen (priv->password));
+ g_free (priv->password);
+ }
priv->password = NULL;
- priv->protocol = MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN;
+
+ priv->protocol = MODEST_PROTOCOL_REGISTRY_TYPE_INVALID;
priv->port = 0;
- priv->security = MODEST_PROTOCOL_CONNECTION_NORMAL;
- priv->auth_protocol = MODEST_PROTOCOL_AUTH_NONE;
+ priv->security_protocol = MODEST_PROTOCOL_REGISTRY_TYPE_INVALID;
+ priv->auth_protocol = MODEST_PROTOCOL_REGISTRY_TYPE_INVALID;
g_free (priv->account_name);
priv->account_name = NULL;
g_free (priv->uri);
g_free (priv->uri);
priv->uri = g_strdup (uri);
- /* we set the protocol to a NULL equivalent value. We should use uri in case
- * protocol has this value. */
- priv->protocol = MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN;
}
const gchar*
g_return_if_fail (MODEST_IS_SERVER_ACCOUNT_SETTINGS (settings));
priv = MODEST_SERVER_ACCOUNT_SETTINGS_GET_PRIVATE (settings);
- g_free (priv->password);
+ if (priv->password) {
+ bzero (priv->password, strlen (priv->password));
+ g_free (priv->password);
+ }
priv->password = g_strdup (password);
}
priv->account_name = g_strdup (account_name);
}
-ModestTransportStoreProtocol
+ModestProtocolType
modest_server_account_settings_get_protocol (ModestServerAccountSettings *settings)
{
ModestServerAccountSettingsPrivate *priv;
- g_return_val_if_fail (MODEST_IS_SERVER_ACCOUNT_SETTINGS (settings), MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN);
+ g_return_val_if_fail (MODEST_IS_SERVER_ACCOUNT_SETTINGS (settings), MODEST_PROTOCOL_REGISTRY_TYPE_INVALID);
priv = MODEST_SERVER_ACCOUNT_SETTINGS_GET_PRIVATE (settings);
return priv->protocol;
void
modest_server_account_settings_set_protocol (ModestServerAccountSettings *settings,
- ModestTransportStoreProtocol protocol)
+ ModestProtocolType protocol)
{
ModestServerAccountSettingsPrivate *priv;
priv = MODEST_SERVER_ACCOUNT_SETTINGS_GET_PRIVATE (settings);
priv->protocol = protocol;
- /* we also set the uri to NULL, as setting a protocol implies disabling uri setting type */
- g_free (priv->uri);
- priv->uri = NULL;
}
guint
priv->port = port;
}
-ModestConnectionProtocol
-modest_server_account_settings_get_security (ModestServerAccountSettings *settings)
+ModestProtocolType
+modest_server_account_settings_get_security_protocol (ModestServerAccountSettings *settings)
{
ModestServerAccountSettingsPrivate *priv;
- g_return_val_if_fail (MODEST_IS_SERVER_ACCOUNT_SETTINGS (settings), MODEST_PROTOCOL_CONNECTION_NORMAL);
+ g_return_val_if_fail (MODEST_IS_SERVER_ACCOUNT_SETTINGS (settings), MODEST_PROTOCOL_REGISTRY_TYPE_INVALID);
priv = MODEST_SERVER_ACCOUNT_SETTINGS_GET_PRIVATE (settings);
- return priv->security;
+ return priv->security_protocol;
}
void
-modest_server_account_settings_set_security (ModestServerAccountSettings *settings,
- ModestConnectionProtocol security)
+modest_server_account_settings_set_security_protocol (ModestServerAccountSettings *settings,
+ ModestProtocolType security_protocol)
{
ModestServerAccountSettingsPrivate *priv;
g_return_if_fail (MODEST_IS_SERVER_ACCOUNT_SETTINGS (settings));
priv = MODEST_SERVER_ACCOUNT_SETTINGS_GET_PRIVATE (settings);
- priv->security = security;
+ priv->security_protocol = security_protocol;
}
-ModestAuthProtocol
+ModestProtocolType
modest_server_account_settings_get_auth_protocol (ModestServerAccountSettings *settings)
{
ModestServerAccountSettingsPrivate *priv;
- g_return_val_if_fail (MODEST_IS_SERVER_ACCOUNT_SETTINGS (settings), MODEST_PROTOCOL_AUTH_NONE);
+ g_return_val_if_fail (MODEST_IS_SERVER_ACCOUNT_SETTINGS (settings), MODEST_PROTOCOL_REGISTRY_TYPE_INVALID);
priv = MODEST_SERVER_ACCOUNT_SETTINGS_GET_PRIVATE (settings);
return priv->auth_protocol;
void
modest_server_account_settings_set_auth_protocol (ModestServerAccountSettings *settings,
- ModestAuthProtocol auth_protocol)
+ ModestProtocolType auth_protocol)
{
ModestServerAccountSettingsPrivate *priv;