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

[cleanup] Limit number of hardcoded strings for layer type by leveraging QgsMapLayerFactory::typeToString() #60360

Merged
merged 2 commits into from
Feb 2, 2025

Conversation

rouault
Copy link
Contributor

@rouault rouault commented Jan 30, 2025

No description provided.

@github-actions github-actions bot added this to the 3.42.0 milestone Jan 30, 2025
Copy link

github-actions bot commented Jan 30, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 896e212)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 896e212)

@rouault
Copy link
Contributor Author

rouault commented Jan 30, 2025

to knowleadgable devs, so we have a test failure

  File "/root/QGIS/tests/src/python/test_qgsprovidersublayerdetails.py", line 204, in test_to_mime
    self.assertEqual(uri.layerType, "pointcloud")
AssertionError: 'point-cloud' != 'pointcloud'

So it would seem that, in current master, QgsProviderSublayerDetails::toMimeUri() returns "pointcloud" whereas QgsMapLayerFactory::typeToSTring() returns "point-cloud"...
Which shows the need for uniformization sought by this PR, but I'm not sure what to do with that failure... Should we just adjust the failed test, or do we need to make https://github.com/qgis/QGIS/pull/60360/files#diff-a6c6864f28b601d260d5aff00f149039a0df622797f72f15311d052b1a38b77fL2482 accept "pointcloud" for backward compatibility ?

@nyalldawson
Copy link
Collaborator

@rouault

Should we just adjust the failed test, or do we need to make https://github.com/qgis/QGIS/pull/60360/files#diff-a6c6864f28b601d260d5aff00f149039a0df622797f72f15311d052b1a38b77fL2482 accept "pointcloud" for backward compatibility ?

I'd do that. There's a small possibility that plugins are showing point cloud items in the browser and using "pointcloud" as the layer type string for those.

…tCloudLayer going from 'pointcloud' to 'point-cloud'
@rouault
Copy link
Contributor Author

rouault commented Jan 31, 2025

There's a small possibility that plugins are showing point cloud items in the browser and using "pointcloud" as the layer type string for those.

agreed. I've adjusted the test and make QgsMapLayerFactory::typeFromString() tolerant to both spellings.

@nyalldawson nyalldawson merged commit 530eb4b into qgis:master Feb 2, 2025
31 checks passed
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