diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index c2820ac6e30..11ad960259f 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1143,7 +1143,7 @@ static void write_renderinfo(WriteData *wd, Main *mainvar) } } -static void write_keymapitem(WriteData *wd, wmKeyMapItem *kmi) +static void write_keymapitem(WriteData *wd, const wmKeyMapItem *kmi) { writestruct(wd, DATA, wmKeyMapItem, 1, kmi); if (kmi->properties) { @@ -1151,26 +1151,18 @@ static void write_keymapitem(WriteData *wd, wmKeyMapItem *kmi) } } -static void write_userdef(WriteData *wd) +static void write_userdef(WriteData *wd, const UserDef *userdef) { - bTheme *btheme; - wmKeyMap *keymap; - wmKeyMapItem *kmi; - wmKeyMapDiffItem *kmdi; - bAddon *bext; - bPathCompare *path_cmp; - uiStyle *style; + writestruct(wd, USER, UserDef, 1, userdef); - writestruct(wd, USER, UserDef, 1, &U); - - for (btheme = U.themes.first; btheme; btheme = btheme->next) { + for (const bTheme *btheme = userdef->themes.first; btheme; btheme = btheme->next) { writestruct(wd, DATA, bTheme, 1, btheme); } - for (keymap = U.user_keymaps.first; keymap; keymap = keymap->next) { + for (const wmKeyMap *keymap = userdef->user_keymaps.first; keymap; keymap = keymap->next) { writestruct(wd, DATA, wmKeyMap, 1, keymap); - for (kmdi = keymap->diff_items.first; kmdi; kmdi = kmdi->next) { + for (const wmKeyMapDiffItem *kmdi = keymap->diff_items.first; kmdi; kmdi = kmdi->next) { writestruct(wd, DATA, wmKeyMapDiffItem, 1, kmdi); if (kmdi->remove_item) { write_keymapitem(wd, kmdi->remove_item); @@ -1180,23 +1172,23 @@ static void write_userdef(WriteData *wd) } } - for (kmi = keymap->items.first; kmi; kmi = kmi->next) { + for (const wmKeyMapItem *kmi = keymap->items.first; kmi; kmi = kmi->next) { write_keymapitem(wd, kmi); } } - for (bext = U.addons.first; bext; bext = bext->next) { + for (const bAddon *bext = userdef->addons.first; bext; bext = bext->next) { writestruct(wd, DATA, bAddon, 1, bext); if (bext->prop) { IDP_WriteProperty(bext->prop, wd); } } - for (path_cmp = U.autoexec_paths.first; path_cmp; path_cmp = path_cmp->next) { + for (const bPathCompare *path_cmp = userdef->autoexec_paths.first; path_cmp; path_cmp = path_cmp->next) { writestruct(wd, DATA, bPathCompare, 1, path_cmp); } - for (style = U.uistyles.first; style; style = style->next) { + for (const uiStyle *style = userdef->uistyles.first; style; style = style->next) { writestruct(wd, DATA, uiStyle, 1, style); } } @@ -3963,7 +3955,7 @@ static bool write_file_handle( mywrite_flush(wd); if (write_flags & G_FILE_USERPREFS) { - write_userdef(wd); + write_userdef(wd, &U); } /* Write DNA last, because (to be implemented) test for which structs are written. |