FileBrowser: Editable Bookmarks.
[blender-staging.git] / source / blender / blenloader / intern / versioning_270.c
index 4ca1a44d64e6e3b63e9c854fda085cb424517514..572566df6a2e76a1b428cccd321939038a92bb3a 100644 (file)
@@ -51,6 +51,7 @@
 
 #include "BKE_main.h"
 #include "BKE_node.h"
+#include "BKE_screen.h"
 
 #include "BLI_math.h"
 #include "BLI_listbase.h"
@@ -60,6 +61,7 @@
 
 #include "readfile.h"
 
+#include "MEM_guardedalloc.h"
 
 static void do_version_constraints_radians_degrees_270_1(ListBase *lb)
 {
@@ -561,4 +563,32 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                        FOREACH_NODETREE_END
                }
        }
+
+       if (!MAIN_VERSION_ATLEAST(main, 273, 7)) {
+               bScreen *scr;
+               ScrArea *sa;
+               SpaceLink *sl;
+               ARegion *ar;
+
+               for (scr = main->screen.first; scr; scr = scr->id.next) {
+                       /* Remove old deprecated region from filebrowsers */
+                       for (sa = scr->areabase.first; sa; sa = sa->next) {
+                               for (sl = sa->spacedata.first; sl; sl = sl->next) {
+                                       if (sl->spacetype == SPACE_FILE) {
+                                               for (ar = sl->regionbase.first; ar; ar = ar->next) {
+                                                       if (ar->regiontype == RGN_TYPE_CHANNELS) {
+                                                               break;
+                                                       }
+                                               }
+
+                                               if (ar) {
+                                                       /* Free old deprecated 'channel' region... */
+                                                       BKE_area_region_free(NULL, ar);
+                                                       BLI_freelinkN(&sl->regionbase, ar);
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
 }