Skip to content

Commit 99f859e

Browse files
committedMar 6, 2017
QgsSettings: removed lower(), now it's case sensistive
1 parent 9bb7681 commit 99f859e

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed
 

‎python/core/qgssettings.sip

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
* - the second one (Global Settings) is meant to provide read-only
2222
* pre-configuration and defaults to the first one.
2323
*
24-
* Unlike the original QSettings, the keys of QgsSettings are case insensitive.
25-
*
2624
* For a given settings key, the function call to value(key, default) will return
2725
* the first existing setting in the order specified below:
2826
* - User Settings
@@ -155,7 +153,6 @@ typedef PyObject *(*pyqt5_from_qvariant_by_type)(QVariant &value, PyObject *type
155153
void setArrayIndex( int i );
156154
//! Sets the value of setting key to value. If the key already exists, the previous value is overwritten.
157155
//! An optional Section argument can be used to set a value to a specific Section.
158-
//! @note keys are case insensitive
159156
void setValue(const QString &key, const QVariant &value, const QgsSettings::Section section = QgsSettings::Section::NoSection );
160157
/** Returns the value for setting key. If the setting doesn't exist, it will be
161158
* searched in the Global Settings and if not found, returns defaultValue.

‎src/core/qgssettings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ void QgsSettings::setValue( const QString &key, const QVariant &value, const Qgs
256256
// To lower case and clean the path
257257
QString QgsSettings::sanitizeKey( QString key ) const
258258
{
259-
return QDir::cleanPath( key.toLower() );
259+
return QDir::cleanPath( key );
260260
}
261261

262262
void QgsSettings::clear()

‎src/core/qgssettings.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
* - the second one (Global Settings) is meant to provide read-only
2929
* pre-configuration and defaults to the first one.
3030
*
31-
* Unlike the original QSettings, the keys of QgsSettings are case insensitive.
32-
*
3331
* For a given settings key, the function call to value(key, default) will return
3432
* the first existing setting in the order specified below:
3533
* - User Settings
@@ -158,7 +156,6 @@ class CORE_EXPORT QgsSettings : public QObject
158156
void setArrayIndex( int i );
159157
//! Sets the value of setting key to value. If the key already exists, the previous value is overwritten.
160158
//! An optional Section argument can be used to set a value to a specific Section.
161-
//! @note keys are case insensitive
162159
void setValue( const QString &key, const QVariant &value, const Section section = Section::NoSection );
163160

164161
/** Returns the value for setting key. If the setting doesn't exist, it will be

‎tests/src/python/test_qgssettings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ def test_contains(self):
219219

220220
def test_remove(self):
221221
self.settings.setValue('testQgisSettings/temp', True)
222-
self.assertEqual(self.settings.value('testqgissettings/temp'), True)
222+
self.assertEqual(self.settings.value('testQgisSettings/temp'), True)
223223
self.settings.remove('testQgisSettings/temp')
224-
self.assertEqual(self.settings.value('testqgissettings/temp'), None)
224+
self.assertEqual(self.settings.value('testqQgisSettings/temp'), None)
225225

226226

227227
if __name__ == '__main__':

0 commit comments

Comments
 (0)
Please sign in to comment.