Skip to content

Commit

Permalink
QgsSettings: removed lower(), now it's case sensistive
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Mar 6, 2017
1 parent 9bb7681 commit 99f859e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
3 changes: 0 additions & 3 deletions python/core/qgssettings.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgssettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 0 additions & 3 deletions src/core/qgssettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/src/python/test_qgssettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down

0 comments on commit 99f859e

Please sign in to comment.