Skip to content

Commit 2db776e

Browse files
committedApr 1, 2021
Fixes typos and banned keywords
1 parent 9d4c665 commit 2db776e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed
 

‎src/core/settings/qgssettingsentry.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@
2323
#include "qgis_sip.h"
2424
#include "qgssettings.h"
2525

26+
#define QGS_SETTING_ENTRY_VARIANT(name, path, section, defaultValue, ...) \
27+
struct name : public QgsSettingsEntry\
28+
{ name() : QgsSettingsEntry( path, section, defaultValue, ##__VA_ARGS__ ) {} };
29+
2630
/**
2731
* \ingroup core
2832
* \class QgsSettingsEntry
2933
*
3034
* Represent settings entry and provides methods for reading and writing settings values.
31-
* Different subclasses are provided for differents settings types with metainformations
35+
* Different subclasses are provided for different settings types with metainformations
3236
* to validate set values and provide more accurate settings description for the gui.
3337
*
3438
* \since QGIS 3.20
@@ -204,7 +208,7 @@ class CORE_EXPORT QgsSettingsEntryString : public QgsSettingsEntry
204208
* The \a default value argument specifies the default value for the settings entry.
205209
* The \a description argument specifies a description for the settings entry.
206210
* The \a minLength argument specifies the minimal length of the string value.
207-
* The \a maxLength argument specifies the maximal lenght of the string value.
211+
* The \a maxLength argument specifies the maximal length of the string value.
208212
* By -1 the there is no limit
209213
*/
210214
QgsSettingsEntryString( const QString &key,
@@ -341,8 +345,8 @@ class CORE_EXPORT QgsSettingsEntryInteger : public QgsSettingsEntry
341345
QgsSettings::Section section,
342346
qlonglong defaultValue = 0,
343347
const QString &description = QString(),
344-
qlonglong minValue = -__LONG_LONG_MAX__ + 1,
345-
qlonglong maxValue = __LONG_LONG_MAX__ );
348+
qlonglong minValue = std::numeric_limits<qlonglong>::min(),
349+
qlonglong maxValue = std::numeric_limits<qlonglong>::max() );
346350

347351
//! \copydoc QgsSettingsEntry::setValue
348352
bool setValue( const QVariant &value, const QString &dynamicKeyPart = QString() ) override;
@@ -397,8 +401,8 @@ class CORE_EXPORT QgsSettingsEntryDouble : public QgsSettingsEntry
397401
QgsSettings::Section section,
398402
double defaultValue = 0.0,
399403
const QString &description = QString(),
400-
double minValue = __DBL_MIN__,
401-
double maxValue = __DBL_MAX__,
404+
double minValue = std::numeric_limits<double>::min(),
405+
double maxValue = std::numeric_limits<double>::max(),
402406
double displayDecimals = 1 );
403407

404408
//! \copydoc QgsSettingsEntry::setValue

0 commit comments

Comments
 (0)
Please sign in to comment.