Skip to content
Permalink
Browse files

QgsSettings: removed lower(), now it's case sensistive

  • Loading branch information
elpaso committed Mar 6, 2017
1 parent 9bb7681 commit 99f859e2ac2ee4681b27ecafd8794fd68027f1df
Showing with 3 additions and 9 deletions.
  1. +0 −3 python/core/qgssettings.sip
  2. +1 −1 src/core/qgssettings.cpp
  3. +0 −3 src/core/qgssettings.h
  4. +2 −2 tests/src/python/test_qgssettings.py
@@ -21,8 +21,6 @@
* - the second one (Global Settings) is meant to provide read-only
* pre-configuration and defaults to the first one.
*
* Unlike the original QSettings, the keys of QgsSettings are case insensitive.
*
* For a given settings key, the function call to value(key, default) will return
* the first existing setting in the order specified below:
* - User Settings
@@ -155,7 +153,6 @@ typedef PyObject *(*pyqt5_from_qvariant_by_type)(QVariant &value, PyObject *type
void setArrayIndex( int i );
//! Sets the value of setting key to value. If the key already exists, the previous value is overwritten.
//! An optional Section argument can be used to set a value to a specific Section.
//! @note keys are case insensitive
void setValue(const QString &key, const QVariant &value, const QgsSettings::Section section = QgsSettings::Section::NoSection );
/** Returns the value for setting key. If the setting doesn't exist, it will be
* searched in the Global Settings and if not found, returns defaultValue.
@@ -256,7 +256,7 @@ void QgsSettings::setValue( const QString &key, const QVariant &value, const Qgs
// To lower case and clean the path
QString QgsSettings::sanitizeKey( QString key ) const
{
return QDir::cleanPath( key.toLower() );
return QDir::cleanPath( key );
}

void QgsSettings::clear()
@@ -28,8 +28,6 @@
* - the second one (Global Settings) is meant to provide read-only
* pre-configuration and defaults to the first one.
*
* Unlike the original QSettings, the keys of QgsSettings are case insensitive.
*
* For a given settings key, the function call to value(key, default) will return
* the first existing setting in the order specified below:
* - User Settings
@@ -158,7 +156,6 @@ class CORE_EXPORT QgsSettings : public QObject
void setArrayIndex( int i );
//! Sets the value of setting key to value. If the key already exists, the previous value is overwritten.
//! An optional Section argument can be used to set a value to a specific Section.
//! @note keys are case insensitive
void setValue( const QString &key, const QVariant &value, const Section section = Section::NoSection );

/** Returns the value for setting key. If the setting doesn't exist, it will be
@@ -219,9 +219,9 @@ def test_contains(self):

def test_remove(self):
self.settings.setValue('testQgisSettings/temp', True)
self.assertEqual(self.settings.value('testqgissettings/temp'), True)
self.assertEqual(self.settings.value('testQgisSettings/temp'), True)
self.settings.remove('testQgisSettings/temp')
self.assertEqual(self.settings.value('testqgissettings/temp'), None)
self.assertEqual(self.settings.value('testqQgisSettings/temp'), None)


if __name__ == '__main__':

0 comments on commit 99f859e

Please sign in to comment.
You can’t perform that action at this time.