Commit 82e3bd23 authored by chriadam's avatar chriadam

[systemsettings] Expose LocationMode. Contributes to JB#33753

Previously, the UI determined the location mode from the other
values.  This commit moves this logic into systemsettings directly.
parent e588cc1f
This diff is collapsed.
......@@ -56,7 +56,10 @@ class SYSTEMSETTINGS_EXPORT LocationSettings : public QObject
Q_PROPERTY(OnlineAGpsState mlsOnlineState READ mlsOnlineState WRITE setMlsOnlineState NOTIFY mlsOnlineStateChanged)
Q_PROPERTY(bool mlsAvailable READ mlsAvailable CONSTANT)
Q_PROPERTY(LocationMode locationMode READ locationMode WRITE setLocationMode NOTIFY locationModeChanged)
Q_ENUMS(OnlineAGpsState)
Q_ENUMS(LocationMode)
public:
enum Mode {
......@@ -93,6 +96,16 @@ public:
void setMlsOnlineState(OnlineAGpsState state);
bool mlsAvailable() const;
enum LocationMode {
HighAccuracyMode,
BatterySavingMode,
DeviceOnlyMode,
CustomMode
};
LocationMode locationMode() const;
void setLocationMode(LocationMode locationMode);
signals:
void hereStateChanged();
void locationEnabledChanged();
......@@ -100,6 +113,7 @@ signals:
void gpsFlightModeChanged();
void mlsEnabledChanged();
void mlsOnlineStateChanged();
void locationModeChanged();
private:
LocationSettingsPrivate *d_ptr;
......
......@@ -56,14 +56,21 @@ public:
LocationSettingsPrivate(LocationSettings::Mode mode, LocationSettings *settings);
~LocationSettingsPrivate();
LocationSettings::LocationMode calculateLocationMode() const;
void writeSettings();
bool mlsAvailable() const;
bool hereAvailable() const;
QFileSystemWatcher m_watcher;
bool m_locationEnabled;
bool m_gpsEnabled;
bool m_mlsEnabled;
LocationSettings::OnlineAGpsState m_mlsOnlineState;
LocationSettings::OnlineAGpsState m_hereState;
LocationSettings::LocationMode m_locationMode;
bool m_settingLocationMode;
bool m_settingMultipleSettings;
NetworkManager *m_connMan;
NetworkTechnology *m_gpsTech;
QDBusInterface *m_gpsTechInterface;
......@@ -73,6 +80,7 @@ private slots:
void readSettings();
void findGpsTech();
void gpsTechPropertyChanged(const QString &propertyName, const QVariant &value);
void recalculateLocationMode();
};
#endif // NEMO_SYSTEMSETTINGS_LOCATIONSETTINGS_P_H
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