Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[mer][qtlocation] Move geocluetype registrations to geocluetypes.h. F…
…ixes JB#41029
  • Loading branch information
rainemak committed Apr 10, 2018
1 parent 166e3ad commit 0f3262c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/plugins/position/geoclue/geocluetypes.cpp
Expand Up @@ -64,6 +64,18 @@ const QDBusArgument &operator>>(const QDBusArgument &arg, Accuracy &accuracy)
return dbus_argument_helper(arg, accuracy);
}

QDBusArgument &operator<<(QDBusArgument &arg, const QGeoSatelliteInfo &si)
{
arg.beginStructure();
arg << si.satelliteIdentifier();
arg << (qint32)si.attribute(QGeoSatelliteInfo::Elevation);
arg << (qint32)si.attribute(QGeoSatelliteInfo::Azimuth);
arg << si.signalStrength();
arg.endStructure();

return arg;
}

const QDBusArgument &operator>>(const QDBusArgument &argument, QGeoSatelliteInfo &si)
{
qint32 a;
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/position/geoclue/geocluetypes.h
Expand Up @@ -79,6 +79,8 @@ class Accuracy
};

Q_DECLARE_METATYPE(Accuracy)
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QGeoSatelliteInfo)
Q_DECLARE_METATYPE(QList<QGeoSatelliteInfo>)


Expand All @@ -89,6 +91,7 @@ Q_DECLARE_TYPEINFO(Accuracy, Q_MOVABLE_TYPE);
QDBusArgument &operator<<(QDBusArgument &arg, const Accuracy &accuracy);
const QDBusArgument &operator>>(const QDBusArgument &arg, Accuracy &accuracy);

QDBusArgument &operator<<(QDBusArgument &arg, const QGeoSatelliteInfo &si);
const QDBusArgument &operator>>(const QDBusArgument &arg, QGeoSatelliteInfo &si);
const QDBusArgument &operator>>(const QDBusArgument &arg, QList<QGeoSatelliteInfo> &sis);

Expand Down
Expand Up @@ -48,14 +48,15 @@

#define MINIMUM_UPDATE_INTERVAL 1000

Q_DECLARE_METATYPE(QList<int>)

QT_BEGIN_NAMESPACE

QGeoSatelliteInfoSourceGeoclueMaster::QGeoSatelliteInfoSourceGeoclueMaster(QObject *parent)
: QGeoSatelliteInfoSource(parent), m_master(new QGeoclueMaster(this)), m_provider(0), m_sat(0),
m_error(NoError), m_satellitesChangedConnected(false), m_running(false)
{
qDBusRegisterMetaType<QGeoSatelliteInfo>();
qDBusRegisterMetaType<QList<QGeoSatelliteInfo> >();

connect(m_master, SIGNAL(positionProviderChanged(QString,QString,QString,QString)),
this, SLOT(positionProviderChanged(QString,QString,QString,QString)));
m_requestTimer.setSingleShot(true);
Expand Down

0 comments on commit 0f3262c

Please sign in to comment.