Navigation Menu

Skip to content

Commit

Permalink
Add a core settings registry value for GPSBabel path
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 2, 2021
1 parent 41d98c8 commit 5ecd73d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions resources/qgis_global_settings.ini
Expand Up @@ -237,6 +237,9 @@ enable_problem_resolution=false
# Default for GPS leap seconds correction as of 2019-06-19
leapSecondsCorrection=18

# Path to (or command name for) the GPSBabel executable file
gpsbabelPath=gpsbabel

# [proxy]
# # URL list for which proxy configuration doesn't apply. In the case of these URLs, the default system proxy configuration
# # is applied
Expand Down
5 changes: 2 additions & 3 deletions src/analysis/processing/qgsalgorithmgpsbabeltools.cpp
Expand Up @@ -20,6 +20,7 @@
#include "qgsrunprocess.h"
#include "qgsproviderutils.h"
#include "qgssettings.h"
#include "qgssettingsregistrycore.h"

///@cond PRIVATE

Expand Down Expand Up @@ -96,9 +97,7 @@ QVariantMap QgsConvertGpxFeatureTypeAlgorithm::processAlgorithm( const QVariantM

const ConversionType convertType = static_cast< ConversionType >( parameterAsEnum( parameters, QStringLiteral( "CONVERSION" ), context ) );

// TODO -- fix the settings path when the rest of the GPS tools plugin is migrated
QgsSettings settings;
QString babelPath = settings.value( QStringLiteral( "Plugin-GPS/gpsbabelpath" ), QString() ).toString();
QString babelPath = QgsSettingsRegistryCore::settingsGpsBabelPath.value();
if ( babelPath.isEmpty() )
babelPath = QStringLiteral( "gpsbabel" );

Expand Down
3 changes: 3 additions & 0 deletions src/core/settings/qgssettingsregistrycore.h
Expand Up @@ -172,6 +172,9 @@ class CORE_EXPORT QgsSettingsRegistryCore : public QgsSettingsRegistry

//! Settings entry digitizing tracing max feature count
static const inline QgsSettingsEntryInteger settingsDigitizingTracingMaxFeatureCount = QgsSettingsEntryInteger( QStringLiteral( "/qgis/digitizing/tracing_max_feature_count" ), QgsSettings::NoSection, 10000 );

//! Settings entry path to GPSBabel executable.
static const inline QgsSettingsEntryString settingsGpsBabelPath = QgsSettingsEntryString( QStringLiteral( "gpsbabelPath" ), QgsSettings::Gps, QStringLiteral( "gpsbabel" ) );
#endif

};
Expand Down

0 comments on commit 5ecd73d

Please sign in to comment.