diff options
author | Milan Crha <mcrha@redhat.com> | 2012-02-14 02:22:29 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-02-14 02:23:15 +0800 |
commit | 86e3ff6896aeb036697648ed80e4e9fc099be83a (patch) | |
tree | e42f49d2feb108e0d9b3a97c8d057b2c1c3ee4d0 /mail/e-mail-paned-view.c | |
parent | 61503d3e3431c54d9dbcd03da7c1831af2112c6e (diff) | |
download | gsoc2013-evolution-86e3ff6896aeb036697648ed80e4e9fc099be83a.tar.gz gsoc2013-evolution-86e3ff6896aeb036697648ed80e4e9fc099be83a.tar.zst gsoc2013-evolution-86e3ff6896aeb036697648ed80e4e9fc099be83a.zip |
Bug #669097 - Cannot save column setup: File name too long
Diffstat (limited to 'mail/e-mail-paned-view.c')
-rw-r--r-- | mail/e-mail-paned-view.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index 7a510e3ebd..ea017c758b 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -778,6 +778,32 @@ mail_paned_view_get_view_instance (EMailView *view) return paned_view->priv->view_instance; } +static gchar * +empv_create_view_id (CamelFolder *folder) +{ + GChecksum *checksum; + gchar *res, *folder_uri; + + g_return_val_if_fail (folder != NULL, NULL); + + folder_uri = e_mail_folder_uri_from_folder (folder); + g_return_val_if_fail (folder_uri != NULL, NULL); + + /* to be able to migrate previously saved views */ + e_filename_make_safe (folder_uri); + + /* use MD5 checksum of the folder URI, to not depend on its length */ + checksum = g_checksum_new (G_CHECKSUM_MD5); + g_checksum_update (checksum, (const guchar *) folder_uri, -1); + + res = g_strdup (g_checksum_get_string (checksum)); + + g_checksum_free (checksum); + g_free (folder_uri); + + return res; +} + static void mail_paned_view_update_view_instance (EMailView *view) { @@ -819,7 +845,7 @@ mail_paned_view_update_view_instance (EMailView *view) priv->view_instance = NULL; } - view_id = e_mail_folder_uri_from_folder (folder); + view_id = empv_create_view_id (folder); e_filename_make_safe (view_id); outgoing_folder = |