Commit be5e77e2 authored by chriadam's avatar chriadam

[nemo-qml-plugin-systemsettings] Expose available location data sources. Contributes to JB#33753

parent 866bf9f4
......@@ -79,6 +79,17 @@ namespace {
{ LocationSettings::QzssData, QStringLiteral("allowed_data_sources\\qzss") },
{ LocationSettings::SbasData, QStringLiteral("allowed_data_sources\\sbas") }
};
// TODO: in future, read this from some per-variant configuration settings file,
// e.g. if the device doesn't support gps or bluetooth or wlan etc, remove from
// the available data sources; also add GNSS constellation options in the future.
const QVector<LocationSettings::DataSource> AvailableDataSources {
LocationSettings::OnlineDataSources,
LocationSettings::DeviceSensorsData,
LocationSettings::BluetoothData,
LocationSettings::WlanData,
LocationSettings::CellTowerData,
LocationSettings::GpsData
};
}
IniFile::IniFile(const QString &fileName)
......@@ -185,6 +196,7 @@ LocationSettingsPrivate::LocationSettingsPrivate(LocationSettings::Mode mode, Lo
, m_locationMode(LocationSettings::CustomMode)
, m_settingLocationMode(true)
, m_settingMultipleSettings(false)
, m_availableDataSources(AvailableDataSources)
, m_allowedDataSources(static_cast<LocationSettings::DataSources>(std::numeric_limits<quint32>::max()))
, m_connMan(Q_NULLPTR)
, m_gpsTech(Q_NULLPTR)
......@@ -538,6 +550,12 @@ void LocationSettings::setLocationMode(LocationMode locationMode)
d->m_settingLocationMode = false;
}
QVector<LocationSettings::DataSource> LocationSettings::availableDataSources() const
{
Q_D(const LocationSettings);
return d->m_availableDataSources;
}
LocationSettings::DataSources LocationSettings::allowedDataSources() const
{
Q_D(const LocationSettings);
......
......@@ -37,6 +37,7 @@
#include <QObject>
#include <QString>
#include <QVector>
#define LOCATION_SETTINGS_LAST_DATA_SOURCE_BIT 31
......@@ -60,6 +61,7 @@ class SYSTEMSETTINGS_EXPORT LocationSettings : public QObject
Q_PROPERTY(LocationMode locationMode READ locationMode WRITE setLocationMode NOTIFY locationModeChanged)
Q_PROPERTY(QVector<DataSource> availableDataSources READ availableDataSources CONSTANT)
Q_PROPERTY(DataSources allowedDataSources READ allowedDataSources WRITE setAllowedDataSources NOTIFY allowedDataSourcesChanged)
Q_ENUMS(OnlineAGpsState)
......@@ -133,7 +135,9 @@ public:
};
Q_DECLARE_FLAGS(DataSources, DataSource)
Q_FLAG(DataSources)
Q_ENUM(DataSource)
QVector<DataSource> availableDataSources() const;
DataSources allowedDataSources() const;
void setAllowedDataSources(DataSources dataSources);
......
......@@ -73,6 +73,7 @@ public:
LocationSettings::LocationMode m_locationMode;
bool m_settingLocationMode;
bool m_settingMultipleSettings;
QVector<LocationSettings::DataSource> m_availableDataSources;
LocationSettings::DataSources m_allowedDataSources;
NetworkManager *m_connMan;
NetworkTechnology *m_gpsTech;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment