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

37717 unicode support #54

Merged
merged 5 commits into from
Aug 8, 2016
Merged

37717 unicode support #54

merged 5 commits into from
Aug 8, 2016

Conversation

sgsteph
Copy link
Contributor

@sgsteph sgsteph commented Aug 4, 2016

  • Qt emits strings as unicode, so all Slots now expect unicode values instead of strings and convert them encoded utf-8 strings before using them.
  • Fixed Shot name editing regexp so it works with unicode.
  • Added an example EDL with lot of unicode. Please note that importing this EDL file will fail when trying to upload it in SG because of the special characters in the file name.
  • Fixed group matching for note addressing so group names can contain unicode characters.

Changed all str slots to unicode slots, as this is what is
send by Qt.
Convert unicode strings to utf-8 encoded strings before using them.
Fixed shot name validator so it works with unicode strings.
@raphaelmatto
Copy link
Contributor

Looks good, Stéphane! My main comment is the new uvariable names are a little hard to read. Maybe switch it to vars like:

u_path
u_value
u_new
u_old

... instead of:

upath
uvalue
unew
uold

Besides that, I wanted to make sure you checked the Omit statuses. I.e., if unicode characters are set as sg_status_list statuses on Shots, will they play nice with our pull-down menus? (It looks like you did some work to make sure the notification Groups work).

@manneohrstrom
Copy link

Python hungarian notation lol! >.<

@thebeeland mentioned today that by emitting strings as objects instead of as strings, their stringiness is preserved. Maybe something to try?

@sgsteph
Copy link
Contributor Author

sgsteph commented Aug 8, 2016

@manneohrstrom I think that emitting strings as objects would imply keeping a reference to them around ? By using regular unicode, Qt converts them internally to QString so it is safe to just emit the string and forget about it, which I think wouldn't be the case with PyObject. It has the benefit to be consistent as well: any string coming from Qt is unicode (UI, signal ) and must be converted, so a general rule can be applied.

Renamed uxxxx variables to u_xxxx and avoid re-using slot
params to store converted string, but rather use an additional
variable.
Convert all strings retrieved from widgets to utf-8 encoded strings.
More fixes for group editing in settings dialog which was previously
missed.
@raphaelmatto
Copy link
Contributor

Looks good, no comments, merge at will.

@sgsteph sgsteph merged commit 6493cef into master Aug 8, 2016
sgsteph added a commit that referenced this pull request Aug 8, 2016
Merge branch '37717_unicode_support'
@000paradox000 000paradox000 deleted the 37717_unicode_support branch November 8, 2021 22:18
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.

None yet

3 participants