2007-05-02 [paul] 2.9.1cvs36
[claws.git] / src / folder.c
index 438743acdec6f62fd9bc4771ccb530617226af5a..b2a17dc22256c13d1a6703dfcbd2cf03d3963542 100644 (file)
@@ -3434,6 +3434,7 @@ static gchar *folder_item_get_cache_file(FolderItem *item)
 {
        gchar *path;
        gchar *file;
+       gchar *old_file;
 
        g_return_val_if_fail(item != NULL, NULL);
        g_return_val_if_fail(item->path != NULL, NULL);
@@ -3443,6 +3444,11 @@ static gchar *folder_item_get_cache_file(FolderItem *item)
        if (!is_dir_exist(path))
                make_dir_hier(path);
        file = g_strconcat(path, G_DIR_SEPARATOR_S, CACHE_FILE, NULL);
+       old_file = g_strconcat(path, G_DIR_SEPARATOR_S, OLD_CACHE_FILE, NULL);
+
+       if (!is_file_exist(file) && is_file_exist(old_file))
+               move_file(old_file, file, FALSE);
+       g_free(old_file);
        g_free(path);
 
        return file;
@@ -3452,6 +3458,7 @@ static gchar *folder_item_get_mark_file(FolderItem *item)
 {
        gchar *path;
        gchar *file;
+       gchar *old_file;
 
        g_return_val_if_fail(item != NULL, NULL);
        g_return_val_if_fail(item->path != NULL, NULL);
@@ -3461,6 +3468,11 @@ static gchar *folder_item_get_mark_file(FolderItem *item)
        if (!is_dir_exist(path))
                make_dir_hier(path);
        file = g_strconcat(path, G_DIR_SEPARATOR_S, MARK_FILE, NULL);
+       old_file = g_strconcat(path, G_DIR_SEPARATOR_S, OLD_MARK_FILE, NULL);
+
+       if (!is_file_exist(file) && is_file_exist(old_file))
+               move_file(old_file, file, FALSE);
+       g_free(old_file);
        g_free(path);
 
        return file;