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

Deprecation warnings adding a layer to the project (setAttribution and setAttributionUrl) #259

Open
agiudiceandrea opened this issue Jan 31, 2025 · 3 comments

Comments

@agiudiceandrea
Copy link
Contributor

When adding a layer to the project:

2025-01-31T09:42:15     WARNING    warning:C:\Users/Andrea/AppData/Roaming/QGIS/QGIS3\profiles\qgis341dev_B/python/plugins\quick_map_services\qgis_map_helpers.py:174: DeprecationWarning: QgsMapLayer.setAttribution() is deprecated
              layer.setAttribution(ds.copyright_text)
             
             traceback: File "C:\Users/Andrea/AppData/Roaming/QGIS/QGIS3\profiles\qgis341dev_B/python/plugins\quick_map_services\quick_map_services.py", line 199, in insert_layer
              add_layer_to_map(ds)
              File "C:\Users/Andrea/AppData/Roaming/QGIS/QGIS3\profiles\qgis341dev_B/python/plugins\quick_map_services\qgis_map_helpers.py", line 174, in add_layer_to_map
              layer.setAttribution(ds.copyright_text)
             
2025-01-31T09:42:15     WARNING    warning:C:\Users/Andrea/AppData/Roaming/QGIS/QGIS3\profiles\qgis341dev_B/python/plugins\quick_map_services\qgis_map_helpers.py:175: DeprecationWarning: QgsMapLayer.setAttributionUrl() is deprecated
              layer.setAttributionUrl(ds.copyright_link)
             
             traceback: File "C:\Users/Andrea/AppData/Roaming/QGIS/QGIS3\profiles\qgis341dev_B/python/plugins\quick_map_services\quick_map_services.py", line 199, in insert_layer
              add_layer_to_map(ds)
              File "C:\Users/Andrea/AppData/Roaming/QGIS/QGIS3\profiles\qgis341dev_B/python/plugins\quick_map_services\qgis_map_helpers.py", line 175, in add_layer_to_map
              layer.setAttributionUrl(ds.copyright_link)
@RemeshevskiyValeriy
Copy link
Contributor

Duplicate #258

@agiudiceandrea
Copy link
Contributor Author

agiudiceandrea commented Jan 31, 2025

Not a duplicate. #258 (qgis/QGIS#60286) is about a crash which no longer occurs since the issue has been fixed the QGIS's source code (qgis/QGIS#60363).

This is about the use of deprecated methods and it is still valid, since such methods are still used in the plugin source code published in this repository and in the latest plugin version 0.19.37 available at https://plugins.qgis.org/plugins/quick_map_services/.

@RemeshevskiyValeriy
Copy link
Contributor

Ah, okay. Sorry for the premature duplicate marking. Just while fixing #258, changes were added to handle these deprecated methods.. These changes will be included in the upcoming release. So stay tuned.

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

No branches or pull requests

2 participants