From 166ad00f6cc8ba2339ad1cdb5620a15d9dbf8666 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 13 Jan 2023 21:35:56 +0100 Subject: [PATCH] avoid overriding method in subclass --- .../auto_generated/settings/qgssettingsentryimpl.sip.in | 9 ++++++++- python/pyplugin_installer/installer_data.py | 2 +- src/core/settings/qgssettingsentryimpl.h | 9 ++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in b/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in index ccebfc7f028..596b329e480 100644 --- a/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in +++ b/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in @@ -84,7 +84,14 @@ This constructor is intended to be used from plugins. sipCpp = new sipQgsSettingsEntryVariant( QgsSettingsEntryVariant( *a0, QgsSettings::createPluginTreeElement( *a1 ), *a2, *a3, *a4 ) ); %End - SIP_PYOBJECT value( SIP_PYOBJECT type = 0 ) const; + + + SIP_PYOBJECT valueAs( SIP_PYOBJECT type ) const; +%Docstring +Returns settings value. + +:param type: is the Python type of the value to be returned +%End %MethodCode typedef PyObject *( *pyqt5_from_qvariant_by_type )( QVariant &value, PyObject *type ); QVariant value; diff --git a/python/pyplugin_installer/installer_data.py b/python/pyplugin_installer/installer_data.py index 39129774fe1..addbc971f2b 100644 --- a/python/pyplugin_installer/installer_data.py +++ b/python/pyplugin_installer/installer_data.py @@ -244,7 +244,7 @@ class Repositories(QObject): settings = QgsSettings() try: # QgsSettings may contain ivalid value... - interval = QgsSettings.createPluginTreeElement("_plugin_manager").childSetting('check-on-start-last-date').value(type=QDate).daysTo(QDate.currentDate()) + interval = QgsSettings.createPluginTreeElement("_plugin_manager").childSetting('check-on-start-last-date').valueAs(type=QDate).daysTo(QDate.currentDate()) except: interval = 0 if interval >= Repositories.CHECK_ON_START_INTERVAL: diff --git a/src/core/settings/qgssettingsentryimpl.h b/src/core/settings/qgssettingsentryimpl.h index 3a3b38c3df5..be4a82ff517 100644 --- a/src/core/settings/qgssettingsentryimpl.h +++ b/src/core/settings/qgssettingsentryimpl.h @@ -90,7 +90,14 @@ class CORE_EXPORT QgsSettingsEntryVariant : public QgsSettingsEntryByReference