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

Feature/qt6 - Remove usage of Core5Compat library #710

Open
wants to merge 1 commit into
base: feature/qt6
Choose a base branch
from

Conversation

cedrik-fuoco-adsk
Copy link
Contributor

Feature/qt6 - Remove usage of Core5Compat library

Linked issues

n/a

Summarize your change.

I have eliminated all instances of QTextCodec, as this class is no longer supported in Qt 6. Previously, the code relied on the Core5Compat library, which incorporates deprecated and obsolete Qt 5 classes.

Describe what you have tested and on which operating system.

I created a python plugin to execute the httpGet method from the RvWebManager class.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Comment on lines +373 to +382
#if defined(RV_VFX_CY2023)
QTextCodec* codec = QTextCodec::codecForHtml(array);
QString u = codec->toUnicode(array);
#else
// Assume that the data is utf-8 encoded because about 98-99% of
// websites uses utf-8. The second closest is ISO-8859-1
// with 1.1%.
QStringDecoder decoder(QStringDecoder::Utf8);
QString u = decoder.decode(array);
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bernie-laberge @eloisebrosseau Is this a reasonable assumption?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. I believe this is a valid assumption.
In any case, this code path is no longer used by RV anymore. So I think this is good enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

I did a quick search, and I also believe we can make that assumption

Copy link
Contributor

@bernie-laberge bernie-laberge left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +373 to +382
#if defined(RV_VFX_CY2023)
QTextCodec* codec = QTextCodec::codecForHtml(array);
QString u = codec->toUnicode(array);
#else
// Assume that the data is utf-8 encoded because about 98-99% of
// websites uses utf-8. The second closest is ISO-8859-1
// with 1.1%.
QStringDecoder decoder(QStringDecoder::Utf8);
QString u = decoder.decode(array);
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

I did a quick search, and I also believe we can make that assumption

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.

3 participants