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

feat(linux): Allow loading of keyboards with arbitrary language 🏘️ #9735

Merged
merged 4 commits into from
Oct 16, 2023

Conversation

ermshiperete
Copy link
Contributor

@ermshiperete ermshiperete commented Oct 10, 2023

Part of #8598.

User tests will be part of the next PR that implements the necessary changes in keyman-config.

@keymanapp-test-bot skip

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Oct 10, 2023
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Oct 10, 2023

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@keymanapp-test-bot keymanapp-test-bot bot added this to the A17S23 milestone Oct 10, 2023
@ermshiperete ermshiperete force-pushed the feat/linux/8598_arbitrary-lang branch from c4f241e to 2ae4953 Compare October 10, 2023 17:51
Base automatically changed from refactor/linux/simplifyaddkbd to master October 11, 2023 09:06
@ermshiperete ermshiperete force-pushed the feat/linux/8598_arbitrary-lang branch from 2ae4953 to 3ec376f Compare October 11, 2023 09:07
@ermshiperete ermshiperete force-pushed the feat/linux/8598_arbitrary-lang branch from 2d3ca9d to b0dd74c Compare October 12, 2023 16:31
@ermshiperete ermshiperete marked this pull request as ready for review October 12, 2023 17:15
@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-missing User tests have not yet been defined for the PR label Oct 13, 2023
@mcdurdin mcdurdin modified the milestones: A17S23, A17S24 Oct 15, 2023
cust_kbd *kbd_data = (cust_kbd *)data;

g_free(kbd_data->kb_id_with_lang);
g_free(kbd_data->lang->id);
Copy link
Member

Choose a reason for hiding this comment

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

should we null check kbd_data->lang as well for safety?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We always allocate kbd_data->lang immediately after allocating kbd_data, so I don't think there's a need for that. In fact, checking for kbd_data->lang->name is unnecessary as well since g_free will return if the parameter is NULL.

`g_free` will return if the parameter is NULL, so we don't have to
check for that.

See glib [documentation](https://docs.gtk.org/glib/func.free.html).
@ermshiperete ermshiperete merged commit a769456 into master Oct 16, 2023
2 checks passed
@ermshiperete ermshiperete deleted the feat/linux/8598_arbitrary-lang branch October 16, 2023 17:48
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.192-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants