Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewer Panel contents get carried over from one Project to another #1718

Closed
tmarplatt opened this issue Feb 29, 2024 · 4 comments · Fixed by #1720
Closed

Viewer Panel contents get carried over from one Project to another #1718

tmarplatt opened this issue Feb 29, 2024 · 4 comments · Fixed by #1720
Labels
bug Issue: Something isn't working project management Component: Project or Project Tree
Milestone

Comments

@tmarplatt
Copy link
Contributor

The Problem

After loading novelWriter:

  1. Once you open an existing Project and
  2. open the Viewer Panel, and
  3. select a tab which is showing contents from the current Project, if you leave the Viewer Panel as is and
  4. choose to close the current Project, then
  5. load a different Project with different Viewer Panel contents...

... you will observe that the contents being shown are those belonging to the previously open Project, not the currently open one.

The Expectation

nW should be clearing out the Viewer Panel state on Project close, and should load it with the newly opened Project state instead.

@tmarplatt tmarplatt added the bug Issue: Something isn't working label Feb 29, 2024
@vkbo
Copy link
Owner

vkbo commented Feb 29, 2024

Could you please state which version you are referring to since there are both full and pre-release available?

I could not reproduce the issue as described. I tested with two active projects, and the content reloaded as expected. The only way I could get such an effect was if I loaded a project with no tags at all.

Could you please check if this is what you did as well?

I can see in the code that the clearIndex call is no longer made when a project closes. Probably because novelWriter no longer re-uses the index class between projects. However, the index is in any case rebuilt when a new index is loaded, but not if there is no content loaded, so I think this is the only scenario where you can trigger this bug. It does of course happen when you create a new project, or open a newly created project.

@vkbo vkbo added this to the Release 2.3 milestone Feb 29, 2024
@vkbo vkbo added the project management Component: Project or Project Tree label Feb 29, 2024
vkbo added a commit that referenced this issue Feb 29, 2024
@vkbo
Copy link
Owner

vkbo commented Feb 29, 2024

That was a one line fix, pluss added a regression test. I believe this should solve all scenarios as a general solution, though I couldn't find any other ones than the one I described.

@tmarplatt
Copy link
Contributor Author

Is it possible this was only a Qt5 thing? Given I was seeing tabs otherwise hidden on the Viewer Panel.

FWIW I reproduced it on both 2.2.1 and 2.3rc1.

@vkbo
Copy link
Owner

vkbo commented Mar 1, 2024

Is it possible this was only a Qt5 thing? Given I was seeing tabs otherwise hidden on the Viewer Panel.

No, definitely not,

FWIW I reproduced it on both 2.2.1 and 2.3rc1.

Sure, it turned out to be the same on both those. What I was more curious about was under which conditions it occurred, because for two projects with defined tags, I could not reproduce your issue. The only case where I got the bleed through was when the second project had no tags defined at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue: Something isn't working project management Component: Project or Project Tree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants