Skip to content

Commit

Permalink
migrate setting timeStampFormat to class (Integer, core)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 25, 2023
1 parent 91e630e commit 1e7db48
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/options/qgsgpsoptions.cpp
Expand Up @@ -220,7 +220,7 @@ QgsGpsOptionsWidget::QgsGpsOptionsWidget( QWidget *parent )
applyLeapSeconds = settings.value( QStringLiteral( "applyLeapSeconds" ), true, QgsSettings::Gps ).toBool();
leapSeconds = QgsGpsLogger::settingsLeapSecondsCorrection->value();

switch ( settings.value( QStringLiteral( "timeStampFormat" ), Qt::LocalTime, QgsSettings::Gps ).toInt() )
switch ( QgsGpsLogger::settingsTimeStampFormat->value() )
{
case 0:
timeSpec = Qt::TimeSpec::LocalTime;
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 QgsSettingsEntryInteger *QgsGpsLogger::settingsTimeStampFormat = new QgsSettingsEntryInteger( QStringLiteral( "timeStampFormat" ), QgsSettings::sTreeGps, Qt::LocalTime );

const QgsSettingsEntryInteger *QgsGpsLogger::settingsLeapSecondsCorrection = new QgsSettingsEntryInteger( QStringLiteral( "leapSecondsCorrection" ), QgsSettings::sTreeGps, 18 );

const QgsSettingsEntryInteger *QgsGpsLogger::settingsAcquisitionInterval = new QgsSettingsEntryInteger( QStringLiteral( "acquisitionInterval" ), QgsSettings::sTreeGps, 0 );
Expand Down Expand Up @@ -238,7 +240,7 @@ void QgsGpsLogger::updateGpsSettings()
mApplyLeapSettings = settings.value( QStringLiteral( "applyLeapSeconds" ), true, QgsSettings::Gps ).toBool();
mLeapSeconds = QgsGpsLogger::settingsLeapSecondsCorrection->value();

switch ( settings.value( QStringLiteral( "timeStampFormat" ), Qt::LocalTime, QgsSettings::Gps ).toInt() )
switch ( QgsGpsLogger::settingsTimeStampFormat->value() )
{
case 0:
mTimeStampSpec = Qt::TimeSpec::LocalTime;
Expand Down
2 changes: 2 additions & 0 deletions src/core/gps/qgsgpslogger.h
Expand Up @@ -56,6 +56,8 @@ class CORE_EXPORT QgsGpsLogger : public QObject

public:

static const QgsSettingsEntryInteger *settingsTimeStampFormat SIP_SKIP;

static const QgsSettingsEntryInteger *settingsLeapSecondsCorrection SIP_SKIP;

static const QgsSettingsEntryInteger *settingsAcquisitionInterval SIP_SKIP;
Expand Down

0 comments on commit 1e7db48

Please sign in to comment.