1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the Qt Mobility Components. |
7 ** This file is part of the Qt Mobility Components. |
8 ** |
8 ** |
41 |
41 |
42 #include "dbusserver_maemo_p.h" |
42 #include "dbusserver_maemo_p.h" |
43 |
43 |
44 QTM_BEGIN_NAMESPACE |
44 QTM_BEGIN_NAMESPACE |
45 |
45 |
46 void DBusServer::setHandlerObject(DBusComm* p) |
46 DBusServer::DBusServer(QObject *obj, DBusServerIF *iface) : QDBusAbstractAdaptor(obj), |
|
47 interface(iface) |
47 { |
48 { |
48 handler = p; |
|
49 } |
|
50 |
|
51 |
|
52 DBusServer::DBusServer(QObject *obj) : QDBusAbstractAdaptor(obj) |
|
53 { |
|
54 handler = 0; |
|
55 } |
49 } |
56 |
50 |
57 |
51 |
58 Q_NOREPLY void DBusServer::positionUpdate(const QByteArray &message) |
52 Q_NOREPLY void DBusServer::positionUpdate(const QByteArray &message) |
59 { |
53 { |
60 static QGeoPositionInfo update; |
54 static QGeoPositionInfo update; |
61 QDataStream stream(message); |
55 QDataStream stream(message); |
62 stream >> update; |
56 stream >> update; |
63 |
57 |
64 if (handler != 0) { |
58 interface->receivePositionUpdate(update); |
65 handler->receivePositionUpdate(update); |
|
66 } |
|
67 |
|
68 return; |
|
69 } |
59 } |
70 |
60 |
71 |
61 |
72 Q_NOREPLY void DBusServer::currentSettings(const QGeoPositionInfoSource::PositioningMethod methods, |
62 Q_NOREPLY void DBusServer::currentSettings(const QGeoPositionInfoSource::PositioningMethod methods, |
73 const int interval) |
63 int interval) |
74 { |
64 { |
75 if (handler != 0) { |
65 interface->receiveSettings(methods, interval); |
76 handler->receiveSettings(methods, interval); |
66 } |
77 } |
|
78 |
67 |
79 return; |
|
80 |
68 |
|
69 Q_NOREPLY void DBusServer::satellitesInViewUpdate(const QByteArray &message) |
|
70 { |
|
71 static QList<QGeoSatelliteInfo> update; |
|
72 QDataStream stream(message); |
|
73 stream >> update; |
|
74 |
|
75 interface->receiveSatellitesInView(update); |
|
76 } |
|
77 |
|
78 |
|
79 Q_NOREPLY void DBusServer::satellitesInUseUpdate(const QByteArray &message) |
|
80 { |
|
81 static QList<QGeoSatelliteInfo> update; |
|
82 QDataStream stream(message); |
|
83 stream >> update; |
|
84 |
|
85 interface->receiveSatellitesInUse(update); |
81 } |
86 } |
82 |
87 |
83 #include "moc_dbusserver_maemo_p.cpp" |
88 #include "moc_dbusserver_maemo_p.cpp" |
84 QTM_END_NAMESPACE |
89 QTM_END_NAMESPACE |
85 |
90 |