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

This commit is contained in:
Alessandro Pasotti 2017-03-06 10:51:54 +01:00
parent 9bb7681b86
commit 99f859e2ac
4 changed files with 3 additions and 9 deletions

View File

@ -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.

View File

@ -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()

View File

@ -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

View File

@ -219,9 +219,9 @@ class TestQgsSettings(unittest.TestCase):
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__':