Skip to content

Commit

Permalink
migrate setting acquisitionInterval 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 9514613 commit 7ca6dcd
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 @@ -209,7 +209,7 @@ QgsGpsOptionsWidget::QgsGpsOptionsWidget( QWidget *parent )
gpsdPort = settings.value( QStringLiteral( "gpsdPort" ), 2947, QgsSettings::Gps ).toInt();
gpsdDevice = settings.value( QStringLiteral( "gpsdDevice" ), QVariant(), QgsSettings::Gps ).toString();

acquisitionInterval = settings.value( QStringLiteral( "acquisitionInterval" ), 0, QgsSettings::Gps ).toInt();
acquisitionInterval = QgsGpsLogger::settingsAcquisitionInterval->value();
distanceThreshold = QgsGpsLogger::settingsDistanceThreshold->value();

bearingFromTravelDirection = settings.value( QStringLiteral( "calculateBearingFromTravel" ), "false", QgsSettings::Gps ).toBool();
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::settingsAcquisitionInterval = new QgsSettingsEntryInteger( QStringLiteral( "acquisitionInterval" ), QgsSettings::sTreeGps, 0 );



const QgsSettingsEntryEnumFlag<Qgis::GpsInformationComponent> *QgsGpsLogger::settingsGpsMValueComponent = new QgsSettingsEntryEnumFlag<Qgis::GpsInformationComponent>( QStringLiteral( "m-value-attribute" ), QgsSettings::sTreeGps, Qgis::GpsInformationComponent::Timestamp, QStringLiteral( "Which GPS attribute should be stored in geometry m values" ) ) SIP_SKIP;
Expand Down Expand Up @@ -229,7 +231,7 @@ void QgsGpsLogger::updateGpsSettings()
// legacy settings
QgsSettings settings;

acquisitionInterval = settings.value( QStringLiteral( "acquisitionInterval" ), 0, QgsSettings::Gps ).toInt();
acquisitionInterval = QgsGpsLogger::settingsAcquisitionInterval->value();
mDistanceThreshold = QgsGpsLogger::settingsDistanceThreshold->value();
mApplyLeapSettings = settings.value( QStringLiteral( "applyLeapSeconds" ), true, QgsSettings::Gps ).toBool();
mLeapSeconds = settings.value( QStringLiteral( "leapSecondsCorrection" ), 18, QgsSettings::Gps ).toInt();
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 QgsSettingsEntryInteger;

class QgsSettingsEntryDouble;

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

public:

static const QgsSettingsEntryInteger *settingsAcquisitionInterval SIP_SKIP;

static const QgsSettingsEntryDouble *settingsDistanceThreshold SIP_SKIP;

#ifndef SIP_RUN
Expand Down

0 comments on commit 7ca6dcd

Please sign in to comment.