diff --git a/python/core/additions/qgssettingsentry.py b/python/core/additions/qgssettingsentry.py index b3fc35eaf63..cf74b9bf9a7 100644 --- a/python/core/additions/qgssettingsentry.py +++ b/python/core/additions/qgssettingsentry.py @@ -54,7 +54,7 @@ class PyQgsSettingsEntryEnumFlag(QgsSettingsEntryBase): self.__enumFlagClass = defaultValue.__class__ if type(pluginName) == str: - parent = QgsSettings.createPluginTreeNode(pluginName) + parent = QgsSettingsTree.createPluginTreeNode(pluginName) else: parent = pluginName super().__init__(key, parent, defaultValueStr, description, options) diff --git a/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in b/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in index e8bdaf5d11c..d0e0480be7a 100644 --- a/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in +++ b/python/core/auto_generated/settings/qgssettingsentryimpl.sip.in @@ -81,7 +81,7 @@ This constructor is intended to be used from plugins. :param options: specifies the options for the settings entry. %End %MethodCode - sipCpp = new sipQgsSettingsEntryVariant( QgsSettingsEntryVariant( *a0, QgsSettings::createPluginTreeNode( *a1 ), *a2, *a3, *a4 ) ); + sipCpp = new sipQgsSettingsEntryVariant( QgsSettingsEntryVariant( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), *a2, *a3, *a4 ) ); %End @@ -188,7 +188,7 @@ This constructor is intended to be used from plugins. :param options: specifies the options for the settings entry. %End %MethodCode - sipCpp = new sipQgsSettingsEntryString( QgsSettingsEntryString( *a0, QgsSettings::createPluginTreeNode( *a1 ), *a2, *a3, *a4 ) ); + sipCpp = new sipQgsSettingsEntryString( QgsSettingsEntryString( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), *a2, *a3, *a4 ) ); %End virtual Qgis::SettingsType settingsType() const; @@ -279,7 +279,7 @@ This constructor is intended to be used from plugins. :param options: specifies the options for the settings entry. %End %MethodCode - sipCpp = new sipQgsSettingsEntryStringList( QgsSettingsEntryStringList( *a0, QgsSettings::createPluginTreeNode( *a1 ), *a2, *a3, *a4 ) ); + sipCpp = new sipQgsSettingsEntryStringList( QgsSettingsEntryStringList( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), *a2, *a3, *a4 ) ); %End virtual Qgis::SettingsType settingsType() const; @@ -357,7 +357,7 @@ This constructor is intended to be used from plugins. :param options: specifies the options for the settings entry. %End %MethodCode - sipCpp = new sipQgsSettingsEntryBool( QgsSettingsEntryBool( *a0, QgsSettings::createPluginTreeNode( *a1 ), a2, *a3, *a4 ) ); + sipCpp = new sipQgsSettingsEntryBool( QgsSettingsEntryBool( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), a2, *a3, *a4 ) ); %End @@ -448,7 +448,7 @@ This constructor is intended to be used from plugins. :param maxValue: specifies the maximal value. %End %MethodCode - sipCpp = new sipQgsSettingsEntryInteger( QgsSettingsEntryInteger( *a0, QgsSettings::createPluginTreeNode( *a1 ), a2, *a3, *a4, a5, a6 ) ); + sipCpp = new sipQgsSettingsEntryInteger( QgsSettingsEntryInteger( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), a2, *a3, *a4, a5, a6 ) ); %End virtual Qgis::SettingsType settingsType() const; @@ -558,7 +558,7 @@ This constructor is intended to be used from plugins. :param displayDecimals: specifies a hint for the gui about how much decimals to show %End %MethodCode - sipCpp = new sipQgsSettingsEntryDouble( QgsSettingsEntryDouble( *a0, QgsSettings::createPluginTreeNode( *a1 ), a2, *a3, *a4, a5, a6, a7 ) ); + sipCpp = new sipQgsSettingsEntryDouble( QgsSettingsEntryDouble( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), a2, *a3, *a4, a5, a6, a7 ) ); %End @@ -667,7 +667,7 @@ This constructor is intended to be used from plugins. :param options: specifies the options for the settings entry. %End %MethodCode - sipCpp = new sipQgsSettingsEntryColor( QgsSettingsEntryColor( *a0, QgsSettings::createPluginTreeNode( *a1 ), *a2, *a3, *a4, a5 ) ); + sipCpp = new sipQgsSettingsEntryColor( QgsSettingsEntryColor( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), *a2, *a3, *a4, a5 ) ); %End virtual Qgis::SettingsType settingsType() const; @@ -757,7 +757,7 @@ This constructor is intended to be used from plugins. :param options: specifies the options for the settings entry. %End %MethodCode - sipCpp = new sipQgsSettingsEntryVariantMap( QgsSettingsEntryVariantMap( *a0, QgsSettings::createPluginTreeNode( *a1 ), *a2, *a3, *a4 ) ); + sipCpp = new sipQgsSettingsEntryVariantMap( QgsSettingsEntryVariantMap( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), *a2, *a3, *a4 ) ); %End virtual Qgis::SettingsType settingsType() const; diff --git a/python/core/auto_generated/settings/qgssettingstreeelement.sip.in b/python/core/auto_generated/settings/qgssettingstreeelement.sip.in index 720d1e504ba..ec967afdadd 100644 --- a/python/core/auto_generated/settings/qgssettingstreeelement.sip.in +++ b/python/core/auto_generated/settings/qgssettingstreeelement.sip.in @@ -177,7 +177,7 @@ Registers a child elements This is not available in Python bindings. Use method createElement on an existing tree element. -.. seealso:: :py:func:`QgsSettings.createPluginTreeNode` +.. seealso:: :py:func:`QgsSettingsTree.createPluginTreeNode` %End QgsSettingsTreeNode( const QgsSettingsTreeNode &other ); }; @@ -274,7 +274,7 @@ Init the elements with the specific ``options`` This is not available in Python bindings. Use method createNamedListNode on an existing tree element. -.. seealso:: :py:func:`QgsSettings.createPluginTreeNode` +.. seealso:: :py:func:`QgsSettingsTree.createPluginTreeNode` %End QgsSettingsTreeNamedListNode( const QgsSettingsTreeNamedListNode &other ); }; diff --git a/python/core/auto_generated/settings/qgssettingstreenode.sip.in b/python/core/auto_generated/settings/qgssettingstreenode.sip.in index 2086b9cb54e..f067e1ce8e1 100644 --- a/python/core/auto_generated/settings/qgssettingstreenode.sip.in +++ b/python/core/auto_generated/settings/qgssettingstreenode.sip.in @@ -176,7 +176,7 @@ Registers a child nodes This is not available in Python bindings. Use method createNode on an existing tree node. -.. seealso:: :py:func:`QgsSettings.createPluginTreeNode` +.. seealso:: :py:func:`QgsSettingsTree.createPluginTreeNode` %End QgsSettingsTreeNode( const QgsSettingsTreeNode &other ); }; @@ -273,7 +273,7 @@ Init the nodes with the specific ``options`` This is not available in Python bindings. Use method createNamedListNode on an existing tree node. -.. seealso:: :py:func:`QgsSettings.createPluginTreeNode` +.. seealso:: :py:func:`QgsSettingsTree.createPluginTreeNode` %End QgsSettingsTreeNamedListNode( const QgsSettingsTreeNamedListNode &other ); }; diff --git a/python/pyplugin_installer/installer.py b/python/pyplugin_installer/installer.py index 97ee2d8a989..e617f509597 100644 --- a/python/pyplugin_installer/installer.py +++ b/python/pyplugin_installer/installer.py @@ -578,7 +578,7 @@ class QgsPluginInstaller(QObject): if not os.path.isfile(filePath): return - QgsSettings.createPluginTreeNode("_plugin_manager").childSetting("last-zip-directory").setValue(QFileInfo(filePath).absoluteDir().absolutePath()) + QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting("last-zip-directory").setValue(QFileInfo(filePath).absoluteDir().absolutePath()) pluginName = None with zipfile.ZipFile(filePath, 'r') as zf: diff --git a/python/pyplugin_installer/installer_data.py b/python/pyplugin_installer/installer_data.py index c85e61eda36..e85f1dbb269 100644 --- a/python/pyplugin_installer/installer_data.py +++ b/python/pyplugin_installer/installer_data.py @@ -229,22 +229,22 @@ class Repositories(QObject): def checkingOnStart(self) -> bool: """ return true if checking for news and updates is enabled """ - return QgsSettings.createPluginTreeNode("_plugin_manager").childSetting('automatically-check-for-updates').value() + return QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting('automatically-check-for-updates').value() def setCheckingOnStart(self, state: bool): """ set state of checking for news and updates """ - QgsSettings.createPluginTreeNode("_plugin_manager").childSetting('automatically-check-for-updates').setValue(state) + QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting('automatically-check-for-updates').setValue(state) def saveCheckingOnStartLastDate(self): """ set today's date as the day of last checking """ - QgsSettings.createPluginTreeNode("_plugin_manager").childSetting('check-on-start-last-date').setValue(QDate.currentDate()) + QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting('check-on-start-last-date').setValue(QDate.currentDate()) def timeForChecking(self) -> bool: """ determine whether it's the time for checking for news and updates now """ settings = QgsSettings() try: # QgsSettings may contain ivalid value... - interval = QgsSettings.createPluginTreeNode("_plugin_manager").childSetting('check-on-start-last-date').valueAs(type=QDate).daysTo(QDate.currentDate()) + interval = QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting('check-on-start-last-date').valueAs(type=QDate).daysTo(QDate.currentDate()) except: interval = 0 if interval >= Repositories.CHECK_ON_START_INTERVAL: @@ -711,8 +711,8 @@ class Plugins(QObject): self.mPlugins = {} for i in list(self.localCache.keys()): self.mPlugins[i] = self.localCache[i].copy() - allowExperimental = QgsSettings.createPluginTreeNode("_plugin_manager").childSetting("allow-experimental").value() - allowDeprecated = QgsSettings.createPluginTreeNode("_plugin_manager").childSetting("allow-deprecated").value() + allowExperimental = QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting("allow-experimental").value() + allowDeprecated = QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting("allow-deprecated").value() for i in list(self.repoCache.values()): for j in i: plugin = j.copy() # do not update repoCache elements! @@ -808,7 +808,7 @@ class Plugins(QObject): # ----------------------------------------- # def markNews(self): """ mark all new plugins as new """ - seenPlugins = QgsSettings.createPluginTreeNode("_plugin_manager").childSetting("seen-plugins").valueWithDefaultOverride(list(self.mPlugins.keys())) + seenPlugins = QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting("seen-plugins").valueWithDefaultOverride(list(self.mPlugins.keys())) if len(seenPlugins) > 0: for plugin in list(self.mPlugins.keys()): if seenPlugins.count(plugin) == 0 and self.mPlugins[plugin]["status"] == "not installed": @@ -817,7 +817,7 @@ class Plugins(QObject): # ----------------------------------------- # def updateSeenPluginsList(self): """ update the list of all seen plugins """ - setting = QgsSettings.createPluginTreeNode("_plugin_manager").childSetting("seen-plugins") + setting = QgsSettingsTree.createPluginTreeNode("_plugin_manager").childSetting("seen-plugins") seenPlugins = setting.valueWithDefaultOverride(list(self.mPlugins.keys())) for plugin in list(self.mPlugins.keys()): if seenPlugins.count(plugin) == 0: diff --git a/src/app/elevation/qgselevationprofilewidget.cpp b/src/app/elevation/qgselevationprofilewidget.cpp index d7581334462..30080f572e7 100644 --- a/src/app/elevation/qgselevationprofilewidget.cpp +++ b/src/app/elevation/qgselevationprofilewidget.cpp @@ -56,9 +56,9 @@ #include #include -const QgsSettingsEntryDouble *QgsElevationProfileWidget::settingTolerance = new QgsSettingsEntryDouble( QStringLiteral( "tolerance" ), QgsSettings::sTreeElevationProfile, 0.1, QStringLiteral( "Tolerance distance for elevation profile plots" ), Qgis::SettingsOptions(), 0 ); +const QgsSettingsEntryDouble *QgsElevationProfileWidget::settingTolerance = new QgsSettingsEntryDouble( QStringLiteral( "tolerance" ), QgsSettingsTree::sTreeElevationProfile, 0.1, QStringLiteral( "Tolerance distance for elevation profile plots" ), Qgis::SettingsOptions(), 0 ); -const QgsSettingsEntryBool *QgsElevationProfileWidget::settingShowLayerTree = new QgsSettingsEntryBool( QStringLiteral( "show-layer-tree" ), QgsSettings::sTreeElevationProfile, true, QStringLiteral( "Whether the layer tree should be shown for elevation profile plots" ) ); +const QgsSettingsEntryBool *QgsElevationProfileWidget::settingShowLayerTree = new QgsSettingsEntryBool( QStringLiteral( "show-layer-tree" ), QgsSettingsTree::sTreeElevationProfile, true, QStringLiteral( "Whether the layer tree should be shown for elevation profile plots" ) ); QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name ) : QWidget( nullptr ) diff --git a/src/app/georeferencer/qgsgeorefmainwindow.h b/src/app/georeferencer/qgsgeorefmainwindow.h index 14450efbdfd..107096bcc35 100644 --- a/src/app/georeferencer/qgsgeorefmainwindow.h +++ b/src/app/georeferencer/qgsgeorefmainwindow.h @@ -65,7 +65,7 @@ class QgsGeoreferencerMainWindow : public QMainWindow, private Ui::QgsGeorefPlug Q_OBJECT public: - static inline QgsSettingsTreeNode *sTreeGeoreferencer = QgsSettings::sTreeApp->createChildNode( QStringLiteral( "georeferencer" ) ); + static inline QgsSettingsTreeNode *sTreeGeoreferencer = QgsSettingsTree::sTreeApp->createChildNode( QStringLiteral( "georeferencer" ) ); static const QgsSettingsEntryEnumFlag *settingResamplingMethod; static const QgsSettingsEntryString *settingCompressionMethod; diff --git a/src/app/gps/qgsappgpsdigitizing.cpp b/src/app/gps/qgsappgpsdigitizing.cpp index 80f72f7eb94..d3cd6d7c492 100644 --- a/src/app/gps/qgsappgpsdigitizing.cpp +++ b/src/app/gps/qgsappgpsdigitizing.cpp @@ -32,7 +32,7 @@ #include -const QgsSettingsEntryString *QgsAppGpsDigitizing::settingTrackLineSymbol = new QgsSettingsEntryString( QStringLiteral( "track-line-symbol" ), QgsSettings::sTreeGps, QStringLiteral( "" ), QStringLiteral( "Line symbol to use for GPS track line" ), Qgis::SettingsOptions(), 0 ); +const QgsSettingsEntryString *QgsAppGpsDigitizing::settingTrackLineSymbol = new QgsSettingsEntryString( QStringLiteral( "track-line-symbol" ), QgsSettingsTree::sTreeGps, QStringLiteral( "" ), QStringLiteral( "Line symbol to use for GPS track line" ), Qgis::SettingsOptions(), 0 ); QgsUpdateGpsDetailsAction::QgsUpdateGpsDetailsAction( QgsAppGpsConnection *connection, QgsAppGpsDigitizing *digitizing, QObject *parent ) : QgsMapLayerAction( tr( "Update GPS Information" ), parent, Qgis::MapLayerActionTarget::SingleFeature, QgsApplication::getThemeIcon( QStringLiteral( "/gpsicons/mActionRecenter.svg" ) ) ) diff --git a/src/app/gps/qgsappgpslogging.cpp b/src/app/gps/qgsappgpslogging.cpp index b9c76165e0d..736f9c15dcf 100644 --- a/src/app/gps/qgsappgpslogging.cpp +++ b/src/app/gps/qgsappgpslogging.cpp @@ -23,9 +23,9 @@ #include "qgsproviderregistry.h" #include "qgsprovidermetadata.h" -const QgsSettingsEntryString *QgsAppGpsLogging::settingLastLogFolder = new QgsSettingsEntryString( QStringLiteral( "last-log-folder" ), QgsSettings::sTreeGps, QString(), QStringLiteral( "Last used folder for GPS log files" ) ); +const QgsSettingsEntryString *QgsAppGpsLogging::settingLastLogFolder = new QgsSettingsEntryString( QStringLiteral( "last-log-folder" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "Last used folder for GPS log files" ) ); -const QgsSettingsEntryString *QgsAppGpsLogging::settingLastGpkgLog = new QgsSettingsEntryString( QStringLiteral( "last-gpkg-log" ), QgsSettings::sTreeGps, QString(), QStringLiteral( "Last used Geopackage/Spatialite file for logging GPS locations" ) ); +const QgsSettingsEntryString *QgsAppGpsLogging::settingLastGpkgLog = new QgsSettingsEntryString( QStringLiteral( "last-gpkg-log" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "Last used Geopackage/Spatialite file for logging GPS locations" ) ); const std::vector< std::tuple< Qgis::GpsInformationComponent, std::tuple< QVariant::Type, QString >>> QgsAppGpsLogging::sPointFields { diff --git a/src/app/gps/qgsgpscanvasbridge.cpp b/src/app/gps/qgsgpscanvasbridge.cpp index b0ca8ca74e2..b58e782eac2 100644 --- a/src/app/gps/qgsgpscanvasbridge.cpp +++ b/src/app/gps/qgsgpscanvasbridge.cpp @@ -31,17 +31,17 @@ #include "qgssettingsentryimpl.h" #include "qgssettingsentryenumflag.h" -const QgsSettingsEntryBool *QgsGpsCanvasBridge::settingShowBearingLine = new QgsSettingsEntryBool( QStringLiteral( "show-bearing-line" ), QgsSettings::sTreeGps, false, QStringLiteral( "Whether the GPS bearing line symbol should be shown" ) ); +const QgsSettingsEntryBool *QgsGpsCanvasBridge::settingShowBearingLine = new QgsSettingsEntryBool( QStringLiteral( "show-bearing-line" ), QgsSettingsTree::sTreeGps, false, QStringLiteral( "Whether the GPS bearing line symbol should be shown" ) ); -const QgsSettingsEntryString *QgsGpsCanvasBridge::settingBearingLineSymbol = new QgsSettingsEntryString( QStringLiteral( "bearing-line-symbol" ), QgsSettings::sTreeGps, QString(), QStringLiteral( "Line symbol to use for GPS bearing line" ), Qgis::SettingsOptions(), 0 ); +const QgsSettingsEntryString *QgsGpsCanvasBridge::settingBearingLineSymbol = new QgsSettingsEntryString( QStringLiteral( "bearing-line-symbol" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "Line symbol to use for GPS bearing line" ), Qgis::SettingsOptions(), 0 ); -const QgsSettingsEntryInteger *QgsGpsCanvasBridge::settingMapExtentRecenteringThreshold = new QgsSettingsEntryInteger( QStringLiteral( "map-recentering-threshold" ), QgsSettings::sTreeGps, 50, QStringLiteral( "Threshold for GPS automatic map centering" ) ); +const QgsSettingsEntryInteger *QgsGpsCanvasBridge::settingMapExtentRecenteringThreshold = new QgsSettingsEntryInteger( QStringLiteral( "map-recentering-threshold" ), QgsSettingsTree::sTreeGps, 50, QStringLiteral( "Threshold for GPS automatic map centering" ) ); -const QgsSettingsEntryEnumFlag *QgsGpsCanvasBridge::settingMapCenteringMode = new QgsSettingsEntryEnumFlag( QStringLiteral( "map-recentering" ), QgsSettings::sTreeGps, Qgis::MapRecenteringMode::WhenOutsideVisibleExtent, QStringLiteral( "Automatic GPS based map recentering mode" ) ); +const QgsSettingsEntryEnumFlag *QgsGpsCanvasBridge::settingMapCenteringMode = new QgsSettingsEntryEnumFlag( QStringLiteral( "map-recentering" ), QgsSettingsTree::sTreeGps, Qgis::MapRecenteringMode::WhenOutsideVisibleExtent, QStringLiteral( "Automatic GPS based map recentering mode" ) ); -const QgsSettingsEntryBool *QgsGpsCanvasBridge::settingRotateMap = new QgsSettingsEntryBool( QStringLiteral( "auto-map-rotate" ), QgsSettings::sTreeGps, false, QStringLiteral( "Whether to automatically rotate the map to match GPS bearing" ) ); +const QgsSettingsEntryBool *QgsGpsCanvasBridge::settingRotateMap = new QgsSettingsEntryBool( QStringLiteral( "auto-map-rotate" ), QgsSettingsTree::sTreeGps, false, QStringLiteral( "Whether to automatically rotate the map to match GPS bearing" ) ); -const QgsSettingsEntryInteger *QgsGpsCanvasBridge::settingMapRotateInterval = new QgsSettingsEntryInteger( QStringLiteral( "map-rotate-interval" ), QgsSettings::sTreeGps, 0, QStringLiteral( "Interval for GPS automatic map rotation" ) ); +const QgsSettingsEntryInteger *QgsGpsCanvasBridge::settingMapRotateInterval = new QgsSettingsEntryInteger( QStringLiteral( "map-rotate-interval" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "Interval for GPS automatic map rotation" ) ); QgsGpsCanvasBridge::QgsGpsCanvasBridge( QgsAppGpsConnection *connection, QgsMapCanvas *canvas, QObject *parent ) : QObject( parent ) diff --git a/src/app/gps/qgsgpsmarker.cpp b/src/app/gps/qgsgpsmarker.cpp index 76791e807d3..7bf4504d513 100644 --- a/src/app/gps/qgsgpsmarker.cpp +++ b/src/app/gps/qgsgpsmarker.cpp @@ -27,11 +27,11 @@ #include "qgsgui.h" -const QgsSettingsEntryString *QgsGpsMarker::settingLocationMarkerSymbol = new QgsSettingsEntryString( QStringLiteral( "location-marker-symbol" ), QgsSettings::sTreeGps, QStringLiteral( R"""( )""" ), QStringLiteral( "Marker symbol to use for GPS location marker" ), Qgis::SettingsOptions(), 0 ); +const QgsSettingsEntryString *QgsGpsMarker::settingLocationMarkerSymbol = new QgsSettingsEntryString( QStringLiteral( "location-marker-symbol" ), QgsSettingsTree::sTreeGps, QStringLiteral( R"""( )""" ), QStringLiteral( "Marker symbol to use for GPS location marker" ), Qgis::SettingsOptions(), 0 ); -const QgsSettingsEntryBool *QgsGpsMarker::settingShowLocationMarker = new QgsSettingsEntryBool( QStringLiteral( "show-location-marker" ), QgsSettings::sTreeGps, true, QStringLiteral( "Whether to show the current GPS location marker" ) ); +const QgsSettingsEntryBool *QgsGpsMarker::settingShowLocationMarker = new QgsSettingsEntryBool( QStringLiteral( "show-location-marker" ), QgsSettingsTree::sTreeGps, true, QStringLiteral( "Whether to show the current GPS location marker" ) ); -const QgsSettingsEntryBool *QgsGpsMarker::settingRotateLocationMarker = new QgsSettingsEntryBool( QStringLiteral( "rotate-location-marker" ), QgsSettings::sTreeGps, true, QStringLiteral( "Whether to rotate GPS marker symbol to follow GPS bearing" ), Qgis::SettingsOptions() ); +const QgsSettingsEntryBool *QgsGpsMarker::settingRotateLocationMarker = new QgsSettingsEntryBool( QStringLiteral( "rotate-location-marker" ), QgsSettingsTree::sTreeGps, true, QStringLiteral( "Whether to rotate GPS marker symbol to follow GPS bearing" ), Qgis::SettingsOptions() ); QgsGpsMarker::QgsGpsMarker( QgsMapCanvas *mapCanvas ) : QgsMapCanvasMarkerSymbolItem( mapCanvas ) diff --git a/src/app/gps/qgsgpstoolbar.cpp b/src/app/gps/qgsgpstoolbar.cpp index f3eda032a88..6e3156bc0ef 100644 --- a/src/app/gps/qgsgpstoolbar.cpp +++ b/src/app/gps/qgsgpstoolbar.cpp @@ -34,7 +34,7 @@ #include #include -const QgsSettingsEntryEnumFlag *QgsGpsToolBar::settingShowInToolbar = new QgsSettingsEntryEnumFlag( QStringLiteral( "show-in-toolbar" ), QgsSettings::sTreeGps, Qgis::GpsInformationComponent::Location, QStringLiteral( "GPS information components to show in GPS toolbar" ) ); +const QgsSettingsEntryEnumFlag *QgsGpsToolBar::settingShowInToolbar = new QgsSettingsEntryEnumFlag( QStringLiteral( "show-in-toolbar" ), QgsSettingsTree::sTreeGps, Qgis::GpsInformationComponent::Location, QStringLiteral( "GPS information components to show in GPS toolbar" ) ); QgsGpsToolBar::QgsGpsToolBar( QgsAppGpsConnection *connection, QgsMapCanvas *canvas, QWidget *parent ) diff --git a/src/app/maptools/qgsmaptoolsdigitizingtechniquemanager.cpp b/src/app/maptools/qgsmaptoolsdigitizingtechniquemanager.cpp index 9fb02895981..4f8285d72a7 100644 --- a/src/app/maptools/qgsmaptoolsdigitizingtechniquemanager.cpp +++ b/src/app/maptools/qgsmaptoolsdigitizingtechniquemanager.cpp @@ -33,7 +33,7 @@ #include #include -const QgsSettingsEntryEnumFlag *QgsMapToolsDigitizingTechniqueManager::settingsDigitizingTechnique = new QgsSettingsEntryEnumFlag( QStringLiteral( "technique" ), QgsSettings::sTreeDigitizing, Qgis::CaptureTechnique::StraightSegments, QObject::tr( "Current digitizing technique" ), Qgis::SettingsOption::SaveFormerValue ) SIP_SKIP; +const QgsSettingsEntryEnumFlag *QgsMapToolsDigitizingTechniqueManager::settingsDigitizingTechnique = new QgsSettingsEntryEnumFlag( QStringLiteral( "technique" ), QgsSettingsTree::sTreeDigitizing, Qgis::CaptureTechnique::StraightSegments, QObject::tr( "Current digitizing technique" ), Qgis::SettingsOption::SaveFormerValue ) SIP_SKIP; const QgsSettingsEntryString *QgsMapToolsDigitizingTechniqueManager::settingMapToolShapeCurrent = new QgsSettingsEntryString( QStringLiteral( "current" ), sTreeShapeMapTools, QgsMapToolShapeCircle2PointsMetadata::TOOL_ID, QObject::tr( "Current shape map tool" ) ) SIP_SKIP; const QgsSettingsEntryString *QgsMapToolsDigitizingTechniqueManager::settingMapToolShapeDefaultForCategory = new QgsSettingsEntryString( QStringLiteral( "default" ), sTreeShapeMapToolsCategories, QString(), QObject::tr( "Default map tool for given shape category" ) ) SIP_SKIP; diff --git a/src/app/maptools/qgsmaptoolsdigitizingtechniquemanager.h b/src/app/maptools/qgsmaptoolsdigitizingtechniquemanager.h index 05f84edc321..0b460998d19 100644 --- a/src/app/maptools/qgsmaptoolsdigitizingtechniquemanager.h +++ b/src/app/maptools/qgsmaptoolsdigitizingtechniquemanager.h @@ -54,7 +54,7 @@ class APP_EXPORT QgsMapToolsDigitizingTechniqueManager : public QObject static const QgsSettingsEntryEnumFlag *settingsDigitizingTechnique; - static inline QgsSettingsTreeNode *sTreeShapeMapTools = QgsSettings::sTreeDigitizing->createChildNode( QStringLiteral( "shape-map-tools" ) ); + static inline QgsSettingsTreeNode *sTreeShapeMapTools = QgsSettingsTree::sTreeDigitizing->createChildNode( QStringLiteral( "shape-map-tools" ) ); static const QgsSettingsEntryString *settingMapToolShapeCurrent; static inline QgsSettingsTreeNamedListNode *sTreeShapeMapToolsCategories = sTreeShapeMapTools->createNamedListNode( QStringLiteral( "categories" ) ); static const QgsSettingsEntryString *settingMapToolShapeDefaultForCategory; diff --git a/src/app/pluginmanager/qgspluginmanager.h b/src/app/pluginmanager/qgspluginmanager.h index 693bd837b87..81c873ac960 100644 --- a/src/app/pluginmanager/qgspluginmanager.h +++ b/src/app/pluginmanager/qgspluginmanager.h @@ -52,7 +52,7 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag Q_OBJECT public: - static inline QgsSettingsTreeNode *sTreePluginManager = QgsSettings::sTreePlugins->createChildNode( QStringLiteral( "_plugin_manager" ) ); + static inline QgsSettingsTreeNode *sTreePluginManager = QgsSettingsTree::sTreePlugins->createChildNode( QStringLiteral( "_plugin_manager" ) ); static const QgsSettingsEntryBool *settingsAutomaticallyCheckForPluginUpdates; static const QgsSettingsEntryBool *settingsAllowExperimental; diff --git a/src/app/qgsidentifyresultsdialog.cpp b/src/app/qgsidentifyresultsdialog.cpp index 15447096e70..25607240d51 100644 --- a/src/app/qgsidentifyresultsdialog.cpp +++ b/src/app/qgsidentifyresultsdialog.cpp @@ -93,7 +93,7 @@ #include -const QgsSettingsEntryBool *QgsIdentifyResultsDialog::settingHideNullValues = new QgsSettingsEntryBool( QStringLiteral( "hide-null-values" ), QgsSettings::sTreeMap, false, QStringLiteral( "Whether to hide attributes with NULL values in the identify feature result" ) ); +const QgsSettingsEntryBool *QgsIdentifyResultsDialog::settingHideNullValues = new QgsSettingsEntryBool( QStringLiteral( "hide-null-values" ), QgsSettingsTree::sTreeMap, false, QStringLiteral( "Whether to hide attributes with NULL values in the identify feature result" ) ); QgsIdentifyResultsWebView::QgsIdentifyResultsWebView( QWidget *parent ) : QgsWebView( parent ) diff --git a/src/app/vertextool/qgsvertexeditor.cpp b/src/app/vertextool/qgsvertexeditor.cpp index 60549db1733..e8d78bc1960 100644 --- a/src/app/vertextool/qgsvertexeditor.cpp +++ b/src/app/vertextool/qgsvertexeditor.cpp @@ -42,7 +42,7 @@ #include #include -const QgsSettingsEntryBool *QgsVertexEditor::settingAutoPopupVertexEditorDock = new QgsSettingsEntryBool( QStringLiteral( "auto-popup-vertex-editor-dock" ), QgsSettings::sTreeDigitizing, true, QStringLiteral( "Whether the auto-popup behavior of the vertex editor dock should be enabled" ) ); +const QgsSettingsEntryBool *QgsVertexEditor::settingAutoPopupVertexEditorDock = new QgsSettingsEntryBool( QStringLiteral( "auto-popup-vertex-editor-dock" ), QgsSettingsTree::sTreeDigitizing, true, QStringLiteral( "Whether the auto-popup behavior of the vertex editor dock should be enabled" ) ); static const int MIN_RADIUS_ROLE = Qt::UserRole + 1; diff --git a/src/core/gps/qgsbabelformatregistry.h b/src/core/gps/qgsbabelformatregistry.h index f2d8dccf3d5..25da9fdc745 100644 --- a/src/core/gps/qgsbabelformatregistry.h +++ b/src/core/gps/qgsbabelformatregistry.h @@ -39,7 +39,7 @@ class CORE_EXPORT QgsBabelFormatRegistry #ifndef SIP_RUN - static inline QgsSettingsTreeNamedListNode *sTreeBabelDevices = QgsSettings::sTreeGps->createNamedListNode( QStringLiteral( "babel-devices" ) ); + static inline QgsSettingsTreeNamedListNode *sTreeBabelDevices = QgsSettingsTree::sTreeGps->createNamedListNode( QStringLiteral( "babel-devices" ) ); static const QgsSettingsEntryString *settingsBabelWptDownload; static const QgsSettingsEntryString *settingsBabelWptUpload; diff --git a/src/core/gps/qgsgpsconnection.cpp b/src/core/gps/qgsgpsconnection.cpp index db19761a562..0c7b45b9820 100644 --- a/src/core/gps/qgsgpsconnection.cpp +++ b/src/core/gps/qgsgpsconnection.cpp @@ -22,31 +22,31 @@ #include -const QgsSettingsEntryEnumFlag *QgsGpsConnection::settingsGpsConnectionType = new QgsSettingsEntryEnumFlag( QStringLiteral( "gps-connection-type" ), QgsSettings::sTreeGps, Qgis::GpsConnectionType::Automatic, QStringLiteral( "GPS connection type" ) ) SIP_SKIP; +const QgsSettingsEntryEnumFlag *QgsGpsConnection::settingsGpsConnectionType = new QgsSettingsEntryEnumFlag( QStringLiteral( "gps-connection-type" ), QgsSettingsTree::sTreeGps, Qgis::GpsConnectionType::Automatic, QStringLiteral( "GPS connection type" ) ) SIP_SKIP; -const QgsSettingsEntryEnumFlag *QgsGpsConnection::settingsGpsTimeStampSpecification = new QgsSettingsEntryEnumFlag( QStringLiteral( "timestamp-time-spec" ), QgsSettings::sTreeGps, Qt::TimeSpec::LocalTime, QStringLiteral( "GPS time stamp specification" ) ) SIP_SKIP; +const QgsSettingsEntryEnumFlag *QgsGpsConnection::settingsGpsTimeStampSpecification = new QgsSettingsEntryEnumFlag( QStringLiteral( "timestamp-time-spec" ), QgsSettingsTree::sTreeGps, Qt::TimeSpec::LocalTime, QStringLiteral( "GPS time stamp specification" ) ) SIP_SKIP; -const QgsSettingsEntryString *QgsGpsConnection::settingsGpsdHostName = new QgsSettingsEntryString( QStringLiteral( "gpsd-host-name" ), QgsSettings::sTreeGps, QString(), QStringLiteral( "GPSD connection host name" ) ) SIP_SKIP; +const QgsSettingsEntryString *QgsGpsConnection::settingsGpsdHostName = new QgsSettingsEntryString( QStringLiteral( "gpsd-host-name" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPSD connection host name" ) ) SIP_SKIP; -const QgsSettingsEntryInteger *QgsGpsConnection::settingsGpsdPortNumber = new QgsSettingsEntryInteger( QStringLiteral( "gpsd-port" ), QgsSettings::sTreeGps, 2947, QStringLiteral( "GPSD port number" ) ) SIP_SKIP; +const QgsSettingsEntryInteger *QgsGpsConnection::settingsGpsdPortNumber = new QgsSettingsEntryInteger( QStringLiteral( "gpsd-port" ), QgsSettingsTree::sTreeGps, 2947, QStringLiteral( "GPSD port number" ) ) SIP_SKIP; -const QgsSettingsEntryString *QgsGpsConnection::settingsGpsdDeviceName = new QgsSettingsEntryString( QStringLiteral( "gpsd-device-name" ), QgsSettings::sTreeGps, QString(), QStringLiteral( "GPSD connection device name" ) ) SIP_SKIP; +const QgsSettingsEntryString *QgsGpsConnection::settingsGpsdDeviceName = new QgsSettingsEntryString( QStringLiteral( "gpsd-device-name" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPSD connection device name" ) ) SIP_SKIP; -const QgsSettingsEntryString *QgsGpsConnection::settingsGpsSerialDevice = new QgsSettingsEntryString( QStringLiteral( "gpsd-serial-device" ), QgsSettings::sTreeGps, QString(), QStringLiteral( "GPS serial device name" ) ) SIP_SKIP; +const QgsSettingsEntryString *QgsGpsConnection::settingsGpsSerialDevice = new QgsSettingsEntryString( QStringLiteral( "gpsd-serial-device" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPS serial device name" ) ) SIP_SKIP; -const QgsSettingsEntryInteger *QgsGpsConnection::settingGpsAcquisitionInterval = new QgsSettingsEntryInteger( QStringLiteral( "acquisition-interval" ), QgsSettings::sTreeGps, 0, QStringLiteral( "GPS track point acquisition interval" ) ) SIP_SKIP; +const QgsSettingsEntryInteger *QgsGpsConnection::settingGpsAcquisitionInterval = new QgsSettingsEntryInteger( QStringLiteral( "acquisition-interval" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "GPS track point acquisition interval" ) ) SIP_SKIP; -const QgsSettingsEntryDouble *QgsGpsConnection::settingGpsDistanceThreshold = new QgsSettingsEntryDouble( QStringLiteral( "distance-threshold" ), QgsSettings::sTreeGps, 0, QStringLiteral( "GPS track point distance threshold" ) ) SIP_SKIP; +const QgsSettingsEntryDouble *QgsGpsConnection::settingGpsDistanceThreshold = new QgsSettingsEntryDouble( QStringLiteral( "distance-threshold" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "GPS track point distance threshold" ) ) SIP_SKIP; -const QgsSettingsEntryBool *QgsGpsConnection::settingGpsBearingFromTravelDirection = new QgsSettingsEntryBool( QStringLiteral( "calculate-bearing-from-travel" ), QgsSettings::sTreeGps, false, QStringLiteral( "Calculate GPS bearing from travel direction" ) ) SIP_SKIP; +const QgsSettingsEntryBool *QgsGpsConnection::settingGpsBearingFromTravelDirection = new QgsSettingsEntryBool( QStringLiteral( "calculate-bearing-from-travel" ), QgsSettingsTree::sTreeGps, false, QStringLiteral( "Calculate GPS bearing from travel direction" ) ) SIP_SKIP; -const QgsSettingsEntryBool *QgsGpsConnection::settingGpsApplyLeapSecondsCorrection = new QgsSettingsEntryBool( QStringLiteral( "apply-leap-seconds-correction" ), QgsSettings::sTreeGps, true, QStringLiteral( "Whether leap seconds corrections should be applied to GPS timestamps" ) ) SIP_SKIP; +const QgsSettingsEntryBool *QgsGpsConnection::settingGpsApplyLeapSecondsCorrection = new QgsSettingsEntryBool( QStringLiteral( "apply-leap-seconds-correction" ), QgsSettingsTree::sTreeGps, true, QStringLiteral( "Whether leap seconds corrections should be applied to GPS timestamps" ) ) SIP_SKIP; -const QgsSettingsEntryInteger *QgsGpsConnection::settingGpsLeapSeconds = new QgsSettingsEntryInteger( QStringLiteral( "leap-seconds" ), QgsSettings::sTreeGps, 18, QStringLiteral( "Leap seconds correction amount (in seconds)" ) ) SIP_SKIP; +const QgsSettingsEntryInteger *QgsGpsConnection::settingGpsLeapSeconds = new QgsSettingsEntryInteger( QStringLiteral( "leap-seconds" ), QgsSettingsTree::sTreeGps, 18, QStringLiteral( "Leap seconds correction amount (in seconds)" ) ) SIP_SKIP; -const QgsSettingsEntryString *QgsGpsConnection::settingsGpsTimeStampTimeZone = new QgsSettingsEntryString( QStringLiteral( "timestamp-time-zone" ), QgsSettings::sTreeGps, QString(), QStringLiteral( "GPS time stamp time zone" ) ) SIP_SKIP; +const QgsSettingsEntryString *QgsGpsConnection::settingsGpsTimeStampTimeZone = new QgsSettingsEntryString( QStringLiteral( "timestamp-time-zone" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPS time stamp time zone" ) ) SIP_SKIP; -const QgsSettingsEntryInteger *QgsGpsConnection::settingsGpsTimeStampOffsetFromUtc = new QgsSettingsEntryInteger( QStringLiteral( "timestamp-offset-from-utc" ), QgsSettings::sTreeGps, 0, QStringLiteral( "GPS time stamp offset from UTC (in seconds)" ) ) SIP_SKIP; +const QgsSettingsEntryInteger *QgsGpsConnection::settingsGpsTimeStampOffsetFromUtc = new QgsSettingsEntryInteger( QStringLiteral( "timestamp-offset-from-utc" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "GPS time stamp offset from UTC (in seconds)" ) ) SIP_SKIP; QgsGpsConnection::QgsGpsConnection( QIODevice *dev ) : QObject( nullptr ) diff --git a/src/core/gps/qgsgpsdetector.cpp b/src/core/gps/qgsgpsdetector.cpp index 99a5bc9b2bc..5891c045efe 100644 --- a/src/core/gps/qgsgpsdetector.cpp +++ b/src/core/gps/qgsgpsdetector.cpp @@ -36,10 +36,10 @@ #include #include -const QgsSettingsEntryEnumFlag *QgsGpsDetector::settingsGpsFlowControl = new QgsSettingsEntryEnumFlag( QStringLiteral( "flow-control" ), QgsSettings::sTreeGps, QSerialPort::NoFlowControl ); -const QgsSettingsEntryEnumFlag *QgsGpsDetector::settingsGpsStopBits = new QgsSettingsEntryEnumFlag( QStringLiteral( "stop-bits" ), QgsSettings::sTreeGps, QSerialPort::OneStop ); -const QgsSettingsEntryEnumFlag *QgsGpsDetector::settingsGpsDataBits = new QgsSettingsEntryEnumFlag( QStringLiteral( "data-bits" ), QgsSettings::sTreeGps, QSerialPort::Data8 ); -const QgsSettingsEntryEnumFlag *QgsGpsDetector::settingsGpsParity = new QgsSettingsEntryEnumFlag( QStringLiteral( "parity" ), QgsSettings::sTreeGps, QSerialPort::NoParity ); +const QgsSettingsEntryEnumFlag *QgsGpsDetector::settingsGpsFlowControl = new QgsSettingsEntryEnumFlag( QStringLiteral( "flow-control" ), QgsSettingsTree::sTreeGps, QSerialPort::NoFlowControl ); +const QgsSettingsEntryEnumFlag *QgsGpsDetector::settingsGpsStopBits = new QgsSettingsEntryEnumFlag( QStringLiteral( "stop-bits" ), QgsSettingsTree::sTreeGps, QSerialPort::OneStop ); +const QgsSettingsEntryEnumFlag *QgsGpsDetector::settingsGpsDataBits = new QgsSettingsEntryEnumFlag( QStringLiteral( "data-bits" ), QgsSettingsTree::sTreeGps, QSerialPort::Data8 ); +const QgsSettingsEntryEnumFlag *QgsGpsDetector::settingsGpsParity = new QgsSettingsEntryEnumFlag( QStringLiteral( "parity" ), QgsSettingsTree::sTreeGps, QSerialPort::NoParity ); #endif QList< QPair > QgsGpsDetector::availablePorts() diff --git a/src/core/gps/qgsgpslogger.cpp b/src/core/gps/qgsgpslogger.cpp index 027dfd3da45..0aed2eb9808 100644 --- a/src/core/gps/qgsgpslogger.cpp +++ b/src/core/gps/qgsgpslogger.cpp @@ -26,16 +26,16 @@ #include "qgssettingsentryimpl.h" #include "qgssettingsentryenumflag.h" -const QgsSettingsEntryDouble *QgsGpsLogger::settingsDistanceThreshold = new QgsSettingsEntryDouble( QStringLiteral( "distanceThreshold" ), QgsSettings::sTreeGps, 0 ); -const QgsSettingsEntryBool *QgsGpsLogger::settingsApplyLeapSeconds = new QgsSettingsEntryBool( QStringLiteral( "applyLeapSeconds" ), QgsSettings::sTreeGps, true ); -const QgsSettingsEntryString *QgsGpsLogger::settingsTimestampTimeZone = new QgsSettingsEntryString( QStringLiteral( "timestampTimeZone" ), QgsSettings::sTreeGps, QString() ); -const QgsSettingsEntryInteger *QgsGpsLogger::settingsTimeStampFormat = new QgsSettingsEntryInteger( QStringLiteral( "timeStampFormat" ), QgsSettings::sTreeGps, Qt::LocalTime ); -const QgsSettingsEntryInteger *QgsGpsLogger::settingsLeapSecondsCorrection = new QgsSettingsEntryInteger( QStringLiteral( "leapSecondsCorrection" ), QgsSettings::sTreeGps, 18 ); -const QgsSettingsEntryInteger *QgsGpsLogger::settingsAcquisitionInterval = new QgsSettingsEntryInteger( QStringLiteral( "acquisitionInterval" ), QgsSettings::sTreeGps, 0 ); +const QgsSettingsEntryDouble *QgsGpsLogger::settingsDistanceThreshold = new QgsSettingsEntryDouble( QStringLiteral( "distanceThreshold" ), QgsSettingsTree::sTreeGps, 0 ); +const QgsSettingsEntryBool *QgsGpsLogger::settingsApplyLeapSeconds = new QgsSettingsEntryBool( QStringLiteral( "applyLeapSeconds" ), QgsSettingsTree::sTreeGps, true ); +const QgsSettingsEntryString *QgsGpsLogger::settingsTimestampTimeZone = new QgsSettingsEntryString( QStringLiteral( "timestampTimeZone" ), QgsSettingsTree::sTreeGps, QString() ); +const QgsSettingsEntryInteger *QgsGpsLogger::settingsTimeStampFormat = new QgsSettingsEntryInteger( QStringLiteral( "timeStampFormat" ), QgsSettingsTree::sTreeGps, Qt::LocalTime ); +const QgsSettingsEntryInteger *QgsGpsLogger::settingsLeapSecondsCorrection = new QgsSettingsEntryInteger( QStringLiteral( "leapSecondsCorrection" ), QgsSettingsTree::sTreeGps, 18 ); +const QgsSettingsEntryInteger *QgsGpsLogger::settingsAcquisitionInterval = new QgsSettingsEntryInteger( QStringLiteral( "acquisitionInterval" ), QgsSettingsTree::sTreeGps, 0 ); -const QgsSettingsEntryEnumFlag *QgsGpsLogger::settingsGpsMValueComponent = new QgsSettingsEntryEnumFlag( QStringLiteral( "m-value-attribute" ), QgsSettings::sTreeGps, Qgis::GpsInformationComponent::Timestamp, QStringLiteral( "Which GPS attribute should be stored in geometry m values" ) ) SIP_SKIP; +const QgsSettingsEntryEnumFlag *QgsGpsLogger::settingsGpsMValueComponent = new QgsSettingsEntryEnumFlag( QStringLiteral( "m-value-attribute" ), QgsSettingsTree::sTreeGps, Qgis::GpsInformationComponent::Timestamp, QStringLiteral( "Which GPS attribute should be stored in geometry m values" ) ) SIP_SKIP; -const QgsSettingsEntryBool *QgsGpsLogger::settingsGpsStoreAttributeInMValues = new QgsSettingsEntryBool( QStringLiteral( "store-attribute-in-m-values" ), QgsSettings::sTreeGps, false, QStringLiteral( "Whether GPS attributes should be stored in geometry m values" ) ) SIP_SKIP; +const QgsSettingsEntryBool *QgsGpsLogger::settingsGpsStoreAttributeInMValues = new QgsSettingsEntryBool( QStringLiteral( "store-attribute-in-m-values" ), QgsSettingsTree::sTreeGps, false, QStringLiteral( "Whether GPS attributes should be stored in geometry m values" ) ) SIP_SKIP; QgsGpsLogger::QgsGpsLogger( QgsGpsConnection *connection, QObject *parent ) : QObject( parent ) diff --git a/src/core/layout/qgslayout.cpp b/src/core/layout/qgslayout.cpp index 1a79825f2bb..d9441531257 100644 --- a/src/core/layout/qgslayout.cpp +++ b/src/core/layout/qgslayout.cpp @@ -33,7 +33,7 @@ #include "qgsstyleentityvisitor.h" #include "qgsruntimeprofiler.h" -const QgsSettingsEntryStringList *QgsLayout::settingsSearchPathForTemplates = new QgsSettingsEntryStringList( QStringLiteral( "search-paths-for-templates" ), QgsSettings::sTreeLayout, QStringList(), QObject::tr( "Search path for templates" ) ); +const QgsSettingsEntryStringList *QgsLayout::settingsSearchPathForTemplates = new QgsSettingsEntryStringList( QStringLiteral( "search-paths-for-templates" ), QgsSettingsTree::sTreeLayout, QStringList(), QObject::tr( "Search path for templates" ) ); QgsLayout::QgsLayout( QgsProject *project ) : mProject( project ) diff --git a/src/core/maprenderer/qgsmaprendererjob.cpp b/src/core/maprenderer/qgsmaprendererjob.cpp index 1f7e3d6dd7c..079d01a6e20 100644 --- a/src/core/maprenderer/qgsmaprendererjob.cpp +++ b/src/core/maprenderer/qgsmaprendererjob.cpp @@ -48,7 +48,7 @@ #include "qgsrasterrenderer.h" #include "qgselevationmap.h" -const QgsSettingsEntryBool *QgsMapRendererJob::settingsLogCanvasRefreshEvent = new QgsSettingsEntryBool( QStringLiteral( "logCanvasRefreshEvent" ), QgsSettings::sTreeMap, false ); +const QgsSettingsEntryBool *QgsMapRendererJob::settingsLogCanvasRefreshEvent = new QgsSettingsEntryBool( QStringLiteral( "logCanvasRefreshEvent" ), QgsSettingsTree::sTreeMap, false ); ///@cond PRIVATE diff --git a/src/core/network/qgsnetworkaccessmanager.cpp b/src/core/network/qgsnetworkaccessmanager.cpp index cb1ff93de75..7fa466ec52b 100644 --- a/src/core/network/qgsnetworkaccessmanager.cpp +++ b/src/core/network/qgsnetworkaccessmanager.cpp @@ -41,7 +41,7 @@ #include #include -const QgsSettingsEntryInteger *QgsNetworkAccessManager::settingsNetworkTimeout = new QgsSettingsEntryInteger( QStringLiteral( "network-timeout" ), QgsSettings::sTreeNetwork, 60000, QObject::tr( "Network timeout" ) ); +const QgsSettingsEntryInteger *QgsNetworkAccessManager::settingsNetworkTimeout = new QgsSettingsEntryInteger( QStringLiteral( "network-timeout" ), QgsSettingsTree::sTreeNetwork, 60000, QObject::tr( "Network timeout" ) ); #ifndef QT_NO_SSL #include diff --git a/src/core/network/qgsnewsfeedparser.cpp b/src/core/network/qgsnewsfeedparser.cpp index b6bbd35c27e..f8064727553 100644 --- a/src/core/network/qgsnewsfeedparser.cpp +++ b/src/core/network/qgsnewsfeedparser.cpp @@ -28,13 +28,13 @@ #include #include -const QgsSettingsEntryInteger64 *QgsNewsFeedParser::settingsFeedLastFetchTime = new QgsSettingsEntryInteger64( QStringLiteral( "%1/lastFetchTime" ), QgsSettings::sTreeCore, 0, QObject::tr( "Feed last fetch time" ), Qgis::SettingsOptions(), 0 ); +const QgsSettingsEntryInteger64 *QgsNewsFeedParser::settingsFeedLastFetchTime = new QgsSettingsEntryInteger64( QStringLiteral( "%1/lastFetchTime" ), QgsSettingsTree::sTreeCore, 0, QObject::tr( "Feed last fetch time" ), Qgis::SettingsOptions(), 0 ); -const QgsSettingsEntryString *QgsNewsFeedParser::settingsFeedLanguage = new QgsSettingsEntryString( QStringLiteral( "%1/lang" ), QgsSettings::sTreeCore, QString(), QObject::tr( "Feed language" ) ); +const QgsSettingsEntryString *QgsNewsFeedParser::settingsFeedLanguage = new QgsSettingsEntryString( QStringLiteral( "%1/lang" ), QgsSettingsTree::sTreeCore, QString(), QObject::tr( "Feed language" ) ); -const QgsSettingsEntryDouble *QgsNewsFeedParser::settingsFeedLatitude = new QgsSettingsEntryDouble( QStringLiteral( "%1/latitude" ), QgsSettings::sTreeCore, 0.0, QObject::tr( "Feed latitude" ) ); +const QgsSettingsEntryDouble *QgsNewsFeedParser::settingsFeedLatitude = new QgsSettingsEntryDouble( QStringLiteral( "%1/latitude" ), QgsSettingsTree::sTreeCore, 0.0, QObject::tr( "Feed latitude" ) ); -const QgsSettingsEntryDouble *QgsNewsFeedParser::settingsFeedLongitude = new QgsSettingsEntryDouble( QStringLiteral( "%1/longitude" ), QgsSettings::sTreeCore, 0.0, QObject::tr( "Feed longitude" ) ); +const QgsSettingsEntryDouble *QgsNewsFeedParser::settingsFeedLongitude = new QgsSettingsEntryDouble( QStringLiteral( "%1/longitude" ), QgsSettingsTree::sTreeCore, 0.0, QObject::tr( "Feed longitude" ) ); QgsNewsFeedParser::QgsNewsFeedParser( const QUrl &feedUrl, const QString &authcfg, QObject *parent ) : QObject( parent ) diff --git a/src/core/processing/qgsprocessing.h b/src/core/processing/qgsprocessing.h index 02bdfcc4579..a4a5c9340d6 100644 --- a/src/core/processing/qgsprocessing.h +++ b/src/core/processing/qgsprocessing.h @@ -20,6 +20,7 @@ #include "qgis_core.h" #include "qgssettingsentryimpl.h" +#include "qgssettingstree.h" #include // @@ -109,7 +110,7 @@ class CORE_EXPORT QgsProcessing static const QString TEMPORARY_OUTPUT; #ifndef SIP_RUN - static inline QgsSettingsTreeNode *sTreeConfiguration = QgsSettings::sTreeQgis->createChildNode( QStringLiteral( "configuration" ) ); + static inline QgsSettingsTreeNode *sTreeConfiguration = QgsSettingsTree::sTreeQgis->createChildNode( QStringLiteral( "configuration" ) ); //! Settings entry prefer filename as layer name static const QgsSettingsEntryBool *settingsPreferFilenameAsLayerName; diff --git a/src/core/qgsapplication.cpp b/src/core/qgsapplication.cpp index 148d8b1470a..b16a173e439 100644 --- a/src/core/qgsapplication.cpp +++ b/src/core/qgsapplication.cpp @@ -115,15 +115,15 @@ #include #include -const QgsSettingsEntryString *QgsApplication::settingsLocaleUserLocale = new QgsSettingsEntryString( QStringLiteral( "userLocale" ), QgsSettings::sTreeLocale, QString() ); +const QgsSettingsEntryString *QgsApplication::settingsLocaleUserLocale = new QgsSettingsEntryString( QStringLiteral( "userLocale" ), QgsSettingsTree::sTreeLocale, QString() ); -const QgsSettingsEntryBool *QgsApplication::settingsLocaleOverrideFlag = new QgsSettingsEntryBool( QStringLiteral( "overrideFlag" ), QgsSettings::sTreeLocale, false ); +const QgsSettingsEntryBool *QgsApplication::settingsLocaleOverrideFlag = new QgsSettingsEntryBool( QStringLiteral( "overrideFlag" ), QgsSettingsTree::sTreeLocale, false ); -const QgsSettingsEntryString *QgsApplication::settingsLocaleGlobalLocale = new QgsSettingsEntryString( QStringLiteral( "globalLocale" ), QgsSettings::sTreeLocale, QString() ); +const QgsSettingsEntryString *QgsApplication::settingsLocaleGlobalLocale = new QgsSettingsEntryString( QStringLiteral( "globalLocale" ), QgsSettingsTree::sTreeLocale, QString() ); -const QgsSettingsEntryBool *QgsApplication::settingsLocaleShowGroupSeparator = new QgsSettingsEntryBool( QStringLiteral( "showGroupSeparator" ), QgsSettings::sTreeLocale, false ); +const QgsSettingsEntryBool *QgsApplication::settingsLocaleShowGroupSeparator = new QgsSettingsEntryBool( QStringLiteral( "showGroupSeparator" ), QgsSettingsTree::sTreeLocale, false ); -const QgsSettingsEntryStringList *QgsApplication::settingsSearchPathsForSVG = new QgsSettingsEntryStringList( QStringLiteral( "searchPathsForSVG" ), QgsSettings::sTreeSvg, QStringList() ); +const QgsSettingsEntryStringList *QgsApplication::settingsSearchPathsForSVG = new QgsSettingsEntryStringList( QStringLiteral( "searchPathsForSVG" ), QgsSettingsTree::sTreeSvg, QStringList() ); #ifndef Q_OS_WIN #include diff --git a/src/core/qgsgeometryoptions.cpp b/src/core/qgsgeometryoptions.cpp index 0ec0beef597..a67cbc47142 100644 --- a/src/core/qgsgeometryoptions.cpp +++ b/src/core/qgsgeometryoptions.cpp @@ -19,7 +19,7 @@ #include "qgsxmlutils.h" -const QgsSettingsEntryString *QgsGeometryOptions::settingsGeometryValidationDefaultChecks = new QgsSettingsEntryString( QStringLiteral( "default_checks" ), QgsSettings::sTreeGeometryValidation, QString() ); +const QgsSettingsEntryString *QgsGeometryOptions::settingsGeometryValidationDefaultChecks = new QgsSettingsEntryString( QStringLiteral( "default_checks" ), QgsSettingsTree::sTreeGeometryValidation, QString() ); QgsGeometryOptions::QgsGeometryOptions() { diff --git a/src/core/qgslocalizeddatapathregistry.cpp b/src/core/qgslocalizeddatapathregistry.cpp index 3aa745a1116..a4abe93e9ce 100644 --- a/src/core/qgslocalizeddatapathregistry.cpp +++ b/src/core/qgslocalizeddatapathregistry.cpp @@ -21,7 +21,7 @@ #include "qgsreadwritelocker.h" -const QgsSettingsEntryStringList *QgsLocalizedDataPathRegistry::settingsLocalizedDataPaths = new QgsSettingsEntryStringList( QStringLiteral( "localized_data_paths" ), QgsSettings::sTreeQgis, QStringList() ); +const QgsSettingsEntryStringList *QgsLocalizedDataPathRegistry::settingsLocalizedDataPaths = new QgsSettingsEntryStringList( QStringLiteral( "localized_data_paths" ), QgsSettingsTree::sTreeQgis, QStringList() ); QgsLocalizedDataPathRegistry::QgsLocalizedDataPathRegistry() { diff --git a/src/core/qgsowsconnection.h b/src/core/qgsowsconnection.h index ff975dbba7a..6bdca72a4ef 100644 --- a/src/core/qgsowsconnection.h +++ b/src/core/qgsowsconnection.h @@ -46,7 +46,7 @@ template class QgsSettingsEntryEnumFlag; class CORE_EXPORT QgsXyzConnectionSettings SIP_SKIP { public: - static inline QgsSettingsTreeNamedListNode *sTreeXyzConnections = QgsSettings::sTreeConnections->createNamedListNode( QStringLiteral( "xyz" ), QgsSettingsTreeNode::Option::NamedListSelectedItemSetting ); + static inline QgsSettingsTreeNamedListNode *sTreeXyzConnections = QgsSettingsTree::sTreeConnections->createNamedListNode( QStringLiteral( "xyz" ), QgsSettingsTreeNode::Option::NamedListSelectedItemSetting ); static const QgsSettingsEntryString *settingsUrl; static const QgsSettingsEntryVariantMap *settingsHeaders; @@ -70,7 +70,7 @@ class CORE_EXPORT QgsXyzConnectionSettings SIP_SKIP class CORE_EXPORT QgsArcGisConnectionSettings SIP_SKIP { public: - static inline QgsSettingsTreeNamedListNode *sTreeConnectionArcgis = QgsSettings::sTreeConnections->createNamedListNode( QStringLiteral( "arcgisfeatureserver" ), QgsSettingsTreeNamedListNode::Option::NamedListSelectedItemSetting ); + static inline QgsSettingsTreeNamedListNode *sTreeConnectionArcgis = QgsSettingsTree::sTreeConnections->createNamedListNode( QStringLiteral( "arcgisfeatureserver" ), QgsSettingsTreeNamedListNode::Option::NamedListSelectedItemSetting ); static const QgsSettingsEntryString *settingsUrl; static const QgsSettingsEntryString *settingsAuthcfg; @@ -93,7 +93,7 @@ class CORE_EXPORT QgsOwsConnection : public QObject public: #ifndef SIP_RUN - static inline QgsSettingsTreeNamedListNode *sTtreeOwsServices = QgsSettings::sTreeConnections->createNamedListNode( QStringLiteral( "ows" ) ); + static inline QgsSettingsTreeNamedListNode *sTtreeOwsServices = QgsSettingsTree::sTreeConnections->createNamedListNode( QStringLiteral( "ows" ) ); static inline QgsSettingsTreeNamedListNode *sTreeOwsConnections = sTtreeOwsServices->createNamedListNode( QStringLiteral( "connections" ) ); static const QgsSettingsEntryString *settingsUrl; diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp index afcc3c7f67f..fda7aaa86d1 100644 --- a/src/core/raster/qgsrasterlayer.cpp +++ b/src/core/raster/qgsrasterlayer.cpp @@ -84,8 +84,8 @@ email : tim at linfiniti.com #include #include -const QgsSettingsEntryDouble *QgsRasterLayer::settingsRasterDefaultOversampling = new QgsSettingsEntryDouble( QStringLiteral( "default-oversampling" ), QgsSettings::sTreeRaster, 2.0 ); -const QgsSettingsEntryBool *QgsRasterLayer::settingsRasterDefaultEarlyResampling = new QgsSettingsEntryBool( QStringLiteral( "default-early-resampling" ), QgsSettings::sTreeRaster, false ); +const QgsSettingsEntryDouble *QgsRasterLayer::settingsRasterDefaultOversampling = new QgsSettingsEntryDouble( QStringLiteral( "default-oversampling" ), QgsSettingsTree::sTreeRaster, 2.0 ); +const QgsSettingsEntryBool *QgsRasterLayer::settingsRasterDefaultEarlyResampling = new QgsSettingsEntryBool( QStringLiteral( "default-early-resampling" ), QgsSettingsTree::sTreeRaster, false ); #define ERR(message) QGS_ERROR_MESSAGE(message,"Raster layer") diff --git a/src/core/settings/qgssettingsentryimpl.h b/src/core/settings/qgssettingsentryimpl.h index 33180d5bc18..0bdeb43789c 100644 --- a/src/core/settings/qgssettingsentryimpl.h +++ b/src/core/settings/qgssettingsentryimpl.h @@ -85,7 +85,7 @@ class CORE_EXPORT QgsSettingsEntryVariant : public QgsSettingsEntryByReference const QString &description = QString(), Qgis::SettingsOptions options = Qgis::SettingsOptions() ) SIP_THROW( QgsSettingsException ) SIP_TRANSFER; % MethodCode - sipCpp = new sipQgsSettingsEntryBool( QgsSettingsEntryBool( *a0, QgsSettings::createPluginTreeNode( *a1 ), a2, *a3, *a4 ) ); + sipCpp = new sipQgsSettingsEntryBool( QgsSettingsEntryBool( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), a2, *a3, *a4 ) ); % End #endif @@ -451,7 +451,7 @@ class CORE_EXPORT QgsSettingsEntryInteger : public QgsSettingsEntryByValue int minValue = std::numeric_limits::min(), int maxValue = std::numeric_limits::max() ) SIP_THROW( QgsSettingsException ) SIP_TRANSFER; % MethodCode - sipCpp = new sipQgsSettingsEntryInteger( QgsSettingsEntryInteger( *a0, QgsSettings::createPluginTreeNode( *a1 ), a2, *a3, *a4, a5, a6 ) ); + sipCpp = new sipQgsSettingsEntryInteger( QgsSettingsEntryInteger( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), a2, *a3, *a4, a5, a6 ) ); % End #endif @@ -643,7 +643,7 @@ class CORE_EXPORT QgsSettingsEntryDouble : public QgsSettingsEntryByValue::max(), int displayDecimals = 1 ) SIP_THROW( QgsSettingsException ) SIP_TRANSFER; % MethodCode - sipCpp = new sipQgsSettingsEntryDouble( QgsSettingsEntryDouble( *a0, QgsSettings::createPluginTreeNode( *a1 ), a2, *a3, *a4, a5, a6, a7 ) ); + sipCpp = new sipQgsSettingsEntryDouble( QgsSettingsEntryDouble( *a0, QgsSettingsTree::createPluginTreeNode( *a1 ), a2, *a3, *a4, a5, a6, a7 ) ); % End #endif @@ -754,7 +754,7 @@ class CORE_EXPORT QgsSettingsEntryColor : public QgsSettingsEntryByReference *QgsSettingsRegistryCore::settingsDigitizingDefaultSnapMode = new QgsSettingsEntryEnumFlag( QStringLiteral( "default-snap-mode" ), QgsSettings::sTreeDigitizing, Qgis::SnappingMode::AllLayers ); +const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingDefaultSnapMode = new QgsSettingsEntryEnumFlag( QStringLiteral( "default-snap-mode" ), QgsSettingsTree::sTreeDigitizing, Qgis::SnappingMode::AllLayers ); -const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingDefaultSnapType = new QgsSettingsEntryEnumFlag( QStringLiteral( "default-snap-type" ), QgsSettings::sTreeDigitizing, Qgis::SnappingType::Vertex ); +const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingDefaultSnapType = new QgsSettingsEntryEnumFlag( QStringLiteral( "default-snap-type" ), QgsSettingsTree::sTreeDigitizing, Qgis::SnappingType::Vertex ); -const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingDefaultSnappingToleranceUnit = new QgsSettingsEntryEnumFlag( QStringLiteral( "default-snapping-tolerance-unit" ), QgsSettings::sTreeDigitizing, Qgis::DEFAULT_SNAP_UNITS ); +const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingDefaultSnappingToleranceUnit = new QgsSettingsEntryEnumFlag( QStringLiteral( "default-snapping-tolerance-unit" ), QgsSettingsTree::sTreeDigitizing, Qgis::DEFAULT_SNAP_UNITS ); -const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingSearchRadiusVertexEditUnit = new QgsSettingsEntryEnumFlag( QStringLiteral( "search-radius-vertex-edit-unit" ), QgsSettings::sTreeDigitizing, QgsTolerance::Pixels ); +const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingSearchRadiusVertexEditUnit = new QgsSettingsEntryEnumFlag( QStringLiteral( "search-radius-vertex-edit-unit" ), QgsSettingsTree::sTreeDigitizing, QgsTolerance::Pixels ); -const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingOffsetJoinStyle = new QgsSettingsEntryEnumFlag( QStringLiteral( "offset-join-style" ), QgsSettings::sTreeDigitizing, Qgis::JoinStyle::Round ); +const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingOffsetJoinStyle = new QgsSettingsEntryEnumFlag( QStringLiteral( "offset-join-style" ), QgsSettingsTree::sTreeDigitizing, Qgis::JoinStyle::Round ); -const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingOffsetCapStyle = new QgsSettingsEntryEnumFlag( QStringLiteral( "offset-cap-style" ), QgsSettings::sTreeDigitizing, Qgis::EndCapStyle::Round ); +const QgsSettingsEntryEnumFlag *QgsSettingsRegistryCore::settingsDigitizingOffsetCapStyle = new QgsSettingsEntryEnumFlag( QStringLiteral( "offset-cap-style" ), QgsSettingsTree::sTreeDigitizing, Qgis::EndCapStyle::Round ); -const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsDigitizingStreamTolerance = new QgsSettingsEntryInteger( QStringLiteral( "stream-tolerance" ), QgsSettings::sTreeDigitizing, 2 ); +const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsDigitizingStreamTolerance = new QgsSettingsEntryInteger( QStringLiteral( "stream-tolerance" ), QgsSettingsTree::sTreeDigitizing, 2 ); -const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsDigitizingLineWidth = new QgsSettingsEntryInteger( QStringLiteral( "line-width" ), QgsSettings::sTreeDigitizing, 1 ); +const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsDigitizingLineWidth = new QgsSettingsEntryInteger( QStringLiteral( "line-width" ), QgsSettingsTree::sTreeDigitizing, 1 ); -const QgsSettingsEntryColor *QgsSettingsRegistryCore::settingsDigitizingLineColor = new QgsSettingsEntryColor( QStringLiteral( "line-color" ), QgsSettings::sTreeDigitizing, QColor( 255, 0, 0, 200 ) ); +const QgsSettingsEntryColor *QgsSettingsRegistryCore::settingsDigitizingLineColor = new QgsSettingsEntryColor( QStringLiteral( "line-color" ), QgsSettingsTree::sTreeDigitizing, QColor( 255, 0, 0, 200 ) ); -const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingLineColorAlphaScale = new QgsSettingsEntryDouble( QStringLiteral( "line-color-alpha-scale" ), QgsSettings::sTreeDigitizing, 0.75 ); +const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingLineColorAlphaScale = new QgsSettingsEntryDouble( QStringLiteral( "line-color-alpha-scale" ), QgsSettingsTree::sTreeDigitizing, 0.75 ); -const QgsSettingsEntryColor *QgsSettingsRegistryCore::settingsDigitizingFillColor = new QgsSettingsEntryColor( QStringLiteral( "fill-color" ), QgsSettings::sTreeDigitizing, QColor( 255, 0, 0, 30 ) ); +const QgsSettingsEntryColor *QgsSettingsRegistryCore::settingsDigitizingFillColor = new QgsSettingsEntryColor( QStringLiteral( "fill-color" ), QgsSettingsTree::sTreeDigitizing, QColor( 255, 0, 0, 30 ) ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingLineGhost = new QgsSettingsEntryBool( QStringLiteral( "line-ghost" ), QgsSettings::sTreeDigitizing, false ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingLineGhost = new QgsSettingsEntryBool( QStringLiteral( "line-ghost" ), QgsSettingsTree::sTreeDigitizing, false ); -const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingDefaultZValue = new QgsSettingsEntryDouble( QStringLiteral( "default-z-value" ), QgsSettings::sTreeDigitizing, Qgis::DEFAULT_Z_COORDINATE ); +const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingDefaultZValue = new QgsSettingsEntryDouble( QStringLiteral( "default-z-value" ), QgsSettingsTree::sTreeDigitizing, Qgis::DEFAULT_Z_COORDINATE ); -const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingDefaultMValue = new QgsSettingsEntryDouble( QStringLiteral( "default-m-value" ), QgsSettings::sTreeDigitizing, Qgis::DEFAULT_M_COORDINATE ); +const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingDefaultMValue = new QgsSettingsEntryDouble( QStringLiteral( "default-m-value" ), QgsSettingsTree::sTreeDigitizing, Qgis::DEFAULT_M_COORDINATE ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingDefaultSnapEnabled = new QgsSettingsEntryBool( QStringLiteral( "default-snap-enabled" ), QgsSettings::sTreeDigitizing, false ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingDefaultSnapEnabled = new QgsSettingsEntryBool( QStringLiteral( "default-snap-enabled" ), QgsSettingsTree::sTreeDigitizing, false ); -const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingDefaultSnappingTolerance = new QgsSettingsEntryDouble( QStringLiteral( "default-snapping-tolerance" ), QgsSettings::sTreeDigitizing, Qgis::DEFAULT_SNAP_TOLERANCE ); +const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingDefaultSnappingTolerance = new QgsSettingsEntryDouble( QStringLiteral( "default-snapping-tolerance" ), QgsSettingsTree::sTreeDigitizing, Qgis::DEFAULT_SNAP_TOLERANCE ); -const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingSearchRadiusVertexEdit = new QgsSettingsEntryDouble( QStringLiteral( "search-radius-vertex-edit" ), QgsSettings::sTreeDigitizing, 10 ); +const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingSearchRadiusVertexEdit = new QgsSettingsEntryDouble( QStringLiteral( "search-radius-vertex-edit" ), QgsSettingsTree::sTreeDigitizing, 10 ); -const QgsSettingsEntryColor *QgsSettingsRegistryCore::settingsDigitizingSnapColor = new QgsSettingsEntryColor( QStringLiteral( "snap-color" ), QgsSettings::sTreeDigitizing, QColor( Qt::magenta ) ); +const QgsSettingsEntryColor *QgsSettingsRegistryCore::settingsDigitizingSnapColor = new QgsSettingsEntryColor( QStringLiteral( "snap-color" ), QgsSettingsTree::sTreeDigitizing, QColor( Qt::magenta ) ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingSnapTooltip = new QgsSettingsEntryBool( QStringLiteral( "snap-tooltip" ), QgsSettings::sTreeDigitizing, false ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingSnapTooltip = new QgsSettingsEntryBool( QStringLiteral( "snap-tooltip" ), QgsSettingsTree::sTreeDigitizing, false ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingSnapInvisibleFeature = new QgsSettingsEntryBool( QStringLiteral( "snap-invisible-feature" ), QgsSettings::sTreeDigitizing, false ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingSnapInvisibleFeature = new QgsSettingsEntryBool( QStringLiteral( "snap-invisible-feature" ), QgsSettingsTree::sTreeDigitizing, false ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingMarkerOnlyForSelected = new QgsSettingsEntryBool( QStringLiteral( "marker-only-for-selected" ), QgsSettings::sTreeDigitizing, true ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingMarkerOnlyForSelected = new QgsSettingsEntryBool( QStringLiteral( "marker-only-for-selected" ), QgsSettingsTree::sTreeDigitizing, true ); -const QgsSettingsEntryString *QgsSettingsRegistryCore::settingsDigitizingMarkerStyle = new QgsSettingsEntryString( QStringLiteral( "marker-style" ), QgsSettings::sTreeDigitizing, "Cross" ); +const QgsSettingsEntryString *QgsSettingsRegistryCore::settingsDigitizingMarkerStyle = new QgsSettingsEntryString( QStringLiteral( "marker-style" ), QgsSettingsTree::sTreeDigitizing, "Cross" ); -const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingMarkerSizeMm = new QgsSettingsEntryDouble( QStringLiteral( "marker-size-mm" ), QgsSettings::sTreeDigitizing, 2.0 ); +const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingMarkerSizeMm = new QgsSettingsEntryDouble( QStringLiteral( "marker-size-mm" ), QgsSettingsTree::sTreeDigitizing, 2.0 ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingReuseLastValues = new QgsSettingsEntryBool( QStringLiteral( "reuse-last-values" ), QgsSettings::sTreeDigitizing, false ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingReuseLastValues = new QgsSettingsEntryBool( QStringLiteral( "reuse-last-values" ), QgsSettingsTree::sTreeDigitizing, false ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingDisableEnterAttributeValuesDialog = new QgsSettingsEntryBool( QStringLiteral( "disable-enter-attribute-values-dialog" ), QgsSettings::sTreeDigitizing, false ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingDisableEnterAttributeValuesDialog = new QgsSettingsEntryBool( QStringLiteral( "disable-enter-attribute-values-dialog" ), QgsSettingsTree::sTreeDigitizing, false ); -const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsDigitizingValidateGeometries = new QgsSettingsEntryInteger( QStringLiteral( "validate-geometries" ), QgsSettings::sTreeDigitizing, 1 ); +const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsDigitizingValidateGeometries = new QgsSettingsEntryInteger( QStringLiteral( "validate-geometries" ), QgsSettingsTree::sTreeDigitizing, 1 ); -const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsDigitizingOffsetQuadSeg = new QgsSettingsEntryInteger( QStringLiteral( "offset-quad-seg" ), QgsSettings::sTreeDigitizing, 8 ); +const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsDigitizingOffsetQuadSeg = new QgsSettingsEntryInteger( QStringLiteral( "offset-quad-seg" ), QgsSettingsTree::sTreeDigitizing, 8 ); -const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingOffsetMiterLimit = new QgsSettingsEntryDouble( QStringLiteral( "offset-miter-limit" ), QgsSettings::sTreeDigitizing, 5.0 ); +const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingOffsetMiterLimit = new QgsSettingsEntryDouble( QStringLiteral( "offset-miter-limit" ), QgsSettingsTree::sTreeDigitizing, 5.0 ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingConvertToCurve = new QgsSettingsEntryBool( QStringLiteral( "convert-to-curve" ), QgsSettings::sTreeDigitizing, false ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingConvertToCurve = new QgsSettingsEntryBool( QStringLiteral( "convert-to-curve" ), QgsSettingsTree::sTreeDigitizing, false ); -const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingConvertToCurveAngleTolerance = new QgsSettingsEntryDouble( QStringLiteral( "convert-to-curve-angle-tolerance" ), QgsSettings::sTreeDigitizing, 1e-6 ); +const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingConvertToCurveAngleTolerance = new QgsSettingsEntryDouble( QStringLiteral( "convert-to-curve-angle-tolerance" ), QgsSettingsTree::sTreeDigitizing, 1e-6 ); -const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingConvertToCurveDistanceTolerance = new QgsSettingsEntryDouble( QStringLiteral( "convert-to-curve-distance-tolerance" ), QgsSettings::sTreeDigitizing, 1e-6 ); +const QgsSettingsEntryDouble *QgsSettingsRegistryCore::settingsDigitizingConvertToCurveDistanceTolerance = new QgsSettingsEntryDouble( QStringLiteral( "convert-to-curve-distance-tolerance" ), QgsSettingsTree::sTreeDigitizing, 1e-6 ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingOffsetShowAdvanced = new QgsSettingsEntryBool( QStringLiteral( "offset-show-advanced" ), QgsSettings::sTreeDigitizing, false ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsDigitizingOffsetShowAdvanced = new QgsSettingsEntryBool( QStringLiteral( "offset-show-advanced" ), QgsSettingsTree::sTreeDigitizing, false ); -const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsDigitizingTracingMaxFeatureCount = new QgsSettingsEntryInteger( QStringLiteral( "tracing-max-feature-count" ), QgsSettings::sTreeDigitizing, 10000 ); +const QgsSettingsEntryInteger *QgsSettingsRegistryCore::settingsDigitizingTracingMaxFeatureCount = new QgsSettingsEntryInteger( QStringLiteral( "tracing-max-feature-count" ), QgsSettingsTree::sTreeDigitizing, 10000 ); -const QgsSettingsEntryString *QgsSettingsRegistryCore::settingsGpsBabelPath = new QgsSettingsEntryString( QStringLiteral( "gpsbabelPath" ), QgsSettings::sTreeGps, QStringLiteral( "gpsbabel" ) ); +const QgsSettingsEntryString *QgsSettingsRegistryCore::settingsGpsBabelPath = new QgsSettingsEntryString( QStringLiteral( "gpsbabelPath" ), QgsSettingsTree::sTreeGps, QStringLiteral( "gpsbabel" ) ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsLayerTreeShowFeatureCountForNewLayers = new QgsSettingsEntryBool( QStringLiteral( "show-feature-count-for-new-layers" ), QgsSettings::sTreeLayerTree, false, QStringLiteral( "If true, feature counts will be shown in the layer tree for all newly added layers." ) ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsLayerTreeShowFeatureCountForNewLayers = new QgsSettingsEntryBool( QStringLiteral( "show-feature-count-for-new-layers" ), QgsSettingsTree::sTreeLayerTree, false, QStringLiteral( "If true, feature counts will be shown in the layer tree for all newly added layers." ) ); -const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsEnableWMSTilePrefetching = new QgsSettingsEntryBool( QStringLiteral( "enable_wms_tile_prefetch" ), QgsSettings::sTreeWms, false, QStringLiteral( "Whether to include WMS layers when rendering tiles adjacent to the visible map area" ) ); +const QgsSettingsEntryBool *QgsSettingsRegistryCore::settingsEnableWMSTilePrefetching = new QgsSettingsEntryBool( QStringLiteral( "enable_wms_tile_prefetch" ), QgsSettingsTree::sTreeWms, false, QStringLiteral( "Whether to include WMS layers when rendering tiles adjacent to the visible map area" ) ); QgsSettingsRegistryCore::QgsSettingsRegistryCore() : QgsSettingsRegistry() @@ -147,7 +147,7 @@ void QgsSettingsRegistryCore::migrateOldSettings() settingsDigitizingLineColor->copyValueFromKeys( QStringLiteral( "qgis/digitizing/line_color_red" ), QStringLiteral( "qgis/digitizing/line_color_green" ), QStringLiteral( "qgis/digitizing/line_color_blue" ), QStringLiteral( "qgis/digitizing/line_color_alpha" ) ); settingsDigitizingFillColor->copyValueFromKeys( QStringLiteral( "qgis/digitizing/fill_color_red" ), QStringLiteral( "qgis/digitizing/fill_color_green" ), QStringLiteral( "qgis/digitizing/fill_color_blue" ), QStringLiteral( "qgis/digitizing/fill_color_alpha" ) ); - const QList settings = QgsSettings::sTreeDigitizing->childrenSettings(); + const QList settings = QgsSettingsTree::sTreeDigitizing->childrenSettings(); for ( const QgsSettingsEntryBase *setting : settings ) { QString name = setting->name(); @@ -350,7 +350,7 @@ void QgsSettingsRegistryCore::backwardCompatibility() settingsDigitizingLineColor->copyValueToKeys( QStringLiteral( "qgis/digitizing/line_color_red" ), QStringLiteral( "qgis/digitizing/line_color_green" ), QStringLiteral( "qgis/digitizing/line_color_blue" ), QStringLiteral( "qgis/digitizing/line_color_alpha" ) ); settingsDigitizingFillColor->copyValueToKeys( QStringLiteral( "qgis/digitizing/fill_color_red" ), QStringLiteral( "qgis/digitizing/fill_color_green" ), QStringLiteral( "qgis/digitizing/fill_color_blue" ), QStringLiteral( "qgis/digitizing/fill_color_alpha" ) ); - const QList settings = QgsSettings::sTreeDigitizing->childrenSettings(); + const QList settings = QgsSettingsTree::sTreeDigitizing->childrenSettings(); for ( const QgsSettingsEntryBase *setting : settings ) { QString name = setting->name(); diff --git a/src/core/settings/qgssettingstree.h b/src/core/settings/qgssettingstree.h index 0920e436544..017f87e2cff 100644 --- a/src/core/settings/qgssettingstree.h +++ b/src/core/settings/qgssettingstree.h @@ -16,6 +16,8 @@ class CORE_EXPORT QgsSettingsTree { #ifndef SIP_RUN + public: + /** * Returns the tree root node for the settings tree */ diff --git a/src/core/settings/qgssettingstreenode.h b/src/core/settings/qgssettingstreenode.h index e6ff5a3cb1b..1e6b4cda316 100644 --- a/src/core/settings/qgssettingstreenode.h +++ b/src/core/settings/qgssettingstreenode.h @@ -81,7 +81,7 @@ class CORE_EXPORT QgsSettingsTreeNode /** * Creates a tree root node - * \note This is not available in Python bindings. Use QgsSettings.createPluginTreeNode instead. + * \note This is not available in Python bindings. Use QgsSettingsTree.createPluginTreeNode instead. */ static QgsSettingsTreeNode *createRootNode() SIP_SKIP; @@ -168,7 +168,7 @@ class CORE_EXPORT QgsSettingsTreeNode /** * \note This is not available in Python bindings. Use method createNode on an existing tree node. - * \see QgsSettings.createPluginTreeNode + * \see QgsSettingsTree.createPluginTreeNode */ QgsSettingsTreeNode() = default SIP_FORCE; @@ -261,7 +261,7 @@ class CORE_EXPORT QgsSettingsTreeNamedListNode : public QgsSettingsTreeNode /** * \note This is not available in Python bindings. Use method createNamedListNode on an existing tree node. - * \see QgsSettings.createPluginTreeNode + * \see QgsSettingsTree.createPluginTreeNode */ QgsSettingsTreeNamedListNode() = default SIP_FORCE; diff --git a/src/core/textrenderer/qgsfontmanager.cpp b/src/core/textrenderer/qgsfontmanager.cpp index b33e547baa2..dde486b4c8b 100644 --- a/src/core/textrenderer/qgsfontmanager.cpp +++ b/src/core/textrenderer/qgsfontmanager.cpp @@ -27,9 +27,9 @@ #include #include -const QgsSettingsEntryStringList *QgsFontManager::settingsFontFamilyReplacements = new QgsSettingsEntryStringList( QStringLiteral( "fontFamilyReplacements" ), QgsSettings::sTreeFonts, QStringList(), QStringLiteral( "Automatic font family replacements" ) ); +const QgsSettingsEntryStringList *QgsFontManager::settingsFontFamilyReplacements = new QgsSettingsEntryStringList( QStringLiteral( "fontFamilyReplacements" ), QgsSettingsTree::sTreeFonts, QStringList(), QStringLiteral( "Automatic font family replacements" ) ); -const QgsSettingsEntryBool *QgsFontManager::settingsDownloadMissingFonts = new QgsSettingsEntryBool( QStringLiteral( "downloadMissingFonts" ), QgsSettings::sTreeFonts, true, QStringLiteral( "Automatically download missing fonts whenever possible" ) ); +const QgsSettingsEntryBool *QgsFontManager::settingsDownloadMissingFonts = new QgsSettingsEntryBool( QStringLiteral( "downloadMissingFonts" ), QgsSettingsTree::sTreeFonts, true, QStringLiteral( "Automatically download missing fonts whenever possible" ) ); QgsFontManager::QgsFontManager( QObject *parent ) : QObject( parent ) diff --git a/src/core/vector/qgsvectorlayer.cpp b/src/core/vector/qgsvectorlayer.cpp index 03cc9858f0f..cec05e0b5d8 100644 --- a/src/core/vector/qgsvectorlayer.cpp +++ b/src/core/vector/qgsvectorlayer.cpp @@ -110,11 +110,11 @@ #include "qgssettingsentryenumflag.h" #include "qgssettingsentryimpl.h" -const QgsSettingsEntryDouble *QgsVectorLayer::settingsSimplifyDrawingTol = new QgsSettingsEntryDouble( QStringLiteral( "simplifyDrawingTol" ), QgsSettings::sTreeQgis, Qgis::DEFAULT_MAPTOPIXEL_THRESHOLD ); -const QgsSettingsEntryBool *QgsVectorLayer::settingsSimplifyLocal = new QgsSettingsEntryBool( QStringLiteral( "simplifyLocal" ), QgsSettings::sTreeQgis, true ); -const QgsSettingsEntryDouble *QgsVectorLayer::settingsSimplifyMaxScale = new QgsSettingsEntryDouble( QStringLiteral( "simplifyMaxScale" ), QgsSettings::sTreeQgis, 1.0 ); -const QgsSettingsEntryEnumFlag *QgsVectorLayer::settingsSimplifyDrawingHints = new QgsSettingsEntryEnumFlag( QStringLiteral( "simplifyDrawingHints" ), QgsSettings::sTreeQgis, QgsVectorSimplifyMethod::SimplifyHint::NoSimplification ); -const QgsSettingsEntryEnumFlag *QgsVectorLayer::settingsSimplifyAlgorithm = new QgsSettingsEntryEnumFlag( QStringLiteral( "simplifyAlgorithm" ), QgsSettings::sTreeQgis, QgsVectorSimplifyMethod::SimplifyAlgorithm::Distance ); +const QgsSettingsEntryDouble *QgsVectorLayer::settingsSimplifyDrawingTol = new QgsSettingsEntryDouble( QStringLiteral( "simplifyDrawingTol" ), QgsSettingsTree::sTreeQgis, Qgis::DEFAULT_MAPTOPIXEL_THRESHOLD ); +const QgsSettingsEntryBool *QgsVectorLayer::settingsSimplifyLocal = new QgsSettingsEntryBool( QStringLiteral( "simplifyLocal" ), QgsSettingsTree::sTreeQgis, true ); +const QgsSettingsEntryDouble *QgsVectorLayer::settingsSimplifyMaxScale = new QgsSettingsEntryDouble( QStringLiteral( "simplifyMaxScale" ), QgsSettingsTree::sTreeQgis, 1.0 ); +const QgsSettingsEntryEnumFlag *QgsVectorLayer::settingsSimplifyDrawingHints = new QgsSettingsEntryEnumFlag( QStringLiteral( "simplifyDrawingHints" ), QgsSettingsTree::sTreeQgis, QgsVectorSimplifyMethod::SimplifyHint::NoSimplification ); +const QgsSettingsEntryEnumFlag *QgsVectorLayer::settingsSimplifyAlgorithm = new QgsSettingsEntryEnumFlag( QStringLiteral( "simplifyAlgorithm" ), QgsSettingsTree::sTreeQgis, QgsVectorSimplifyMethod::SimplifyAlgorithm::Distance ); #ifdef TESTPROVIDERLIB diff --git a/src/core/vectortile/qgsvectortileconnection.h b/src/core/vectortile/qgsvectortileconnection.h index defd461fb8d..f660b7a9153 100644 --- a/src/core/vectortile/qgsvectortileconnection.h +++ b/src/core/vectortile/qgsvectortileconnection.h @@ -34,7 +34,7 @@ class CORE_EXPORT QgsVectorTileProviderConnection : public QgsAbstractProviderCo #ifndef SIP_RUN - static inline QgsSettingsTreeNamedListNode *sTreeConnectionVectorTile = QgsSettings::sTreeConnections->createNamedListNode( QStringLiteral( "vector-tile" ), QgsSettingsTreeNamedListNode::Option::NamedListSelectedItemSetting ); + static inline QgsSettingsTreeNamedListNode *sTreeConnectionVectorTile = QgsSettingsTree::sTreeConnections->createNamedListNode( QStringLiteral( "vector-tile" ), QgsSettingsTreeNamedListNode::Option::NamedListSelectedItemSetting ); static const QgsSettingsEntryString *settingsUrl; static const QgsSettingsEntryInteger *settingsZmin; diff --git a/src/gui/settings/qgssettingsregistrygui.cpp b/src/gui/settings/qgssettingsregistrygui.cpp index cccf4d31b5f..e6083933380 100644 --- a/src/gui/settings/qgssettingsregistrygui.cpp +++ b/src/gui/settings/qgssettingsregistrygui.cpp @@ -19,7 +19,7 @@ #include "qgssettingsregistrycore.h" #include "qgsstylemanagerdialog.h" -const QgsSettingsEntryBool *QgsSettingsRegistryGui::settingsRespectScreenDPI = new QgsSettingsEntryBool( QStringLiteral( "respect-screen-dpi" ), QgsSettings::sTreeGui, false ); +const QgsSettingsEntryBool *QgsSettingsRegistryGui::settingsRespectScreenDPI = new QgsSettingsEntryBool( QStringLiteral( "respect-screen-dpi" ), QgsSettingsTree::sTreeGui, false ); QgsSettingsRegistryGui::QgsSettingsRegistryGui() : QgsSettingsRegistry() diff --git a/src/gui/symbology/qgsstylemanagerdialog.h b/src/gui/symbology/qgsstylemanagerdialog.h index 2bb922e1177..f99d4fb6dc4 100644 --- a/src/gui/symbology/qgsstylemanagerdialog.h +++ b/src/gui/symbology/qgsstylemanagerdialog.h @@ -74,7 +74,7 @@ class GUI_EXPORT QgsStyleManagerDialog : public QDialog, private Ui::QgsStyleMan public: #ifndef SIP_RUN - static inline QgsSettingsTreeNode *sTtreeStyleManager = QgsSettings::sTreeApp->createChildNode( QStringLiteral( "style-manager" ) ); + static inline QgsSettingsTreeNode *sTtreeStyleManager = QgsSettingsTree::sTreeApp->createChildNode( QStringLiteral( "style-manager" ) ); /** * Last used folder for generic style database actions. diff --git a/tests/src/python/test_qgssettingsentry.py b/tests/src/python/test_qgssettingsentry.py index b0c32e17b6a..d6306d1886d 100644 --- a/tests/src/python/test_qgssettingsentry.py +++ b/tests/src/python/test_qgssettingsentry.py @@ -10,7 +10,7 @@ the Free Software Foundation; either version 2 of the License, or """ from qgis import core as qgis_core -from qgis.core import Qgis, QgsSettings, QgsSettingsEntryVariant, QgsSettingsEntryString, QgsSettingsEntryStringList, QgsSettingsEntryBool, QgsSettingsEntryInteger, QgsSettingsEntryDouble, QgsSettingsEntryColor, QgsSettingsEntryEnumFlag, QgsUnitTypes, QgsMapLayerProxyModel, QgsSettingsEntryVariantMap, QgsSettingsEntryGroup +from qgis.core import Qgis, QgsSettings, QgsSettingsTree, QgsSettingsEntryVariant, QgsSettingsEntryString, QgsSettingsEntryStringList, QgsSettingsEntryBool, QgsSettingsEntryInteger, QgsSettingsEntryDouble, QgsSettingsEntryColor, QgsSettingsEntryEnumFlag, QgsUnitTypes, QgsMapLayerProxyModel, QgsSettingsEntryVariantMap, QgsSettingsEntryGroup from qgis.testing import start_app, unittest from qgis.PyQt.QtCore import Qt @@ -100,7 +100,7 @@ class TestQgsSettingsEntry(unittest.TestCase): self.assertEqual(settings_entry.key(), settings_key_complete) def test_with_parent_element(self): - root = QgsSettings.createPluginTreeNode(self.pluginName) + root = QgsSettingsTree.createPluginTreeNode(self.pluginName) setting = QgsSettingsEntryInteger("my_setting", root) self.assertEqual(setting.key(), f"/plugins/{self.pluginName}/my_setting") self.assertEqual(setting.name(), 'my_setting') diff --git a/tests/src/python/test_qgssettingstreenode.py b/tests/src/python/test_qgssettingstreenode.py index 243a9f19b10..574768b4130 100644 --- a/tests/src/python/test_qgssettingstreenode.py +++ b/tests/src/python/test_qgssettingstreenode.py @@ -9,7 +9,7 @@ the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ -from qgis.core import QgsSettingsException, QgsSettings, QgsSettingsTreeNode, QgsSettingsEntryString, QgsSettingsEntryEnumFlag, QgsUnitTypes +from qgis.core import QgsSettingsException, QgsSettings, QgsSettingsTree, QgsSettingsTreeNode, QgsSettingsEntryString, QgsSettingsEntryEnumFlag, QgsUnitTypes from qgis.testing import start_app, unittest @@ -27,13 +27,13 @@ class TestQgsSettingsEntry(unittest.TestCase): self.pluginName = "UnitTest" def tearDown(self): - QgsSettings.unregisterPluginTreeNode(self.pluginName) + QgsSettingsTree.unregisterPluginTreeNode(self.pluginName) def test_constructor(self): with self.assertRaises(TypeError): QgsSettingsTreeNode() - root = QgsSettings.createPluginTreeNode(self.pluginName) + root = QgsSettingsTree.createPluginTreeNode(self.pluginName) self.assertEqual(root.type(), QgsSettingsTreeNode.Type.Standard) pluginsNode = root.parent() self.assertEqual(pluginsNode.type(), QgsSettingsTreeNode.Type.Standard) @@ -41,7 +41,7 @@ class TestQgsSettingsEntry(unittest.TestCase): self.assertEqual(pluginsNode.parent().parent(), None) def test_parent(self): - root = QgsSettings.createPluginTreeNode(self.pluginName) + root = QgsSettingsTree.createPluginTreeNode(self.pluginName) self.assertEqual(root.type(), QgsSettingsTreeNode.Type.Standard) l1 = root.createChildNode("test-parent-level-1") @@ -62,7 +62,7 @@ class TestQgsSettingsEntry(unittest.TestCase): self.assertEqual(l1.childrenNodes(), [l1a, l1b]) def test_setting(self): - root = QgsSettings.createPluginTreeNode(self.pluginName) + root = QgsSettingsTree.createPluginTreeNode(self.pluginName) setting = QgsSettingsEntryString("mysetting", root) self.assertEqual(setting.parent(), root) @@ -72,7 +72,7 @@ class TestQgsSettingsEntry(unittest.TestCase): self.assertEqual(root.childrenNodes(), []) def test_named_list(self): - proot = QgsSettings.createPluginTreeNode(self.pluginName) + proot = QgsSettingsTree.createPluginTreeNode(self.pluginName) l1 = proot.createChildNode("level-1") self.assertEqual(l1.namedNodesCount(), 0) nl = l1.createNamedListNode("my_list") @@ -110,14 +110,14 @@ class TestQgsSettingsEntry(unittest.TestCase): self.assertEqual(QgsSettings().value(setting.key(['item1', 'item2'])), None) def test_registration(self): - proot = QgsSettings.createPluginTreeNode(self.pluginName) + proot = QgsSettingsTree.createPluginTreeNode(self.pluginName) self.assertEqual(len(proot.childrenNodes()), 0) l1 = proot.createChildNode("level-1") self.assertEqual(len(proot.childrenNodes()), 1) - QgsSettings.unregisterPluginTreeNode(self.pluginName) + QgsSettingsTree.unregisterPluginTreeNode(self.pluginName) # with several levels + settings - proot = QgsSettings.createPluginTreeNode(self.pluginName) + proot = QgsSettingsTree.createPluginTreeNode(self.pluginName) l1 = proot.createChildNode("level-1") s1 = QgsSettingsEntryString("my-setting-1", l1) l2 = l1.createChildNode("level-2") @@ -126,16 +126,16 @@ class TestQgsSettingsEntry(unittest.TestCase): self.assertEqual(len(l2.childrenSettings()), 1) l2.unregisterChildSetting(s2) self.assertEqual(len(l2.childrenSettings()), 0) - QgsSettings.unregisterPluginTreeNode(self.pluginName) + QgsSettingsTree.unregisterPluginTreeNode(self.pluginName) def test_duplicated_key(self): - proot = QgsSettings.createPluginTreeNode(self.pluginName) + proot = QgsSettingsTree.createPluginTreeNode(self.pluginName) proot.createChildNode("duplicate-key") with self.assertRaises(QgsSettingsException): QgsSettingsEntryString("duplicate-key", proot) def test_python_implementation(self): - proot = QgsSettings.createPluginTreeNode(self.pluginName) + proot = QgsSettingsTree.createPluginTreeNode(self.pluginName) self.setting = QgsSettingsEntryEnumFlag("python-implemented-setting", proot, QgsUnitTypes.LayoutMeters) self.assertEqual(type(self.setting), QgsSettingsEntryEnumFlag) self.assertEqual(type(proot.childSetting("python-implemented-setting")), QgsSettingsEntryEnumFlag)