* Fixes NB#86810, fixes NB#86828 do not try to send or save in drafts if there is...
[modest] / src / modest-utils.c
index c2a1e6e..990bd2f 100644 (file)
@@ -504,7 +504,7 @@ modest_list_index (TnyList *list, GObject *object)
 }
 
 guint64 
-modest_folder_available_space (const gchar *maildir_path)
+modest_utils_get_available_space (const gchar *maildir_path)
 {
        gchar *folder;
        gchar *uri_string;
@@ -519,10 +519,10 @@ modest_folder_available_space (const gchar *maildir_path)
 
        if (uri) {
                if (gnome_vfs_get_volume_free_space (uri, &size) != GNOME_VFS_OK)
-                       size = -1;
+                       size = 0;
                gnome_vfs_uri_unref (uri);
        } else {
-               size = -1;
+               size = 0;
        }
 
        return (guint64) size;
@@ -719,3 +719,19 @@ modest_utils_run_sort_dialog (GtkWindow *parent_window,
        on_destroy_dialog (GTK_DIALOG(dialog));
 }
 
+
+gchar *
+modest_images_cache_get_id (const gchar *account, const gchar *uri)
+{
+       GnomeVFSURI *vfs_uri;
+       gchar *result;
+       vfs_uri = gnome_vfs_uri_new (uri);
+       if (vfs_uri == NULL)
+               return NULL;
+       result = g_strdup_printf ("%s__%x", account, gnome_vfs_uri_hash (vfs_uri));
+       gnome_vfs_uri_unref (vfs_uri);
+       return result;
+}