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: add value range to setting schema file #208

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

wdhongtw
Copy link
Contributor

@wdhongtw wdhongtw commented Jul 2, 2024

Adding choices / value range to all string / integer type settings.

This change can allow users to do config through GSetting interface
directly, while prevent users from broken settings by themselves.

Example usage:

image

@@ -59,19 +86,32 @@
</description>
</key>
<key name="max-chi-symbol-len" type="i">
<range min="11" max="33"/>
Copy link
Member

Choose a reason for hiding this comment

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

Test failed because in the test we set max-chi-symbol-len to 8.

This value actually can be between 0 and 39. Can you update here and src/IBusChewingProperties.c to accept the wider range?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no problem!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it's intended that we give smaller value range for user from GUI setting widget? :D

Copy link
Member

Choose a reason for hiding this comment

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

I guess so. It works at smaller length but might become inconvenient. Phrases longer than 3x used to trigger O(n^2) pathological case so I guess that's why the default were 11 and 33.

@wdhongtw wdhongtw marked this pull request as draft July 2, 2024 12:09
This change can allow users to do config through GSetting interface
directly, while prevent users from broken settings by themselves.
Increase the value range according the actual behavior by libchewing.
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.13%. Comparing base (d4d6e18) to head (3bc70f9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #208   +/-   ##
=======================================
  Coverage   60.13%   60.13%           
=======================================
  Files          24       24           
  Lines        2757     2757           
=======================================
  Hits         1658     1658           
  Misses       1099     1099           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wdhongtw wdhongtw marked this pull request as ready for review July 2, 2024 12:26
@kanru kanru merged commit d0dffe2 into chewing:master Jul 2, 2024
5 checks passed
@kanru kanru added this to the 2.1.0 milestone Jul 2, 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