Skip to content

Commit

Permalink
migrate setting applyLeapSeconds to class (Bool, core)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 25, 2023
1 parent c6eab4b commit 6193093
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/options/qgsgpsoptions.cpp
Expand Up @@ -217,7 +217,7 @@ QgsGpsOptionsWidget::QgsGpsOptionsWidget( QWidget *parent )
recenteringThreshold = settings.value( QStringLiteral( "mapExtentMultiplier" ), "50", QgsSettings::Gps ).toInt();
rotateInterval = settings.value( QStringLiteral( "rotateMapInterval" ), 0, QgsSettings::Gps ).toInt();

applyLeapSeconds = settings.value( QStringLiteral( "applyLeapSeconds" ), true, QgsSettings::Gps ).toBool();
applyLeapSeconds = QgsGpsLogger::settingsApplyLeapSeconds->value();
leapSeconds = QgsGpsLogger::settingsLeapSecondsCorrection->value();

switch ( QgsGpsLogger::settingsTimeStampFormat->value() )
Expand Down
4 changes: 3 additions & 1 deletion src/core/gps/qgsgpslogger.cpp
Expand Up @@ -25,6 +25,8 @@

#include "qgssettingsentryimpl.h"
const QgsSettingsEntryDouble *QgsGpsLogger::settingsDistanceThreshold = new QgsSettingsEntryDouble( QStringLiteral( "distanceThreshold" ), QgsSettings::sTreeGps, 0 );
const QgsSettingsEntryBool *QgsGpsLogger::settingsApplyLeapSeconds = new QgsSettingsEntryBool( QStringLiteral( "applyLeapSeconds" ), QgsSettings::sTreeGps, true );

const QgsSettingsEntryString *QgsGpsLogger::settingsTimestampTimeZone = new QgsSettingsEntryString( QStringLiteral( "timestampTimeZone" ), QgsSettings::sTreeGps, QString() );

const QgsSettingsEntryInteger *QgsGpsLogger::settingsTimeStampFormat = new QgsSettingsEntryInteger( QStringLiteral( "timeStampFormat" ), QgsSettings::sTreeGps, Qt::LocalTime );
Expand Down Expand Up @@ -239,7 +241,7 @@ void QgsGpsLogger::updateGpsSettings()

acquisitionInterval = QgsGpsLogger::settingsAcquisitionInterval->value();
mDistanceThreshold = QgsGpsLogger::settingsDistanceThreshold->value();
mApplyLeapSettings = settings.value( QStringLiteral( "applyLeapSeconds" ), true, QgsSettings::Gps ).toBool();
mApplyLeapSettings = QgsGpsLogger::settingsApplyLeapSeconds->value();
mLeapSeconds = QgsGpsLogger::settingsLeapSecondsCorrection->value();

switch ( QgsGpsLogger::settingsTimeStampFormat->value() )
Expand Down
4 changes: 4 additions & 0 deletions src/core/gps/qgsgpslogger.h
Expand Up @@ -31,6 +31,8 @@
#include <QDateTime>
#include "info.h"

class QgsSettingsEntryBool;

class QgsSettingsEntryString;

class QgsSettingsEntryInteger;
Expand Down Expand Up @@ -58,6 +60,8 @@ class CORE_EXPORT QgsGpsLogger : public QObject

public:

static const QgsSettingsEntryBool *settingsApplyLeapSeconds SIP_SKIP;

static const QgsSettingsEntryString *settingsTimestampTimeZone SIP_SKIP;

static const QgsSettingsEntryInteger *settingsTimeStampFormat SIP_SKIP;
Expand Down

0 comments on commit 6193093

Please sign in to comment.