Skip to content

Author field is not properly updated when switching file #734

@Perdu

Description

@Perdu

(Moving #726 to an issue as the PR actually introduced another bug and I don't know how to solve it properly)

Issue

In a79444, I introduced a change to allow editing the authors field whatever the movie situation is. As the field got reverted to the movie's value upon game start, I introduced this check:

if (authorField->text().toStdString() == "")
    authorField->setText(gameLoop->movie.header->authors.c_str());

As a result, the field was not updated when a movie was loaded and we loaded another one (with different authors).

Attempted fix in #726

Removing this check was not sufficient as the author field kept being reverted back to the movie value. After a lot of debugging, I understood that this was due to Gameloop::init() propagating a configChanged() signal back to the main window, which reloads the movie in updateMovieParams() as a result, reverting any change we make to the field or to gameLoop->movie.header->authors.

I'm not sure why there is any need to reload the movie at that point, since it's already loaded. I chose to remove that whole part of the code and signal, as tests show that it seems to work fine without it. However, this introduced at least one other bug: the rerecord field got reset to 0 on every game start.

Other possible fix?

Another possibility to fix the issue could be to immediately save the movie everytime the authors field is changed, but that does not seem right from a UI perspective (I'm not expecting the movie to be saved if I did not save it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions