]> git.sesse.net Git - vlc/commit
config: do not save unknown sections
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 19 Jul 2012 13:35:19 +0000 (16:35 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 19 Jul 2012 13:35:19 +0000 (16:35 +0300)
commit029b9faea76f1bb761a716a4155315f2a0e9e8ab
tree0dd322c809a5d9f6ba7a6effb298b3148e348703
parent35ac8d12b578c149c732284f3c569ce139da1871
config: do not save unknown sections

Unknown sections are sections whose name does not match any module in
the module bank. Until now, any unknown section in vlcrc was copied
verbatim when the preferences are saved. In principles, that would
preserve settings for modules that are not available in the current
copy of VLC.

There is a fatal flaw with that approach: When VLC is updated, some
modules may change name. Also some configuration items may be moved
from one module to another. As a consequence, configuration items may
end up in a different section than they previously were. Then vlcrc
will end up with multiple conflicting copies of the same configuration
item: first the current value for the preferences in the new
section, then the old value from the copied old section. When vlcrc is
loaded again, the old copy will override the new one since it is parsed
last. Essentially, the configuration item cannot be changed via
preferences until vlcrc is manually edited or preferences are reset.

I would rather loose settings for old plugins.
src/config/file.c