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

fix: fix crash when we create a new rc file (language is empty => assert) #203

Closed
wants to merge 2 commits into from

Conversation

Montel
Copy link
Contributor

@Montel Montel commented Oct 24, 2024

No description provided.

@Montel Montel requested a review from narnaud October 24, 2024 12:51
@narnaud
Copy link
Member

narnaud commented Oct 24, 2024

What's the use case for that?

Anyway, there are 2 commits in this PR, completely independent, and it would be nice to have a unit tests if it's fixing a crash.

@Montel
Copy link
Contributor Author

Montel commented Oct 25, 2024

The crash arrived when we use "palette"
for example you want to search file foo.rc, palette will show "Foo.rc" => not the same case
=> when we press enter we will not find it => it will create a foo.rc file.

=> when it will create it (an empty file) => in constructor we use "Q_ASSERT(m_rcFile.data.contains(m_language));"

=> but empty file can't have a m_language !

=> it will assert by default.

We can't really create an autotest for it.

@narnaud
Copy link
Member

narnaud commented Oct 28, 2024

Ok, so the problem is not really the rc file, but the fact that the palette is not working as expected.
I can't really test that on Windows, but it would be better to fix the palette than this.

Note: still 2 independant commits in the same PR

@Montel
Copy link
Contributor Author

Montel commented Oct 29, 2024

It depends if you want to be able to create a new file from palette => it works as expected.
If you don't want to create new file, indeed it's a bug in palette.
So for you palette mustn't create new file ?

@narnaud
Copy link
Member

narnaud commented Oct 29, 2024

No, the palette should never create a new file, just open an existing file in the project.

@Montel
Copy link
Contributor Author

Montel commented Oct 29, 2024

ok so indeed a bug . I will fix it :)
Thanks

@Montel
Copy link
Contributor Author

Montel commented Oct 29, 2024

fixed in #213

@Montel Montel closed this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants