Commit 72b56f00 authored by chriadam's avatar chriadam

[systemsettings] Expose enabledDataSources in LocationSettings. Contributes to JB#33753

parent 82e3bd23
This diff is collapsed.
......@@ -38,6 +38,8 @@
#include <QObject>
#include <QString>
#define LOCATION_SETTINGS_LAST_DATA_SOURCE_BIT 31
class LocationSettingsPrivate;
class SYSTEMSETTINGS_EXPORT LocationSettings : public QObject
{
......@@ -58,6 +60,8 @@ class SYSTEMSETTINGS_EXPORT LocationSettings : public QObject
Q_PROPERTY(LocationMode locationMode READ locationMode WRITE setLocationMode NOTIFY locationModeChanged)
Q_PROPERTY(DataSources allowedDataSources READ allowedDataSources WRITE setAllowedDataSources NOTIFY allowedDataSourcesChanged)
Q_ENUMS(OnlineAGpsState)
Q_ENUMS(LocationMode)
......@@ -106,6 +110,33 @@ public:
LocationMode locationMode() const;
void setLocationMode(LocationMode locationMode);
// Data sources are grouped roughly by type,
// with gaps left for future expansion.
enum DataSource {
NoDataSources = 0UL,
OnlineDataSources = 1UL << 0,
DeviceSensorsData = 1UL << 5,
BluetoothData = 1UL << 10,
WlanData = 1UL << 15,
CellTowerData = 1UL << 20,
GpsData = 1UL << 25,
GlonassData = 1UL << 26,
BeidouData = 1UL << 27,
GalileoData = 1UL << 28,
QzssData = 1UL << 29,
SbasData = 1UL << 30,
LastDataSource = 1UL << LOCATION_SETTINGS_LAST_DATA_SOURCE_BIT
};
Q_DECLARE_FLAGS(DataSources, DataSource)
Q_FLAG(DataSources)
DataSources allowedDataSources() const;
void setAllowedDataSources(DataSources dataSources);
signals:
void hereStateChanged();
void locationEnabledChanged();
......@@ -114,6 +145,7 @@ signals:
void mlsEnabledChanged();
void mlsOnlineStateChanged();
void locationModeChanged();
void allowedDataSourcesChanged();
private:
LocationSettingsPrivate *d_ptr;
......@@ -121,4 +153,6 @@ private:
Q_DECLARE_PRIVATE(LocationSettings)
};
Q_DECLARE_OPERATORS_FOR_FLAGS(LocationSettings::DataSources)
#endif // LOCATIONSETTINGS_H
......@@ -71,6 +71,7 @@ public:
LocationSettings::LocationMode m_locationMode;
bool m_settingLocationMode;
bool m_settingMultipleSettings;
LocationSettings::DataSources m_allowedDataSources;
NetworkManager *m_connMan;
NetworkTechnology *m_gpsTech;
QDBusInterface *m_gpsTechInterface;
......
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