Closed danceb closed 1 month ago
Hi, thanks for your suggestion. I'm curious about the nature behind it, could you elaborate?
Best regards
Hi, I am very sorry, but I think, I don't get it clearly, what you have asked for... Do you mean the nature of providing a global configuration for QGIS users?
The benefit of this approach is, that we can provide one single config file within our organization, which is considered of each QGIS installed on the user machines. So to use the locale
setting as an example, we provide a qgis_global_settings.ini
file and define the localisation there, which leads into the same value for all users.
As this parameter is specified within the global config, it is missing within the user configuration within the QGIS3.ini
. The function QSettings()
does only look into this user configuration, where the parameter is missing and the plugin fails within activation as the localisation could not be defined.
For this case the function QgsSettings()
was introduced in 2017 (which is rarely used within the QGIS plugins sadly and I don't know why...). This function will have a look for a specific parameter within the users QGIS3.ini
first and then in the global qgis_global_settings.ini
second, which does not lead into an error, as the parameter could be found there.
Thanks for your explanation, that is exactly what I meant to ask. We will include this in the next release.
Hi there, I would reccommend to use
QgsSettings()
fromqgis.core
(https://github.com/qgis/QGIS/commit/e1ede700a897c899be8aabf20abe7f953209cb10) instead ofQSettings()
fromPyQt5.QtCore
as this consider the use of global configuration via theqgis_global_settings.ini
(https://docs.qgis.org/3.34/en/docs/user_manual/introduction/qgis_configuration.html#deploying-qgis-within-an-organization).So this would take this into account:
instead of