#define MODEST_MMC_ACCOUNT_ID "mcc"
-/* FIXME: get these from the environment */
/* Without the trailing / because gnome-vfs reports mounted
* volume URIs without the trailing, and we want to match them: */
-#define MODEST_MCC1_VOLUMEPATH "/media/mmc1"
-#define MODEST_MCC1_VOLUMEPATH_URI "file://" MODEST_MCC1_VOLUMEPATH
+#define MODEST_MMC1_VOLUMEPATH_ENV "MMC_MOUNTPOINT"
+#define MODEST_MMC1_VOLUMEPATH_URI_PREFIX "file://"
/* configuration key definitions for modest */
#define MODEST_CONF_NAMESPACE "/apps/modest"
g_return_if_fail (priv->session);
TnyAccount *mmc_account = modest_tny_account_new_for_local_folders (priv->account_mgr,
- priv->session,
- MODEST_MCC1_VOLUMEPATH);
+ priv->session,
+ g_getenv (MODEST_MMC1_VOLUMEPATH_ENV));
/* Add to the list of store accounts */
tny_list_append (priv->store_accounts, G_OBJECT (mmc_account));
{
ModestTnyAccountStore *self;
ModestTnyAccountStorePrivate *priv;
+ gchar *volume_path_uri;
gchar *uri = NULL;
/* Check whether this was the external MMC1 card: */
uri = gnome_vfs_volume_get_activation_uri (volume);
- if (uri && (!strcmp (uri, MODEST_MCC1_VOLUMEPATH_URI))) {
+ volume_path_uri = g_strconcat (MODEST_MMC1_VOLUMEPATH_URI_PREFIX,
+ g_getenv (MODEST_MMC1_VOLUMEPATH_ENV),
+ NULL);
+ if (uri && (!strcmp (uri, volume_path_uri))) {
add_mmc_account (self, TRUE /* emit the insert signal. */);
}
-
+
+ g_free (volume_path_uri);
g_free (uri);
}
ModestTnyAccountStore *self;
ModestTnyAccountStorePrivate *priv;
gchar *uri = NULL;
+ gchar *volume_path_uri;
self = MODEST_TNY_ACCOUNT_STORE(user_data);
priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
/* Check whether this was the external MMC1 card: */
uri = gnome_vfs_volume_get_activation_uri (volume);
- if (uri && (strcmp (uri, MODEST_MCC1_VOLUMEPATH_URI) == 0)) {
+ volume_path_uri = g_strconcat (MODEST_MMC1_VOLUMEPATH_URI_PREFIX,
+ g_getenv (MODEST_MMC1_VOLUMEPATH_ENV),
+ NULL);
+ if (uri && (strcmp (uri, volume_path_uri) == 0)) {
TnyAccount *mmc_account = NULL;
gboolean found = FALSE;
TnyIterator *iter = NULL;
__FUNCTION__);
}
}
+ g_free (volume_path_uri);
g_free (uri);
}
* GnomeVFSVolume even if the drive is not mounted: */
/*
GnomeVFSVolume *volume = gnome_vfs_volume_monitor_get_volume_for_path (monitor,
- MODEST_MCC1_VOLUMEPATH);
+ g_getenv (MODEST_MMC1_VOLUMEPATH_ENV));
if (volume) {
gnome_vfs_volume_unref(volume);
}
add_connection_specific_transport_accounts (MODEST_TNY_ACCOUNT_STORE(obj));
/* This is a singleton, so it does not need to be unrefed. */
- if (volume_path_is_mounted (MODEST_MCC1_VOLUMEPATH)) {
+ if (volume_path_is_mounted (g_getenv (MODEST_MMC1_VOLUMEPATH_ENV))) {
/* It is mounted: */
add_mmc_account (MODEST_TNY_ACCOUNT_STORE (obj), FALSE /* don't emit the insert signal. */);
}
void modest_tny_account_get_mmc_account_name (TnyStoreAccount* self, ModestTnyAccountGetMmcAccountNameCallback callback, gpointer user_data)
{
#ifndef MODEST_TOOLKIT_GTK
- /* Just use the hard-coded path for the single memory card,
+ /* Just use the path for the single memory card,
* rather than try to figure out the path to the specific card by
* looking at the maildir URI:
*/
- const gchar *uri_real = MODEST_MCC1_VOLUMEPATH_URI;
+ gchar *uri_real = g_strconcat (MODEST_MMC1_VOLUMEPATH_URI_PREFIX,
+ g_getenv (MODEST_MMC1_VOLUMEPATH_ENV),
+ NULL);
/*
gchar* uri = tny_account_get_url_string (TNY_ACCOUNT (self));
hildon_file_system_info_async_new(uri_real,
on_modest_file_system_info, callback_data /* user_data */);
- /* g_free (uri_real); */
+ g_free (uri_real);
}
/* g_free (uri); */
* via a derived TnyCamelStoreAccount ? */
const gboolean is_mmc =
location_filepath &&
- (strcmp (location_filepath, MODEST_MCC1_VOLUMEPATH) == 0);
+ (strcmp (location_filepath, g_getenv (MODEST_MMC1_VOLUMEPATH_ENV)) == 0);
/* The name of memory card locations will be updated asynchronously.
* This is just a default: */