Skip to content

Commit

Permalink
migrate setting timestampTimeZone to class (String, core)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 25, 2023
1 parent 1e7db48 commit c6eab4b
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 @@ -234,7 +234,7 @@ QgsGpsOptionsWidget::QgsGpsOptionsWidget( QWidget *parent )
timeSpec = Qt::TimeSpec::TimeZone;
break;
}
timeZone = settings.value( QStringLiteral( "timestampTimeZone" ), QVariant(), QgsSettings::Gps ).toString();
timeZone = QgsGpsLogger::settingsTimestampTimeZone->value();
}

mOffsetFromUtc->setValue( offsetFromUtc );
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 QgsSettingsEntryString *QgsGpsLogger::settingsTimestampTimeZone = new QgsSettingsEntryString( QStringLiteral( "timestampTimeZone" ), QgsSettings::sTreeGps, QString() );

const QgsSettingsEntryInteger *QgsGpsLogger::settingsTimeStampFormat = new QgsSettingsEntryInteger( QStringLiteral( "timeStampFormat" ), QgsSettings::sTreeGps, Qt::LocalTime );

const QgsSettingsEntryInteger *QgsGpsLogger::settingsLeapSecondsCorrection = new QgsSettingsEntryInteger( QStringLiteral( "leapSecondsCorrection" ), QgsSettings::sTreeGps, 18 );
Expand Down Expand Up @@ -254,7 +256,7 @@ void QgsGpsLogger::updateGpsSettings()
mTimeStampSpec = Qt::TimeSpec::TimeZone;
break;
}
mTimeZone = settings.value( QStringLiteral( "timestampTimeZone" ), QVariant(), QgsSettings::Gps ).toString();
mTimeZone = QgsGpsLogger::settingsTimestampTimeZone->value();
}

mAcquisitionInterval = acquisitionInterval * 1000;
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 QgsSettingsEntryString;

class QgsSettingsEntryInteger;

class QgsSettingsEntryDouble;
Expand All @@ -56,6 +58,8 @@ class CORE_EXPORT QgsGpsLogger : public QObject

public:

static const QgsSettingsEntryString *settingsTimestampTimeZone SIP_SKIP;

static const QgsSettingsEntryInteger *settingsTimeStampFormat SIP_SKIP;

static const QgsSettingsEntryInteger *settingsLeapSecondsCorrection SIP_SKIP;
Expand Down

0 comments on commit c6eab4b

Please sign in to comment.