Fix: Outliner gsoc versioning

Move outliner versioning for syncing and themes to the block
for the next subversion bump. It was not moved from the first
location it was placed in the soc-2019-outliner branch.

Old files will now load with synced selection enabled reliably.
This commit is contained in:
Nathan Craddock 2019-08-17 17:42:00 -06:00
parent e69fb44027
commit e3d90abac7
2 changed files with 8 additions and 16 deletions

View File

@ -3644,19 +3644,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
arm->flag &= ~(ARM_FLAG_UNUSED_6);
}
/* Marks each outliner as dirty so a sync will occur as an outliner draws. */
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
for (SpaceLink *space = sa->spacedata.first; space; space = space->next) {
if (space->spacetype == SPACE_OUTLINER) {
SpaceOutliner *soutliner = (SpaceOutliner *)space;
soutliner->sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_ALL;
soutliner->flag |= SO_SYNC_SELECT;
}
}
}
}
}
if (!MAIN_VERSION_ATLEAST(bmain, 281, 1)) {
@ -3691,6 +3678,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
ar->alignment = RGN_ALIGN_RIGHT;
}
}
/* Mark outliners as dirty for syncing and enable synced selection */
if (sl->spacetype == SPACE_OUTLINER) {
SpaceOutliner *soutliner = (SpaceOutliner *)sl;
soutliner->sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_ALL;
soutliner->flag |= SO_SYNC_SELECT;
}
}
}
}

View File

@ -141,13 +141,12 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
FROM_DEFAULT_V4_UCHAR(space_outliner.row_alternate);
}
FROM_DEFAULT_V4_UCHAR(space_outliner.selected_highlight);
FROM_DEFAULT_V4_UCHAR(space_outliner.active);
/**
* Include next version bump.
*/
{
FROM_DEFAULT_V4_UCHAR(space_outliner.selected_highlight);
FROM_DEFAULT_V4_UCHAR(space_outliner.active);
}
#undef FROM_DEFAULT_V4_UCHAR