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

registry: Parse “popularity” attribute #406

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

wismill
Copy link
Member

@wismill wismill commented Nov 16, 2023

Previously the attribute “popularity” was completely ignored. It also did not respect the modified DTD, because its default value depends if we are loading an “extras” rules file.

Fixed:

  • Always parse the popularity attribute.
  • Change the DTD to reflect that the default value is implied.

Fixes #278

@wismill wismill added bug Indicates an unexpected problem or unintended behavior registry Indicates a need for improvements or additions to Registry labels Nov 16, 2023
@wismill wismill added this to the 1.7.0 milestone Nov 16, 2023
@wismill wismill marked this pull request as ready for review November 16, 2023 08:47
@wismill wismill requested review from whot and bluetech November 16, 2023 08:47
Copy link
Contributor

@whot whot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side-note: the reason I skipped this in the registry loading is because at the time xkeyboard-config didn't always set it (iirc) and it's somewhat superfluous since xk-c also guarantees that there's no exotic in the default base.xml file, see the test_rules.py there.

A few style nitpicks but this LGTM to me otherwise. The struct config_item change would be nice if you find the time for it.

src/registry.c Outdated Show resolved Hide resolved
src/registry.c Outdated Show resolved Hide resolved
src/registry.c Outdated Show resolved Hide resolved
src/registry.c Outdated Show resolved Hide resolved
test/registry.c Outdated Show resolved Hide resolved
Copy link
Member Author

@wismill wismill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed review comments.

src/registry.c Outdated Show resolved Hide resolved
src/registry.c Outdated Show resolved Hide resolved
src/registry.c Outdated Show resolved Hide resolved
test/registry.c Outdated Show resolved Hide resolved
@wismill wismill force-pushed the registry/popularity branch 3 times, most recently from 4cb6e5f to ee9be77 Compare November 17, 2023 09:12
Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only had a cursory look (I defer to @whot), but LGTM.

Copy link
Contributor

@whot whot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this LGTM!

l->popularity = popularity;
l->description = config.description;
l->brief = config.brief;
l->popularity = config.popularity;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we totally need a g_steal_pointer or copy libei's steal macro for the same effect. would allow us to just use an unconditional cleanup path.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have a look, but let’s do this in another PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave it a try in #407.

Previously the attribute “popularity” was completely ignored. It also
did not respect the modified DTD, because its default value depends if
we are currently parsing an “extras” rules file.

Fixed:
- Always parse the popularity attribute.
- Change the DTD to reflect that the default value is implied.
@wismill wismill force-pushed the registry/popularity branch from ee9be77 to 3189816 Compare November 21, 2023 07:05
@wismill wismill merged commit 7caf57f into xkbcommon:master Nov 21, 2023
4 checks passed
@wismill wismill deleted the registry/popularity branch November 21, 2023 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior registry Indicates a need for improvements or additions to Registry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

registry ignores XML popularity attribute
3 participants