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

Fix qml warnings, python regular expression deprecated syntax with raw string #19603

Open
wants to merge 3 commits into
base: 5.8
Choose a base branch
from

Conversation

dfries
Copy link

@dfries dfries commented Aug 31, 2024

Description

This fixes:

  • QML incompatible error in RecentFilesMenu.qml
  • QML assign undefined to int in RecommendedSupportSelector.qml
  • python invalid "\d" etc regular expressions

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • For QML, replacing the files from AppImage and verifying those errors were not printed
  • For python code inspection using grep to look for any other instance of \. \d \w that weren't already a raw string

Test Configuration:

  • Operating System: Debian Linux

Checklist:

"share/cura/resources/qml/Menus/RecentFilesMenu.qml:39:
TypeError: Passing incompatible arguments to C++ functions from JavaScript is not allowed."

This was passing the Instantiator index, which is a Number to menu.removeItem
which is expecting an object.  Add the missing index argument.  I
found Qt 5.7 had two arguments so it has been there for some time.
share/cura/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml:60:17:
Unable to assign [undefined] to int

If undefined use Widgets/SingleSettingComboBox.qml
default of Cura.ExtruderManager.activeExtruderIndex
If "T(\d*)" was "T(\n*)" it would search for newlines.  There isn't
any such \d escape character.

It should be "T(\\d*)" or r"T(\d*)" going with the latter, to be
easier to read and be consistent with other Cura usage.

Start python with -Wd or for python 3.12 will raise a SyntaxWarning.
@github-actions github-actions bot added the PR: Community Contribution 👑 Community Contribution PR's label Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Community Contribution 👑 Community Contribution PR's
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant