Skip to content
Permalink
Browse files
Moved QgsSettings class in subdir settings
  • Loading branch information
domi4484 committed Apr 19, 2021
1 parent 68ee444 commit 598f6c73f00d57f895996d91e31fdd9f6d16b243
@@ -1,7 +1,7 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgssettings.h *
* src/core/settings/qgssettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -279,7 +279,7 @@ Removes all entries in the user settings
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgssettings.h *
* src/core/settings/qgssettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -174,7 +174,6 @@
%Include auto_generated/qgsruntimeprofiler.sip
%Include auto_generated/qgsscalecalculator.sip
%Include auto_generated/qgsscaleutils.sip
%Include auto_generated/qgssettings.sip
%Include auto_generated/qgssimplifymethod.sip
%Include auto_generated/qgssnappingconfig.sip
%Include auto_generated/qgssnappingutils.sip
@@ -602,6 +601,7 @@
%Include auto_generated/textrenderer/qgstextrenderer.sip
%Include auto_generated/textrenderer/qgstextrendererutils.sip
%Include auto_generated/textrenderer/qgstextshadowsettings.sip
%Include auto_generated/settings/qgssettings.sip
%Include auto_generated/settings/qgssettingsentry.sip
%Include auto_generated/settings/qgssettingsregistry.sip
%Include auto_generated/settings/qgssettingsregistrycore.sip
@@ -471,7 +471,6 @@ set(QGIS_CORE_SRCS
qgsvirtuallayerdefinitionutils.cpp
qgsmapthemecollection.cpp
qgsxmlutils.cpp
qgssettings.cpp
qgsarchive.cpp
qgstestutils.cpp
qgsziputils.cpp
@@ -717,6 +716,7 @@ set(QGIS_CORE_SRCS
geocms/geonode/qgsgeonodeconnection.cpp
geocms/geonode/qgsgeonoderequest.cpp

settings/qgssettings.cpp
settings/qgssettingsentry.cpp
settings/qgssettingsregistry.cpp
settings/qgssettingsregistrycore.cpp
@@ -1036,7 +1036,6 @@ set(QGIS_CORE_HDRS
qgsruntimeprofiler.h
qgsscalecalculator.h
qgsscaleutils.h
qgssettings.h
qgsshapegenerator.h
qgssimplifymethod.h
qgssnappingconfig.h
@@ -1562,6 +1561,7 @@ set(QGIS_CORE_HDRS
textrenderer/qgstextrendererutils.h
textrenderer/qgstextshadowsettings.h

settings/qgssettings.h
settings/qgssettingsentry.h
settings/qgssettingsregistry.h
settings/qgssettingsregistrycore.h
@@ -112,13 +112,13 @@ class CORE_EXPORT QgsNewsFeedParser : public QObject
static QString keyForFeed( const QString &baseUrl );

//! Settings entry last fetch time
static const inline QgsSettingsEntryInteger settingsFeedLastFetchTime = QgsSettingsEntryInteger( QStringLiteral( "%/lastFetchTime" ), QgsSettings::Core, 0, QObject::tr( "Feed last fetch time" ), 0 );
static const inline QgsSettingsEntryInteger settingsFeedLastFetchTime = QgsSettingsEntryInteger( QStringLiteral( "%1/lastFetchTime" ), QgsSettings::Core, 0, QObject::tr( "Feed last fetch time" ), 0 );
//! Settings entry feed language
static const inline QgsSettingsEntryString settingsFeedLanguage = QgsSettingsEntryString( QStringLiteral( "%/lang" ), QgsSettings::Core, QString(), QObject::tr( "Feed language" ) );
static const inline QgsSettingsEntryString settingsFeedLanguage = QgsSettingsEntryString( QStringLiteral( "%1/lang" ), QgsSettings::Core, QString(), QObject::tr( "Feed language" ) );
//! Settings entry feed latitude
static const inline QgsSettingsEntryDouble settingsFeedLatitude = QgsSettingsEntryDouble( QStringLiteral( "%/latitude" ), QgsSettings::Core, 0.0, QObject::tr( "Feed latitude" ) );
static const inline QgsSettingsEntryDouble settingsFeedLatitude = QgsSettingsEntryDouble( QStringLiteral( "%1/latitude" ), QgsSettings::Core, 0.0, QObject::tr( "Feed latitude" ) );
//! Settings entry feed longitude
static const inline QgsSettingsEntryDouble settingsFeedLongitude = QgsSettingsEntryDouble( QStringLiteral( "%/longitude" ), QgsSettings::Core, 0.0, QObject::tr( "Feed longitude" ) );
static const inline QgsSettingsEntryDouble settingsFeedLongitude = QgsSettingsEntryDouble( QStringLiteral( "%1/longitude" ), QgsSettings::Core, 0.0, QObject::tr( "Feed longitude" ) );

public slots:

File renamed without changes.
File renamed without changes.
@@ -85,11 +85,20 @@ QString QgsSettingsEntryBase::key( const QStringList &dynamicKeyPartList ) const

bool QgsSettingsEntryBase::checkKey( const QString &key ) const
{
QString completeKey = key;
if ( !mPluginName.isEmpty()
&& !completeKey.startsWith( mPluginName ) )
{
if ( !completeKey.startsWith( "/" ) )
completeKey.prepend( "/" );
completeKey.prepend( mPluginName );
}

if ( !hasDynamicKey() )
return key == QgsSettingsEntryBase::key();
return completeKey == QgsSettingsEntryBase::key();

QRegularExpression regularExpression( definitionKey().replace( QRegularExpression( "%\\d+" ), ".*" ) );
QRegularExpressionMatch regularExpresisonMatch = regularExpression.match( key );
QRegularExpressionMatch regularExpresisonMatch = regularExpression.match( completeKey );
return regularExpresisonMatch.hasMatch();
}

@@ -23,14 +23,9 @@

class PyQgsSettingsRegistry(unittest.TestCase):

cnt = 0

def setUp(self):
self.pluginName = "UnitTestSettingsRegistry"

def tearDown(self):
pass

def test_settings_registry(self):

settingsEntryKey = "settingsRegistry/integerValue"

0 comments on commit 598f6c7

Please sign in to comment.